Category Archives: Google Ads Developer Blog

The blog for information about the AdWords, AdSense, DoubleClick and AdMob APIs and SDKs.

Help us help you with your DFP API questions

If you’re a DFP developer using our API, no doubt you’ve had a question or two at some point during your integration with DFP. You’ve probably visited the DFP API forums, if not posted to them. Today we just wanted to remind you of a few simple things you can do to help us answer your API questions more efficiently.

Let us know who you are

Including the following information with every question you ask helps reduce the turnaround time for your question:

Send us SOAP logs

SOAP logs contain the raw XML that describes the requests and responses of the API calls you make. These logs can help narrow down issues much faster. If you’re using one of our client libraries, you can visit its GitHub page to learn how to enable logging. For example, Java’s is here.

Here are some additional tips around SOAP logging.

  • When sending us logs, try to send the minimal amount of SOAP logs that clearly show the error or issue that’s occurring. If you send your entire SOAP log for the day, it’ll take longer for us to go through and increase your turnaround time.
  • If you’re seeing errors in your production environment and don’t have full SOAP logging enabled due to space constraints, consider logging only request IDs from the SOAP response instead. Not all errors will necessarily have a request ID, but if they do, that ID can help us look up your error.
  • If you’re not comfortable posting SOAP logs on the forums, you can either (1) paste a snippet of your code instead, or (2) reply directly to us by using reply privately to author.

Distinguish a product issue from an API specific issue

Generally, if an error or issue occurs in both the DFP web UI and API, it is most likely a product-level issue and non-specific to the API. To help determine this, you can try reproducing what you’re doing via the API in the web UI to see if you get the same error or issue. Product-level issues are better handled by your account manager or by posting to the DFP product forums.

If you’re still unsure, you can always post your issue in the API forums and we will be glad to help you out.

Upcoming changes to Paid and Organic Query report

We are updating the Paid and Organic report to include only text ad statistics. Impressions and clicks for mobile app install ads and Product Listing Ads will be excluded from this report starting July 13, 2015.

These formats serve in places other than on search results, so we are excluding them to provide you a better comparison across paid and organic listings at the query level. If you use data from the Paid and Organic report in any of your AdWords API or Scripts applications, then make sure you update them to adjust for this data change. Historic stats for mobile app install ads and Product Listing Ads will continue to be available from this report type up to the following report dates:
  • Product Listing Ads - up to and including March 23, 2015
  • Mobile app install ads - up to and including July 13, 2015
If you have any further questions about this change, let us know via the API or scripts forum, or Google+ page.

Announcing Three New Reporting Dimensions for AdMob Publishers

Today we’re announcing the availability of three new reporting dimensions created specifically for AdMob publishers: APP_ID, APP_NAME, and APP_PLATFORM.

Here’s how they work:

  • APP_ID - This dimension matches the store ID of an application. It will be prefixed with “1:” for an App Store ID (iOS) and “2:” for a Google Play ID (Android). For example, “1:476954712” or “2:com.labpixies.lineup”.
  • APP_NAME - Matches the name of an application, like “Flood-It!” or “Line Up”.
  • APP_PLATFORM - This dimension can partition results by platform (e.g. “Android” or “iOS”).

These new dimensions are available now in the AdSense Management API. If you’re unfamiliar with it, the AdSense Management API is a web-based API that you can query to get information about your AdSense account. There are client libraries for a number of platforms, though any standard HTTP client can send requests to it and parse the responses. With a little code and these new dimensions, you can create custom reports about a single app, a family of them, or even your entire platform lineup!

For more information on building and customizing AdMob reports, check out the reporting section of the AdMob developer site. You can also use the API Explorer to test out queries that include these fields.

New features in AdWords scripts

We have made the following changes to AdWords scripts.

Support for passing arguments into parallel functions

You can now use a string argument to pass account-specific information into a parallel function when using the MccApp.executeInParallel() method. The code snippet below shows how to use this feature:

function main() {
// Select the accounts you want to process.
var accountSelector = MccApp.accounts().withIds([1234567890, 3456787890]);

// Construct a config object that contains account-specific information.
var accountFlags = {
'1234567890': {
'label': 'Brand 1 campaigns',
},
'3456787890': {
'label': 'Brand 2 campaigns',
}
};

// Convert the config object into a string.
var optionalInput = JSON.stringify(accountFlags);

// Process accounts in parallel.
accountSelector.executeInParallel("processClientAccount",
"afterProcessAllClientAccounts", optionalInput);
}

function processClientAccount(args) {
// Convert the account flags from string to config object.
var accountFlags = JSON.parse(args);
var accountConfig =
accountFlags[AdwordsApp.currentAccount().getCustomerId()];

// Process your client account here.
var label = accountConfig['label'];
...
}

function afterProcessAllClientAccounts(results) {
...
}
Learn more about working on accounts in parallel.

Support for clearing ad group bid modifiers

You can now use the clearMobileBidModifier() method of AdGroup to clear bid modifiers at the ad group level and default to the campaign-level bid modifier.

Support for Upgraded URLs in app extensions

We have added support for Upgraded URLs in app extensions. The setLinkUrl() method in MobileApp, AccountMobileApp, CampaignMobileApp and AdGroupMobileApp classes and withLinkUrl() method of MobileAppBuilder class have been marked deprecated and will start throwing user errors on July 1, 2015. If you use any of these methods in your script, make sure you update them to use the setFinalUrl() / withFinalUrl() methods instead.

Deprecated CallOnly field in phone extensions

We have deprecated the call-only field in phone extensions. The following methods have been marked as deprecated and will start throwing user errors on June 14, 2015: If your ad extensions use the call-only feature, migrate your campaigns to call-only campaigns by following the instructions here.

Transition to viewable cost-per-thousand impression (CPM)

We’d like to remind you that later this year, all cost-per-thousand impression (CPM) bids will transition to a new type of bid called viewable CPM (vCPM), and CPM bidding will no longer be available. You can learn more about vCPM on our help center.

AdWords scripts already use the correct CPM version, based on campaign settings, so no code changes are required from your end for this transition. Our updated documentation now refers to CPM as the generic cost-per-thousand impression bidding instead of a specific flavor (e.g., maxCPM or vCPM).

If you have any questions about these changes or AdWords scripts in general, you can post them on our developer forum.

New Swift Samples for the IMA SDK

We’re excited to announce the addition of Swift samples to the IMA SDK! To view these samples check out our GitHub repo. Along with these new samples we’ve also added Swift snippets to our quick start guide.

As always, if you have any questions feel free to contact us via the support forum.

Announcing two new versions of the Google Mobile Ads SDK, plus the Native Ads beta!

Today we’re pleased to announce two new versions of the Google Mobile Ads SDK: version 7.5 for Android, and version 7.3.1 for iOS. Included is a brand new way to monetize your apps with the Google Mobile Ads SDK: native ads!

With native ads, publishers can display ad assets directly in native views, using layouts and storyboards they design to fit their user experience. You now have the power to monetize with ads that are seamless with content!

Native ads are currently in a beta with a limited group of publishers, but the code is included in the latest releases of the Mobile Ads SDK for iOS and Android. Those of you using Android Studio can download Google Repository (Rev. 19) via the Android SDK Manager to get the latest Gradle artifacts, and developers with Eclipse projects can find it listed as Google Play services (Rev. 25). Publishers with iOS apps can snag the latest SDK for that platform by updating their Podfile to pull version 7.3.1.

For AdMob, DFP, and AdX publishers, there are two system-defined native ad formats: App Install and Content. Each provides a set of image and string assets that make up the ad. App Install ads contain assets named “price,” “star rating,” and so on, while Content ads have “body,” “logo,” and others. See the AdMob and DFP help center articles for more information about the formats.

Publishers using DFP can also take advantage of custom native ad formats. With a custom format, you can create your own set of asset definitions, and then upload creatives with a matching set of values.

Native ads are loaded using the new AdLoader and GADAdLoader classes, which can request a single format or several at the same time, helping you maximize the value of your impressions. Here’s an example showing how to request an App Install ad on Android:


AdLoader adLoader = new AdLoader.Builder(this, DFP_AD_UNIT_ID)
.forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() {
@Override
public void onAppInstallAdLoaded(NativeAppInstallAd ad) {
/* display the ad */
}
}).build();
adLoader.loadAd(new AdRequest.Builder().build());

And here’s the iOS equivalent:


self.adLoader = [[GADAdLoader alloc]
initWithAdUnitID:DFP_AD_UNIT_ID
rootViewController:rootViewController
adTypes:@[ kGADAdLoaderAdTypeNativeAppInstall ]
options:nil];
self.adLoader.delegate = self;
[self.adLoader loadRequest:[GADRequest request]];

Check out the native ads guide (Android | iOS) for more information about native ads. For a full list of Mobile Ads SDK changes, check out our release notes. For technical questions, post them on our forum.

Announcing v201505 of the DFP API

Today we are releasing v201505 of the DFP API. This release brings changes to the ReportService and new features to the Sales Manager API, including advanced ProposalLineItem actions.

In v201505, the ReportService loses all MERGED_* metrics. These metrics, relics from DART migrations, are being deprecated. For more details, check out our earlier blog post. Additionally, the getReportJob method has been replaced by getReportJobStatus. The report utilities in our client libraries have been updated, but you should verify this in your code as well. Migration is straightforward, as shown in this Java example:


// v201502 code
ReportJobStatus status = reportService.getReportJob(reportJobId).getStatus();

// v201505 code
ReportJobStatus status = reportService.getReportJobStatus(reportJobId);

Sales Manager users get new ProposalLineItem actions, including ActualizeProposalLineItems and ReleaseProposalLineItems. You can also use BypassProposalWorkflowRules and include a comment when approving workflow requests.

For a full list of these and other changes, check the release notes.

As a reminder, with each new release comes a new deprecation. If you're using v201405 or earlier, it's time to look into upgrading. If you have any questions about upgrading, let us know on the developer forum.

Register now for the AdWords scripts workshops!

We’re pleased to announce the first ever workshops for AdWords scripts. The workshops will be held at the following locations:

        New York: June 29th, 2015
        San Francisco: July 10th, 2015

This round of workshops will cater to both beginners and advanced scripters. We'll have code labs where you will build your own scripts from scratch, with the help from the Scripts team. Bring your laptop and an idea to get it scripted!

Whether you’re an advertiser who wants to learn about how scripts can automate your account management tasks, a developer who wants to polish your scripting skills, or a scripts enthusiast who wants to meet fellow scripts experts, you can find it all in these workshops.

Visit our website to check out the full agenda and sign up.

If you have any questions about the workshops, you can post them on our forums. Check out our Google+ page for Ads APIs updates.

New features and guides in AdWords scripts

Shopping Content API
AdWords scripts now support Google Shopping Content API which gives Google Merchant Center users the ability to upload and manage their product listings and manage their Merchant Center accounts. The Shopping Content API can be enabled through the Advanced APIs dialog. See our guide and code snippets to learn more about this feature.

Account level extensions
AdWords scripts now support account-level extensions: AccountCallout, AccountMobileApp, and AccountReview. You can access these extensions using the extensions() method of the Account object. Appropriate creation and deletion methods are also available for these extensions on the Account object. See our guide for more details and usage examples.

Resolve geo names in reports
The AdWordsApp.report() method now supports an option named resolveGeoNames, which controls whether or not to convert Geo Criteria IDs (e.g., CountryCriteriaId or CityCriteriaId) into names ('United States', 'San Francisco', etc.). Set this option to true to get names, false to get numerical IDs. This option defaults to true.

Updated best practices guide
We have updated the best practices guide to cover a lot of common performance issues that your scripts may run into, and how to improve them.

New weather-based management script
The new weather-based management script improves upon the the popular bid-by-weather script by providing a framework where you can add your own campaign management logic.

If you have any questions about these features or AdWords scripts in general, you can post them on our developer forum.

Reminder: AdWords Destination URLs will become read-only on July 1, 2015

We would like to remind you that as previously announced, destination URL fields in AdWords will become read-only on July 1, 2015. Starting on that date, we will also begin upgrading your URLs (if eligible) to the new Upgraded URLs structure.

Once this change goes live, you will get the following errors from the AdWords API: In AdWords scripts, all methods that set the destination URL of various entities have been marked deprecated, and will generate a user error after July 1, 2015.

Before then, be sure to update your AdWords API and scripts code. Use the Upgraded URL fields instead of the destination URL field when creating entities such as ads, keywords, or sitelinks. You can refer to our migration guide to learn how to upgrade your URLs, or our feature guide to learn more about Upgraded URLs. All our client libraries fully support upgraded URLs, and provide code examples that show you how to use this feature and upgrade your URLs.

If you have any further questions about this change, let us know via our API or scripts forum, or Google+ page.