Tag Archives: Developer

Register Now for the Spring 2014 AdWords API Workshops

We're pleased to announce that the AdWords API Workshops are coming back for another round in April and May of 2014. Registration is now open!

Workshop topics include:
  • Shopping campaigns - how shopping integrates into the AdWords API
  • MCC scripts - The feature that was most requested is now available for beta signup
  • FeedServices updates - including the new location extensions setup
  • Targeting types - DSAs, DomainSetting and AutoTagging
  • Analytics - getting started with the Analytics API and how it fits within your AdWords apps
  • Bid Estimation - the different ways to estimate bids using the API

Not only are the workshops an important way to keep up-to-date with new features and best practices in the AdWords API, they are a great way for you to meet with and ask questions of the Google AdWords API team in person. This is also a key event for members of the community to bring their feedback directly to us. Finally, it’s a great opportunity for you to exchange ideas and best practices with fellow developers.

Register now and join us at a workshop in one of the following cities:
  • London, UK, April 29
  • Hamburg, Germany, May 13
  • Amsterdam, Netherlands, May 15
  • New York City, USA, May 5
  • San Francisco, USA, May 12
  • Shanghai, China, May 20 (in Chinese)
  • Taipei, Taiwan, May 22 (in Chinese)
  • Delhi, India, May 26
  • Sydney, Australia, May 29

Note: The workshops in the USA, Europe, and Australia are technical in nature and best suited to developers. Those in China, Taiwan, and India will have additional sessions accessible to a broader audience, including non-developers.

For more information on the agenda, location and logistics, please visit the AdWords API Workshop website.

Search Network with Display Select (SNDS) is now supported in v201402

Starting with v201402 of the AdWords API, all newly created Search and Display Network campaigns will automatically be Search Network with Display Select campaigns. This means:
  • If you don't specify displaySelect when creating a Search and Display Network campaign, it will default to true, creating a Search Network with Display Select campaign
  • If you edit the networkSetting of an existing Search only campaign to target Content Network and do not specify displaySelect, we will upgrade the campaign to Search Network with Display Select by setting displaySelect to true
  • If you create a Search and Display Network campaign or edit the networkSetting of an existing Search only campaign to target Content Network, and specify displaySelect as false, you will receive an OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE error
We encourage you to update your campaigns to Search Network with Display Select by setting the displaySelect property to true. Starting on September 16, 2014, we will start converting all Search and Display Network campaigns to Search Network with Display Select.

Search Network with Display Select uses improved signals and methods of predicting when and where your ads are likely to perform best, and sets a higher bar for when to show them. That means your ads are more likely to be shown to a smaller number of prospective customers, who are more likely to be interested in your offerings.

For more information about creating these types of campaigns, see our previous blog post. For more general information about this AdWords feature, please see here.

If you have any questions about this change, please contact us on the forum or via our Google+ page.

Enforcing Unique Names for Feeds in the AdWords API

Starting on April 29, 2014, the FeedService will start validating that newly added Feeds have unique names within an AdWords account. Once this change goes into effect, you will get a FeedError when you ADD a new Feed with the same name as another active Feed.

Currently it’s possible to have multiple Feeds with the same name. Introducing unique names will improve clarity in the user interface, and it will also allow Feeds to be referenced unambiguously by name, in addition to their ID.

Please ensure that your application is both uniquely naming Feeds and able to handle a potential naming conflict before this change goes into effect.

Shortly after this change is rolled out, we will append a unique value to the names of any remaining duplicates. For example, the following pair of Feeds on the left would be renamed as follows:

Old Names
New Names
My Sitelinks Feed
My Sitelinks Feed-1
My Sitelinks Feed
My Sitelinks Feed-2


Step Inside AdWords on April 22 and be the first to see the newest innovations

It’s an exciting time to be a performance marketer. When we combine the creative magic of marketing with technology that’s available anytime, anywhere, and on any device, we can connect with customers in more innovative and relevant ways than ever before.

We are constantly working to improve AdWords, and on Tuesday, April 22, 2014 at 9am PT, Jerry Dischler, VP of Product Management for AdWords will share a brand new set of innovations with you live on the Inside AdWords blog. Register for the livestream here.

Building on the success of enhanced campaigns, Jerry will announce a number of new features that help you use context to reach customers in even more effective ways. We’ve designed new tools so you can increase awareness and engagement everywhere your customers are online – from the web, to the mobile web, to mobile apps. And when it’s time to manage your campaigns and measure performance, we want to help you do so efficiently in AdWords with new functionality designed for the multi-screen world.

These AdWords innovations are the result of countless conversations we’ve had over the past year with advertisers, both large and small. Based on your feedback, hundreds of product managers and engineers worked hard to build these new products. Simply put, we built these new products for you.

We hope you’ll join the April 22 livestream of our announcements featured here on the Inside AdWords blog. Register for the livestream here. Until then, follow us on our +GoogleAds page for sneak previews of what’s to come. Use hashtag, #StepInsideAdWords, to join in on the conversation.

Monetizing Unity Mobile Apps Just Got Easier

Calling all Unity app developers! We are excited to announce the launch of version 2.0 of the Google Mobile Ads Unity Plugin. The new version comes with a completely rewritten, but much more flexible, API. It includes the following new features:

  • A single package supporting both Android and iOS
  • Support for running apps in the Unity editor
  • Ability to create multiple banner instances
  • Ability to create banners of any size
  • Flexible ad request targeting
  • and much more!

Taking a closer look at how to integrate the plugin, a typical banner request in v2.0 looks like this:


BannerView bannerView = new BannerView(
"YOUR_AD_UNIT_ID", AdSize.Banner, AdPosition.Top);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);

For custom banner sizes, simply pass in an AdSize object into the BannerView constructor:


AdSize adSize = new AdSize(250, 250);
BannerView bannerView = new BannerView(
"YOUR_AD_UNIT_ID", adSize, AdPosition.Top);

Want to pass additional targeting parameters? No problem! Set your custom targeting when building the AdRequest:


AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator)
.AddTestDevice("0123456789ABCDEF0123456789ABCDEF")
.AddKeyword("unity")
.SetGender(Gender.Male)
.SetBirthday(new DateTime(1985, 1, 1))
.TagForChildDirectedTreatment(true)
.Build();

Listening for ad events is also extremely straightforward. Register for the callbacks you care about:


bannerView.AdLoaded += HandleAdLoaded;
bannerView.AdFailedToLoad += HandleAdFailedToLoad;
bannerView.AdOpened += HandleAdOpened;
bannerView.AdClosing += HandleAdClosing;
bannerView.AdClosed += HandleAdClosed;
bannerView.AdLeftApplication += HandleAdLeftApplication;



public void HandleAdLoaded()
{
print("HandleAdLoaded event received.");
}

You can also manage the lifecycle of each BannerView by calling show(), hide(), or destroy().

To get access to these awesome features, check out the source code. Also stay tuned for upcoming support for interstitial ads.

If you have any feature requests or bug reports against the plugin, track it! If you have questions about how to use the plugin, speak up! And if you just want the latest news on what’s going on in the wonderful world of Google Ads, circle us!

Sending data from Lantronix to Google Analytics

The following is a guest post from Kurt Busch, CEO, and Mariano Goluboff, Principal Field Applications Engineer at Lantronix.

Background
Google Analytics makes it easy to create custom dashboards to present data in the format that most helps to drive business processes. We’ve put together a solution that will make several of our devices (networking and remote access devices) easily configurable to enable delivery of end device data to Google Analytics. We use the Lantronix PremierWave family of devices to connect to an end device via a serial port like RS-232/485, or Ethernet, intelligently extract useful data, and send it to Google Analytics for use in M2M applications. 

What you need
To get started, grab the Pyserial module, and load it on your Lantronix PremierWave XC HSPA+. You’ll also want a device with a serial port that sends data you want to connect to Google Analytics. A digital scale like the 349KLX is a good choice.

Architecture overview
With the Measurement Protocol, part of Universal Analytics, it is now possible to connect data from more than web browsers to Analytics.

Lantronix integrated the Measurement Protocol by using an easy to deploy Python script. By being able to natively execute Python on PremierWave and xSenso devices, Lantronix makes it very easy to deploy intelligent applications leveraging Python’s ease of programming and extensive libraries.
The demonstration consists of a scale with an RS-232 output, connected to a Lantronix PremierWave XC HSPA+. The Python script running on the PremierWave XC HSPA+ parses the data from the scale, and sends the weight received to Google Analytics, where it can then be displayed.

The hardware setup is show in the picture below.


The technical details
The Python program demonstrated by Lantronix uses the Pyserial module to parse this data. The serial port is easily initialized with Pyserial:
class ser349klx:
# setup the serial port. Pass the device as '/dev/ttyS1' or '/dev/ttyS2' for
# serial port 1 and 2 (respectively) in PremierWave EN or XC HSPA+
def __init__(self, device, weight, ga):
while True:
try:
serstat = True
ser = serial.Serial(device,2400, interCharTimeout=0.2, timeout=1)
except Exception:
serstat = False
if serstat:
break
self.ser = ser
self.weight = weight
self.ga = ga

The scale used constantly sends the current weight via the RS-232 port, with each value separated by a carriage return:

def receive_line(self):
buffer = ''
while True:
buffer = buffer + self.ser.read(self.ser.inWaiting())
if '\r' in buffer:
lines = buffer.split('\r')
return lines[-2]

The code that finds a new weight is called from a loop, which then waits for 10 equal non-zero values to wait for the weight to settle before sending it to Google Analytics, as shown below:
# This runs a continuous loop listening for lines coming from the
# serial port and processing them.
def getData(self):
count = 0
prev = 0.0
#print self.ser.interCharTimeout
while True:
time.sleep(0.1)
try:
val = self.receive_line()
weight.value=float(val[-5:])*0.166
if (prev == weight.value):
count += 1
if (count == 10) and (str(prev) != '0.0'):
self.ga.send("{:.2f}".format(prev))
else:
count = 0
prev = weight.value
except Exception:
pass

Since the Google Analytics Measurement Protocol uses standard HTTP requests to send data from devices other than web browsers, the ga.send method is easily implemented using the Python urllib and urllib2 modules, as seen below:

class gaConnect:
def __init__(self, tracking, mac):
self.tracking = tracking
self.mac = mac
def send(self, data):
values = { 'v' : '1',
'tid' : self.tracking,
'cid' : self.mac,
't' : 'event',
'ec' : 'scale',
'ea' : 'weight',
'el' : data }
res = urllib2.urlopen(urllib2.Request("http://www.google-analytics.com/collect", urllib.urlencode(values)))

The last piece is to initialize get a Google Analytics connect object to connect to the user’s Analytics account:

ga = gaConnect("UA-XXXX-Y", dev.mac)

The MAC address of the PremierWave device is used to send unique information from each device.

Results
With these pieces put together, it’s quick and easy to get data from the device to Google Analytics, and then use the extensive custom reporting and modeling that is available to view the data. For example, see the screenshot below of real-time events:

Using Lantronix hardware, you can connect your serial devices or analog sensors to the network via Ethernet, Wi-Fi, or Cellular. Using Python and the Google Analytics Measurement Protocol, the data can be quickly and easily added to your custom Google Analytics reports and dashboards for use in business intelligence and reporting.

Posted by Aditi Rajaram, the Google Analytics team


Changes Required for Creating New Campaigns in the AdWords API v201402

With v201402 of the AdWords API, it is now necessary to set the advertisingChannelType when you create a new Campaign. As part of this change, the networkSetting attribute is now used to define in more detail where you want your ads to appear.

All newly created campaigns, or campaigns that are switched into targeting both Search and Display using v201402, will automatically be SNDS campaigns. This behavior is the same as you will see in the AdWords User Interface, bringing that and the API into closer alignment. Existing applications are unaffected. As we continue to invest in Search Network with Display Select (SNDS) and see strong adoption from advertisers, we will over time be upgrading Search & Display Network campaigns to Search Network with Display Select.

With the introduction of both SNDS and Shopping campaigns, the new advertisingChannelType field allows you to state which kind of Campaign you're building. The field is an enumeration, which can be set to:
  • SEARCH, for the Search Network, including (for campaigns created with older API releases) Search and Display hybrids, and now SNDS campaigns;
  • DISPLAY, for the Google Display Network only;
  • SHOPPING, for Shopping campaigns serving Product Listing Ads on Google and Google Shopping.
Note that an UNKNOWN value can be returned if the value set isn't supported by the called version of the API. This covers situations where new options are added in newer releases.

This table specifies the only valid combinations of parameters for newly created campaigns on the networks that you intend to target.

Networks Targeted by the settings on the right
advertisingChannelType
displaySelect
Enabled networkSettings
Search Network
SEARCH
false
Search Networks only
Search Network with Display Select
SEARCH
true or unspecified
Search & Content networks
Display only
DISPLAY
false or unspecified
Content Network only
Shopping only
SHOPPING
false or unspecified
Search Network only

Any parameter combination other than the above when creating a new campaign or making targeting changes to existing campaigns will be rejected with an OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE error.

While you can no longer create Search & Display Network campaigns, existing campaigns of this type will remain unchanged. You can identify them by their displaySelect attribute being false, while both the Search and Content Networks are enabled. These campaigns should be migrated to SNDS by setting displaySelect to true.

The advertiserChannelType and isDisplaySelect fields are also present in reporting, so you can see how your Campaigns are configured.

If you have any questions about this change or the AdWords API in general, you can post them on our developer forum. You can also follow our Google+ page for updates about the AdWords API.

Support for v201402 Reports in AdWords Scripts

We are announcing support for AdWords API v201402 reports in AdWords scripts. The following new reports are available for use:
  • BID_GOAL_PERFORMANCE_REPORT
  • PAID_ORGANIC_QUERY_REPORT
  • PRODUCT_PARTITION_REPORT
  • SHOPPING_PERFORMANCE_REPORT
You can refer to https://developers.google.com/adwords/api/docs/appendix/reports for the list of supported columns and other details for these new reports.

If you use API versioning in your reports, then you need to modify your code to use v201402 as shown below. If you don’t use API versioning, no code changes are required.


var report = AdWordsApp.report(query, {
apiVersion: 'v201402'
});
If you have any questions about this feature or AdWords Scripts in general, you can post them on our developer forum.

AdWords API users – don’t wait to migrate from ClientLogin to OAuth 2.0!

ClientLogin authentication support for the AdWords API will sunset along with v201309 on July 21st, 2014. But it doesn’t mean you should wait till the last minute to migrate!

We have plenty of resources to help you migrate. It might take longer than expected to migrate to OAuth2, especially if you don't already use a single top-level MCC to manage your AdWords accounts.

Start your migration as soon as possible and reach out to us early on the AdWords API Forum with any questions.

New geo targeting options in AdWords API

Building on our AdWords announcement in November 2013, v201402 of the AdWords API supports geo targeting for areas with particular places of interest or income levels. These are useful for reaching customers based on the types of places they visit or demographic information based on their location. Please check the support site for more information, and to determine if these new targeting options are available for the country you would like to target. Within the API, these new criteria types are called LocationGroups and can be applied on a campaign to affect all of its ads.

The targeting can be set up using a matching function, which you may already be familiar with from other parts of the API. There are three new operand types for LocationGroups matching functions. Each matching function will pair one of either IncomeOperand or PlacesOfInterestOperand with a GeoTargetOperand, which is always required, to target income brackets or places of interest within a specific geographical region.

For example, to target airports in New York City using the Java client library, you would set up a matching function using a PlacesOfInterestOperand and a GeoTargetOperand, like this:

LocationGroups locationGroup = new LocationGroups();
Function matchingFunction = new Function();
matchingFunction.setLhsOperand(new FunctionArgumentOperand[] {
new PlacesOfInterestOperand(null, PlacesOfInterestOperandCategory.AIRPORT)
});
matchingFunction.setOperator(FunctionOperator.AND);
matchingFunction.setRhsOperand(new FunctionArgumentOperand[] {
new GeoTargetOperand(null, new long[]{ 1023191L }) // ID for NYC
});
locationGroup.setMatchingFunction(matchingFunction);
You can look up geo target IDs via the LocationCriterionService or in the documentation. You can also see fully functional, runnable code demonstrating this criterion type in each client library (Java, PHP, .NET, Python, Ruby, Perl).

If you have any questions about this or anything else related to the AdWords API, please contact us on the forum or via our Google+ page.