The official blog for information about the Google Ads, Google Ad Manager, Google Mobile Ads SDKs for AdMob and IMA SDKs, and other Google Advertising Platform developer tools.
All of our DFP API client libraries have been updated to reference this URL starting with the v201408 release. If you are using a supported version of the client libraries, then no changes will be required. Otherwise, please update your code to make requests against this new URL.
Line Item goals, Sales Manager refactorings, and more PQL support
In v201408, we have added the field of Goal.goalType to the LineItem.Goal; this replaces what was formerly lineItem.duration and adds back support to create / update the line item types impacted in v201405 (listed here).
We've also done some significant refactoring of our Sales Manager API services adding premiums to rateCard objects. Prior to this version, there was a RateCardCustomizationService as well as a RateCardCustomizationGroupService; both were required to add a feature premium to an existing rateCard. This has now been replaced with a singular service named PremiumRateService.
In addition, we've also heard you loud and clear that PQL tables make development easier - in v201408, we provide support for the Audience_Segment_Category table.
New OAuth 2.0 Scope
With the release of v201408 of the DFP API, we will be introducing a new OAuth 2.0 scope. This scope identifies the service that your application will access during the authorization process.
This new scope better aligns with the naming conventions of many of the other Google APIs.
Starting from today, you should use the new scope when authorizing access for the DFP API regardless of the DFP API version. All our current DFP API client libraries use this new scope.
But I have refresh tokens from the deprecated scope...
Don't worry if your client code is using refresh tokens authorized with the deprecated scope - they will still work. However, new authorizations should specify the new scope.
Alternatively, if you’re an npm user, you can install our plugin and the above dependencies with
npm install videojs-ima
2. Declare your video player
Make sure your html file references the required JavaScript and CSS files downloaded in step one (see the example in the README for more complete HTML). Add the following code to load the IMA SDK and declare a video player:
YOUR_VIDEO_TYPE is the encoding for your video. For more information on supported HTML5 video types, see this Wikipedia article.
3. Initialize the video player and IMA plugin
In a JavaScript block or separate JavaScript file, include the following code:
// Initialize the video.js player.
var player = videojs('content_video'); // your video tag’s id
// Declare options for the IMA plugin.
var options = {
id: 'content_video',
adTagUrl: 'YOUR_AD_TAG'
// Additional options available but not required.
// See our README for more info.
};
// Initialize the IMA plugin.
player.ima(options);
// Request ads.
player.ima.requestAds();
// Start video playback (will play ads if there is a pre-roll,
// content otherwise).
player.play();
With these few lines of code, you’ve got a complete video player with an IMA integration. For more information and additional documentation, see our GitHub repo README.
The SDK's usage of the custom click tracking element is also changing. Currently, if a custom click tracking element is passed in to the SDK, it will always be wired to handle clicks. Soon, the custom click tracking element will only be used if the ad is a non-AdSense/AdX creative and the environment is iPhone or pre-4.0 Android. Please do not render your custom click tracking element over your video player as it may prevent clickthroughs after this change is put into place because it may intercept clicks on the SDK-rendered elements. We only recommend passing in a custom click tracking element if you are showing non-AdSense/AdX creatives and want a click tracking element in iPhone and pre-4.0 Android devices. See opt_clickTrackingElement under ima.AdDisplayContainer for more information.
What do you need to do now?
Effective immediately, all implementation should pass in the custom playback element to ensure support of IMA video ads across all devices. Please read our guide on Upgrading to the new custom playback.
If you are using a custom click tracking element:
Make sure it doesn't render over your video player.
Specifically to the API, this means the following:
The next API version will no longer accept KeywordMatchSetting for campaigns.
Existing API versions will ignore the value sent for the optIn field of KeywordMatchSetting.
Regardless of the optIn field value, all exact and phrase match keywords will match close variants.
Close variant matching is already enabled by default for new campaigns, so if you haven't specifically set the optIn field, you won't see any changes in keyword matching behavior.