Posted:

Episode twelve of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and DoubleClick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

With their customizable presentations and ability to be precached, Native Express ads fit right in with list-based user interfaces:

In this deep dive episode of the Mobile Ads Garage, you'll learn how to integrate Native Express ads into an iOS app that uses a UITableViewController for its primary UI. Along the way you'll get a detailed set of step and see screencasts of an implementation in Xcode. The episode also covers a handy technique for tapping into the ad lifecycle to load native express ads sequentially, from the top of the list to the bottom.

If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We'd love to hear which AdMob features you'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Until next time, be sure to stay connected on all things AdMob by following our Twitter, LinkedIn and Google+ pages.

Posted:

Hello ads PHP developers! Today we're pleased to announce the stable release of the new ads PHP client library. This has been in beta for a while now, is a huge overhaul of the library, and offers the following improvements:

  • Uses namespaces and conforms to PSR-4 autoloading.
  • Conforms to PSR-3 for logging.
  • Supports installation via Composer.
  • Uses the Google PHP auth library for OAuth2, offering more features, flexibility, and service account support.
  • Uses Guzzle for non-SOAP HTTP calls, conforming to PSR-7.
  • Contains better object-oriented library design and stub interfaces, including builders to configure settings.
  • Contains upgraded and easier to use utilities for AdWords reporting, AdWords batch jobs, and DFP reporting.
  • Enables SSL by default for SOAP API calls and non-SOAP HTTP API calls.

This library has been pushed to the master branch on GitHub. The old library is now deprecated and moved to a deprecated branch with reduced support until it reaches end of life (EOL) on July 31, 2017. Reduced support details can be found in issue #193. To help you upgrade, we've written an upgrading guide.

As always, if you have any questions, feel free to drop us a line on the AdWords or DFP API forums, or the Ads Developer Google+ page.

Posted:

Today we're excited to announce iOS and Android sample projects that display AdMob Native Express ads in a feed. These samples address a common use case for monetizing apps with feeds or lists of content. The iOS (Swift and Objective-C) apps display Native Express ads in a UITableView and the Android app shows them in a RecyclerView.

Native Express ads work well in lists of content for two reasons. First, impressions are not counted until the ad is on screen, which enables you to preload the ads ahead of time. Preloading can help with optimizing scroll performance by making sure the ad is ready to be displayed when the user scrolls through the list. Second, you have more control over the styling of the ads, allowing you to create presentations that fit naturally with your content.

You can check out these sample apps by downloading them from our iOS and Android GitHub repos, and you can see them being coded in the Mobile Ads Garage YouTube series. Episode 11 walks you through the implementation for adding native ads into an Android RecyclerView. Episode 12, which will cover the implementation of native ads in an iOS UITableView, is due out next week.

If you have any questions or feedback regarding our SDK, feel free to contact us through our forum.

Posted:
Today we're announcing the release of video campaign management support in AdWords scripts. You can now create and manage in-stream, video discovery, and bumper ads in your existing video campaigns, set targeting for your video campaigns and ad groups, and report on performance including views and view rate.

To get started, visit our Video Campaigns guide for an overview of the new functionality. You can also view a variety of samples both in the docs and by using the Show examples button in the script editor. These are pre-built functions that may be useful to drop into your code or use as the basis for expansion into your own custom script.

When you're ready to dig in or when you're ready to learn more, check out the "Video" section of the left navigation bar under our AdWordsApp documentation.

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

Posted:

As you've probably heard, DCM will stop serving Flash display ads on January 2nd, 2017. This is part of a wider initiative to go 100% HTML5, which you can learn more about in the DCM help center.

What does this mean for DCM/DFA Reporting and Trafficking API users?

Beginning on January 2, 2017, the following changes will take effect:

  1. Flash uploads will be disabled in API v2.5. Beginning with v2.6, the DCM API stopped supporting uploads of Flash assets and prevented users from creating new Flash In-page creatives. These same restrictions will be applied to v2.5.
  2. Active Flash creatives with no HTML5 equivalent will be deactivated. Existing creatives that have not been converted to HTML5 will have their active field set to FALSE. Users will not be allowed to reactivate these creatives.

What can API users do to prepare?

Users are strongly encouraged to review their active creatives and take immediate action to replace those that will be affected by this change. We've created code samples in Java and Python to help API users identify creatives in their accounts that will be deactivated if no action is taken. See this article for links to tools to help you transition your creatives to HTML5.

Users of DCM API v2.5 are also encouraged to begin migrating to a newer API version immediately. Be aware that this version is already scheduled to sunset on February 28th, 2017.

Questions about this or anything else DCM API related? Contact us via our support forum.

Posted:
At the beginning of the year we announced an experimental bi-monthly release schedule for the AdWords API. Based on the results of this pilot and feedback from our developer community, we've decided on a quarterly release schedule for 2017. The 2017 API releases are scheduled for February, May, August and October.

We received positive feedback on increasing the release frequency from the previous three-times-a-year schedule. We also heard that the accompanying sunset schedule was an added burden for some API users. The quarterly release schedule aims to address this feedback. We will continue to monitor the release frequency and your feedback

On average, every AdWords API version released in 2017 will be available for approximately 10 months. One month after every major release, we will sunset the oldest outstanding API version. Similar to the 2016 schedule, we will support 3 releases concurrently at all times and 4 releases for a brief period of 4 weeks at a time to accommodate developers who want to skip two major releases.

As a reminder, v201605 is scheduled to sunset on February 28, 2017. We will post details about the release and sunset of other AdWords API versions on this blog and our developer site. If you have any questions, feel free to reach out to us on the AdWords API forum.

Posted:
Today we’re pleased to announce the v201611 release of the DFP API. This release contains the addition of MobileApplicationService, which allows you to claim apps from various app stores to use for targeting in your network. For a full list of API changes in v201611, see the release notes.

With each new release comes a new deprecation. If you're using v201602 or earlier, it's time to look into upgrading. Also remember that a double sunset happened at the end of November 2016 - both v201508 and v201511 have been sunset.

As always, if you have any questions, feel free to drop us a line on the DFP API forums or the Ads Developer Google+ page.

Posted:
What do I need to do?
Please migrate any existing Flash display ads to HTML5 by January 2, 2017, when Flash ads will stop serving. In May 2016 we announced that you would no longer be able to upload Flash display ads in AdWords by June 30, 2016 with tips on how to migrate.

If you have video ads built in Flash, they will not be affected at this time. You do not need to migrate these ads.

Where can I learn more?
Questions? Visit us on the AdWords API Forum or our Google+ page.

Posted:

Episode 11 of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

In a break with tradition, this video is a deep technical dive on one subject: Native Ads Express in an Android RecyclerView. You'll learn how to modify an existing RecyclerView implementation to include Native Express ads, all the way from updating the adapter to loading the ads. In addition, you'll get a clever trick that makes sure your ads are always sized to match the UI, so they fit right in with your content.

If you haven't used Native Ads Express before, you can see them in action in Episode 7. Andrew and Gary cover all the basics: loading ads, placing them in layouts and storyboards, and using CSS to style the ads to match your app.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We'd love to hear which AdMob features you'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Until next time, be sure to stay connected on all things AdMob by following our Twitter, LinkedIn and Google+ pages.

Posted:
In August, we announced that returned Productstatuses would include any validation issues. Unfortunately, the way validation issues used the severity field differed from data quality issues, which led to confusion.

To clarify which validation issues are serious and which are just warnings, we will use the same mapping for validation issues as we do for data quality issues. In addition, we have published an accompanying guide, API Issue Severity and Diagnostics Issue Prioritization, which discusses how to compare the issue prioritization used in the Diagnostics section of the Merchant Center to the issue severity provided in the responses from the Productstatuses and Accountstatuses services.

As always, if you have any questions about these changes or any other questions or feedback about the Content API for Shopping, please let us know on the forum!

Posted:
Since we introduced expanded text ads (ETA) earlier this year, we’ve recommended that advertisers create and test multiple ETAs to determine what messages perform best for their business. To help you do this at scale, we’ve created the ETA Transition Helper, a powerful tool that allows you to easily create ETAs in bulk using AdWords Scripts and Google Sheets.

This tool helps you save time by using your existing standard text ads (STAs) as a blueprint for your new ETAs. The ETA Transition Helper ensures your expanded text ads are formatted according to the new character limits and that their display URLs use the final URL's domain. After creating the new ETA, the tool displays your current STA and the new ETA side-by-side in a Google Sheet so you can easily compare the two ads. Please note that the tool's interface is only offered in English at this time, but it supports exporting STAs and creating ETAs in all languages.

As a reminder, starting January 31st, 2017, you will no longer be able to create or edit STAs, though existing STAs will continue to serve alongside ETAs.

Get started by checking out the user guide. You can also contribute to the ETA Transition Helper project on GitHub today. If you have any questions or would like to provide feedback, feel free to contact us on the AdWords Scripts Forum.

Posted:

On February 1, 2017, we will implement a new deprecation policy for the IMA SDKs for iOS and Android. The Flash and HTML5 SDKs are unaffected by this policy because they are downloaded at runtime, so all developers are always using the latest version.

Each release will be deprecated 12 months after its successor is released.

As of February 1, 2017, the following SDK versions will no longer be supported:

  • IMA Android prior to version 3.1.3
  • IMA iOS prior to version 3.1.0

If you are currently on one of these versions, we strongly suggest upgrading to the latest version before the new policy takes effect.

Once an SDK version is deprecated, we cannot guarantee that version will continue to work. If we receive reports of crashes related to a deprecated version of the IMA SDK, we may discontinue serving ads to that version. We will also no longer field support requests for these versions on the IMA SDK support forum.

To maintain support, publishers on the latest version of an SDK will have 12 months to move to a new version once its successor is released. To "support" an SDK means we will investigate bugs in that SDK version and work on fixes. If a bug fix requires a change to the library itself, the fix will be applied to the newest version.

For a list of supported SDK versions and their deprecation dates, see the new deprecation schedule pages for iOS and Android. As always, if you have any questions, feel free to contact us via the support forum.

Posted:
Update December 9, 2016: The previous version of this announcement indicated that this would be rolled out within the next month. This is now going to be rolled out over the next few months. If you would like to check to see if your account has this feature enabled, try editing one of your ads and adding a {. A drop-down should appear. If the option IF function is available, then the feature has been enabled for the account.
Over the next month, AdWords is rolling out to all accounts two new ways to customize your ads.
  • Default values in Ad Customizers give you an option of providing a default value when referencing a custom value from a feed. This means that you will no longer be required to provide a static ad in your ad group when using ad customizers. Woohoo!
  • IF functions let you insert a customized message in your ad based on who’s searching and what device they’re searching on, all without using a feed.
Default values in Ad Customizers
  • What’s changing? The existing syntax for inserting a custom value from a feed is {=FeedName.AttributeName}. The new syntax allows for an optional default value {=FeedName.AttributeName:default value}, but you can still use the existing syntax if you don’t want to specify a default value. Check out the Customizing text ads guide to learn more about setting up an ad with ad customizers.
  • How does this affect me? If you have colons in your Feed.name or in your FeedAttribute.name, then add a backslash before the colon to escape the colon. Having a colon without a backslash causes anything after it to be interpreted as a default value when used in an ad customizer. If you no longer want to have a static ad in your ad group, then start adding default values to your ad customizers and delete the static ad.
IF functions
  • What’s changing? The new IF function allows text to be specified in a text ad based on device or audience, with the default text being optional. If default text is not specified, then a static ad is required in the ad group. The syntax is:
    • {=IF(device=mobile,text to insert):optional default text}
    • {=IF(audience IN(<userlist1>,<userlist2>),text to insert):optional default text}
  • How does this affect me? If you want to add customized text to your ad based on device or audience, start adding the IF functions to your text ads. For examples, check out the Customizing text ads guide.
Questions? Visit us on the AdWords API Forum or our Google+ page.

Posted:

Integrating with the IMA SDK for Android has historically meant implementing the VideoAdPlayer interface and playing video ads in your content player. While this approach offers maximum flexibility, it also requires a lot of extra work to get up and running. In our mission to make developers' lives easier, we are proud to offer an alternative: SDK-owned ad playback, added in our newest release, v3.5.2.

Using SDK-owned ad playback, the SDK takes care of playing ads in its own player, allowing you to focus on content playback and the normal ad request flow in your player. With SDK-owned playback, you no longer have to implement a VideoAdPlayer, or worry about VideoAdPlayerCallbacks. Enabling SDK-owned playback is straightforward: simply omit the setAdPlayer call on your AdDisplayContainer.

With the new, simplified integration flow using SDK-owned playback, integrating with the IMA SDK for Android is easier than ever! For a step-by-step guide, head over to our revamped Get Started guide or download the BasicExample project from GitHub and try it out.

SDK-owned ad playback allows publishers to simplify their IMA implementation, but using it is not required. If you already have a VideoAdPlayer implementation or want to use a single video player for both ads and content, you can keep using custom playback. SDK-owned playback merely gives you the option to let the SDK handle some of the implementation complexity for you.

If you have any questions about SDK-owned playback, feel free to contact us via the support forum.

Posted:
Earlier this year, we added support for managing price extensions to the AdWords API. This included the addition of PriceFeedItem to extension setting services in v201607, and placeholder type ID 35 to feed services in all versions of the AdWords API. At that time, both supported only English price extension type, price qualifiers and price units.

Starting today, we are rolling out support for additional languages in price extension types, price qualifiers and price units. Price extensions’ headers and descriptions will be reviewed in the context of the specified language, and those written in languages other than the specified one will be disapproved.

How to use this feature Note: All PriceTableRow entries must have the same currencyCode or you will get the ExtensionSettingError.INCONSISTENT_CURRENCY_CODES error.

If you have any questions, please post on the forum or the Ads Developers Plus Page.

Posted:
In July we announced that starting in August 2016, all versions of the DFP API would return HTTP 401 errors instead of SOAP AUTHENTICATION_FAILED errors. We have learned that some developers have been relying on catching an AUTHENTICATION_FAILED error to know when to refresh an access token. This is not the recommended way to determine when your access token needs refreshing and is not supported.

The change described above will break code that relies on catching an AUTHENTICATION_FAILED error. We have temporarily rolled back the change to give developers who haven’t migrated more time to update their code and will roll this change out again on November 30, 2016 and ask that you update your code before then.

Note: If you’re taking advantage of our client libraries, no change is required; our client libraries handle refreshing an access token with our recommended approach.

Instead of relying on an AUTHENTICATION_FAILED error, the recommended way is to calculate how soon the access token is going to expire before making an API call, and refresh it if it’s about to expire soon.

  • Whenever you obtain a new access token, calculate the token’s expiration time by adding the expires_in time returned with the access token to the current time.
    • For example, if you received an access token on Oct 21, 16:05 EDT and the access token lasts for 3600 seconds, the token would expire on Oct 21, 17:05 EDT.
  • Then, before every DFP API call, check when the access token will expire before using it: if it is going to expire within a certain time window (say, in the next 60 seconds), you should refresh it before making the API call.
    • To calculate this, subtract the current time from the token’s expiration time that you calculated above.
You can see an example of how this is done in our Java client library and use it as a reference to help you implement the above.

As always, if you have any questions, feel free to drop us a line on the DFP API forums or the Ads Developer Google+ page.

Posted:
Historically, ad groups in Display campaigns have not served until you added at least one positive ad group targeting criterion, such as Placement or CriterionUserList. This behavior worked well if your goal was to target specific criteria on Display, but not if your goal was to target as broad an audience as possible.

What's changing
Starting January 11, 2017, a Display ad group will be eligible to serve ads as soon as its status is set to ENABLED and it has a bid, a budget, and an approved ad. If the ad group does not have any ad group level positive targeting criteria, then the ad group will target the entire Display network, subject to exclusions and campaign-level targeting settings (such as geo, language, etc.), with the potential to quickly exhaust your campaign budget.

This change only impacts campaigns with AdvertisingChannelType of DISPLAY or VIDEO.

Before this feature is enabled on your account, any existing Display ad groups without ad group level positive targeting criteria will be set to PAUSED.

What you should do
For existing Display campaigns and ad groups:
  • If you want to target the entire Display network (subject to exclusions and campaign-level targeting settings), then after the feature is enabled, make sure you set those ad groups to ENABLED, since they will be in the PAUSED state.
  • Otherwise, add the desired positive targeting criteria to each ad group, and then set it to ENABLED.
For new Display campaigns and ad groups, review your application's ad group creation workflow to ensure that it does the following:
  • Sets the AdGroup status field to PAUSED when creating a new ad group via AdGroupService.mutate and an ADD operation.
  • Only sets the AdGroup status to ENABLED after adding targeting criteria (if desired). You can update the status of your AdGroup via AdGroupService.mutate and a SET operation.
In addition, if your application adds and removes targeting criteria from existing Display ad groups, make sure that it will also properly update the the ad group's status to PAUSED or ENABLED if the intended side-effect of criterion addition or removal is to pause or start serving. This is particularly important when removing the only positive criterion for an ad group, since this will change its reach from very narrow to very broad.

If you have any questions, please post on the forum or the Ads Developers Plus Page.

Posted:
Today we're releasing v2.7 of the DCM/DFA Reporting and Trafficking API. This release introduces a number of video trafficking workflow enhancements, including:

Details of these and other improvements are covered in our release notes.

Deprecation and sunset reminder

In accordance with our deprecation schedule, this release marks the beginning of the deprecation period for v2.6, which will sunset on May 31st, 2017. After this date, any requests made against v2.6 will begin returning errors.

As a final reminder, API v2.4 will be sunset on November 30th, 2016. To avoid an interruption in service, all users are required to migrate off of this version by the sunset date.

Learn More

As with every new version of the DCM/DFA Reporting and Trafficking API, we encourage you to carefully review all changes in the release notes. For those of you looking to get going right away, updated client libraries are now available. If you're just starting out, the Get Started guide is a great reference to help you get up and running quickly.

Give it a try and let us know if you have any questions!

Posted:
In an earlier blog post, we announced that you have until January 31, 2017 to upgrade from standard text ads to expanded text ads. You will no longer be able to create new standard text ads starting on January 31st even though those ads will continue to serve.

Many of you have already taken advantage of the new ad format, but there are some developers who are still creating new standard text ads. If you need help upgrading to expanded text ads or if you have any questions, please add to this forum post or start a new forum post. Let us help you get these ads upgraded!

Posted:

Episode 10 of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, the Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and DoubleClick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

Knowing what's going on with your ads is a big part of maintaining a great user experience. In the latest episode of the Mobile Ads Garage, you'll see how to tap into the ad lifecycle so your app's informed of loads, clickthroughs, and other key events. You'll also get a detailed breakdown of the steps that occur in the life of an ad, info about which classes and callbacks to use for common tasks like pausing game engines and muting audio, and a real world example of how to put it all together.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We'd love to hear which AdMob features you'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Until next time, be sure to stay connected on all things AdMob by following our Twitter, LinkedIn and Google+ pages.

Posted:
We have added support for AdWords API v201609 reports in AdWords Scripts. The major changes in this release are: See the AdWords API release notes for more details.

The v201607 will remain the default version for reports until the week of November 28, 2016. This gives you enough time to verify your scripts and make sure they work with the latest report version.

If you use API versioning in your reports, you need to modify your code to use v201609:
var report = AdWordsApp.report(query {
  apiVersion: 'v201609'
});
If you don't use API versioning, no code changes are required. Your reports will continue using v201607 for now, and switch to v201609 when we make v201609 the default version the week of November 28, 2016.

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

Posted:
We are marking the ClickType column in AdWords API and Scripts reports as incompatible with the following engagement and video-related fields in version v201607 and earlier:
  • AverageCpe
  • EngagementRate
  • VideoQuartile25Rate
  • VideoQuartile50Rate
  • VideoQuartile75Rate
  • VideoQuartile100Rate
  • VideoViews
  • VideoViewRate
  • AverageCpv
These fields refer to engagement and video view interactions, and aren’t compatible with the ClickType column, a click interaction metric. This restriction is already enforced in v201609 reports, see our migration guide for more details.

Starting Dec 1, 2016, you will get a ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT error if ClickType column is requested with any of these fields.

Questions? Visit us on the AdWords API Forum or our Google+ page.

Posted:
What's changing?
As of today, the getServiceLinks() and mutateServiceLinks() methods on CustomerService are available to all AdWords API users. Previously, these methods were only available to whitelisted users.

Using this functionality and the Content API for Shopping, you can now fully automate the process of linking Merchant Center accounts to your AdWords account. Previously, you could send a link invitation using the Content API for Shopping, but you could not accept or reject the invitation using the AdWords API.

What do the new features do?
I thought you'd never ask! :)
  • getServiceLinks() retrieves the status of links between your AdWords account and Merchant Center accounts.
  • mutateServiceLinks() accepts or rejects links between your AdWords account and Merchant Center accounts.
What should you do?
If you're interested in automating the linking process between Merchant Center and AdWords, check out the updated shopping campaigns guide.

If you have any questions or need help, please post on the forum or the Ads Developers Plus Page.

Posted:

AdWords scripts now fully support responsive ads, image ads, HTML5 ads and multiple Gmail ad formats. See our guide on ad types and related code snippets to learn more about using these ad formats in Scripts.

This update also introduces a media service which can be used to upload and query media for use in ads. See our ad media guide for a more detailed overview of media support.

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

Posted:

We are making two changes related to how various conversion-related stats are retrieved in AdWords Scripts.

New methods for Conversion stats

We are reintroducing two methods in the AdWordsApp.​Stats and MccApp.​ManagedAccountStats classes to work with Conversions.

Note: Since Conversions is a stat of type Double, the equality operators (= and !=) won’t work with these new methods when using the withCondition filters or comparing values in code. Instead, you need to use comparison operators like < and > or round Conversions off to an Integer.

Sunsetting ConvertedClicks

As part of sunsetting Converted clicks in AdWords, we are deprecating the getConvertedClicks() and getClickConversionRate() methods in the AdWordsApp.​Stats and MccApp.​ManagedAccountStats classes. These methods will be sunset on February 21, 2017.

If your scripts use these methods, update them to use the new Conversion stats methods if applicable before February 21, 2017 to ensure they continue to work.

If you have any questions about these changes please reply to this email or post them on our developer forum and we'll be glad to help you.

Posted:
Authentication with the DFP API is probably something you had to set up once and then never thought about again. Well, that may be true until there's a scope change, or your credentials suddenly stop working, or the developer who created the credentials leaves to open their own yoga studio in the Andes.

Understanding some of the finer details of DFP's OAuth2 flows can come in handy when the unexpected happens.

Access tokens

When using the DFP API, you can authenticate on behalf of a user in your network or as an application. For the DFP API we call these two choices Web Application flow and Service account flow (server-to-server), respectively. Each choice has a different set-up, but both are used to generate access tokens.

All DFP API requests are authenticated using access tokens. You can think of these as short-lived (about one hour) passwords. When making a request, you include the access token in the HTTP header:

  Authorization: Bearer ACCESS_TOKEN

Every access token is tied to a specific user and one or more API scopes. The scopes control which Google APIs the access token is valid for. The scope for DFP is:

  https://www.googleapis.com/auth/dfp

Access Control

Because every access token is associated with a user, the DFP API enforces the same exact access controls as the DFP UI. This means that all the teams, roles, and permissions that restrict the user are in effect.

When authenticating as a dedicated API user like a service account, make sure that user is configured with your desired teams and role in DFP. There's no requirement that API users have administrator access.

Troubleshooting

If you ever need to verify the scope or who the access token was issued to, you can easily do so using the OAuth2 API explorer. Enter the access token you're using, and the API will provide a JSON response with the details:
  POST https://www.googleapis.com/oauth2/v2/tokeninfo?access_token=MY_ACCESS_TOKEN
  {
    "issued_to": "1234567890-aabbccddgh123.apps.googleusercontent.com",
    "audience": "1234567890-aabbccddgh123.apps.googleusercontent.com",
    "scope": "https://www.googleapis.com/auth/dfp",
    "expires_in": 3496,
    "access_type": "offline"
  }

Refresh Tokens

Although we now recommend using service accounts for server-to-server flow, many integrations still use an installed application flow. This flow uses a refresh token to generate access tokens.

If your refresh token stops working, there are a few possible causes:

  • The user you're authenticating as no longer has access to the DFP network.
  • Too many refresh tokens were generated for the OAuth2 client.
  • The user you're authenticating as has revoked access for your application.

The simplest solution to all of these is to create a new client and generate a new refresh token for a current DFP user. Remember that the refresh token is tied to the account that authorizes the application, and not the user who created the OAuth2 client. When accepting the OAuth2 authorization prompt, verify that the user in the top right corner that is logged in is correct:

If OAuth2 still gives you a headache, we're happy to troubleshoot with you. Just reach out to us on our developer forum.

Posted:
In accordance with our deprecation schedule, we will be sunsetting v2.4 of the DCM/DFA Reporting and Trafficking API on November 30th, 2016. On this date, all requests made against v2.4 of the API will begin returning HTTP 403 errors.

If you're still working with this version, we strongly encourage you to begin migrating to the most recent release to avoid an interruption in service. If you're not sure, or would like to know more about the migration process, refer to the migration guide.

As always, feel free to reach out to us with any questions that you have. To receive future updates like this directly in your inbox, join the DCM API Announcements group and adjust your notification settings.

Posted:

Following its launch at the 2016 Game Developer’s Conference, AdMob’s mediation support for rewarded video ads has been a hit with publishers and users alike, with rapid adoption on both Android and iOS platforms.

Our growing list of mediation partners includes eight different ad networks. Choosing AdMob for your rewarded video mediation platform gives you access to ad content from all of them, while you develop against a single API from AdMob. Now, with the launch of custom events for rewarded video, you can also request and display rewarded videos from ad networks that are not directly supported by AdMob.

Our implementation guide for rewarded video adapters (Android | iOS) outlines how to implement an adapter that can serve rewarded video ads from a third party ad network. Special attention should be paid to steps specific to custom events that are summarized below:

Adding a custom event to your ad unit

To define a custom event, you must first create it in the AdMob interface at apps.admob.com. You can find instructions for creating a custom event in this help center guide.

Retrieving server parameters

The optional server parameter passed to your custom event is accessed via a special key. Here’s an example showing how to access the value in a rewarded video adapter:

Android

String parameter = serverParameters.getString(
    MediationRewardedVideoAdAdapter.CUSTOM_EVENT_SERVER_PARAMETER_FIELD);

iOS

NSString *parameter = [self.connector.credentials
    objectForKey:GADCustomEventParametersServer];

You can find additional documentation on rewarded video ads in our Get Started guides (Android | iOS), and more information about mediation is available in our mediation guides (Android | iOS). For any other questions about rewarded video mediation, you can reach us through our developer forum.

Posted:
On Wednesday, November 30, 2016, in accordance with the deprecation schedule, v201508 and v201511 of the DFP API will be sunset. At that time, any requests made to these versions will return errors.

If you're still using these versions, now's the time to upgrade to the latest release and take advantage of new features like HTML5 creatives, programmatic support, and retrieving saved report queries. To do so, check the release notes to identify any breaking changes, grab the latest version of your client library, and update your code.

Significant changes include:

This is not an exhaustive list, so as always, don't hesitate to reach out to us with any questions. To be notified of future deprecations and sunsets, join the DFP API Sunset Announcements group and adjust your notification settings.

Posted:
Our Samples and Libraries page has been updated with additional languages: Ruby and Go. For Ruby, the new samples are written in plain Ruby, which should make them easy to integrate into whatever Ruby framework you may be using for your particular project. If you haven't had a chance to try your hand at Go yet, the new Go examples provide the perfect excuse.

If you have questions about the samples or any feedback on how they might be improved or expanded, please feel free to file an issue on GitHub! If you have any other questions or feedback concerning the Content API for Shopping in general, please let us know on the forum.

Posted:
Positive user list criteria for remarketing will be rolling out over the next few months and supported at the campaign level. After this is enabled for your account, you will be able to use Bid Only and Target and Bid targeting settings, along with bid modifiers for these criteria, at the campaign level. While targeting settings for campaigns requires v201609 of the API, adding user list criteria and setting bid modifiers will work with all versions of the AdWords API.

You cannot set user lists at both the ad group and campaign levels at the same time. When switching a campaign from ad group-level user lists to campaign-level lists, you must first remove existing positive user list criteria from all ad groups or there will be a CANNOT_ATTACH_CRITERIA_AT_CAMPAIGN_AND_ADGROUP error upon attaching a user list to the campaign. The process for removing existing user list criteria, adding them at the campaign level, changing targeting settings, and using bid modifiers is similar to that for ad groups and is detailed in the Remarketing guide. Please note that existing code working with campaign criteria may need to be modified to handle the presence of user lists.

If you have any questions about this change, or other questions about the AdWords API, contact us via the forum.

Posted:

Episode nine of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and DoubleClick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

In this episode of The Mobile Ads Garage, we discuss mediation, which is a way for publishers to get multiple networks of advertisers competing to display ads in their apps. We’ll show you how AdMob mediation works and what it can do for your business. Learn the pros and cons of mediation, see the details of implementation, and find out whether it’s right for your app. You'll also get screencasts for Android and iOS showing the integration of a third-party SDK, plus links to samples, written resources, and Gary the Graphics Guy acting like his usual, snarky self.

If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:
On September 12th, AdWords announced that you can now use one Google login to access multiple AdWords accounts. With this change, you can associate up to 5 AdWords accounts with a single Google account.

To take advantage of this new feature, the AdWords API has changed the behavior of CustomerService.getCustomers() starting with v201603. In the past, the Google account you used to obtain your OAuth2 credentials could only be associated with one AdWords account, which resulted in getCustomers() only returning one AdWords account. Now that a Google account can be associated with multiple AdWords accounts, getCustomers() can return multiple AdWords accounts. If you only want to retrieve the details of a specific customer using CustomerService, you can set the clientCustomerId in the request header starting with v201607.

Questions? Visit us on the AdWords API Forum or our Google+ page.

Posted:
We have added support for AdWords API v201607 reports in AdWords scripts. The major changes in this release are: See the AdWords API release notes for more details.

v201605 will remain the default version for reports until the week of October 10th, 2016. This gives you enough time to verify your scripts and make sure it works with the latest report version.

If you use API versioning in your reports, you need to modify your code to use v201607:
var report = AdWordsApp.report(query, {
   apiVersion: 'v201607'
});
If you don’t use API versioning, no code changes are required. Your reports will continue using v201605 for now, and switch to v201607 when we make v201607 the default version the week of October 10th, 2016.

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

Posted:

Have you ever asked yourself, Can I use the IMA SDK and Google Cast together to display videos with ads on a cast-enabled device? The answer is, yes you can!

We’ve put together a new section of guides and examples that show you how to add cast support to your IMA SDK implementation. They also explain the logic behind requesting ads on the sender and receiver devices. We’ve included both Android and iOS example sender apps, and an example HTML5 receiver.

We recommend familiarizing yourself with the Google Cast SDK as well as the IMA SDKs for Android, iOS and HTML5 before diving into these examples.

If you have any questions about these examples, feel free to contact us via the support forum.

Posted:
The Content API for Shopping documentation now includes a guide for using OAuth 2.0 service accounts with Content API for Shopping. This guide will be of particular interest to in-house developers, whose applications do not need access to third-party information. In such cases, requiring the application to get user approval and to keep track of refresh tokens may be unnecessary overhead. Instead, service accounts provide a private key that the application can use to authenticate when using the Content API.

For developers that work with third-party information, you should still use the OAuth2 three-legged authentication flow as described in the Authorize Requests guide to request permission from users for access to their information.

If you have questions about which flow is more appropriate for your project, or any other questions or feedback concerning the Content API for Shopping, please let us know on the forum.

Posted:
AdWords API v201603 will be sunset on October 31, 2016, after which all v201603 API requests will begin to fail. This version was deprecated on July 28, 2016. If you are still on v201603, we recommend that you skip v201605 and v201607 and migrate directly to v201609. Please be sure to migrate prior to the sunset to ensure your API access is unaffected.

We've prepared various resources to help you with the migration: As always, if you have any questions about this migration, please contact us via the forum.