ACTIVE_VIEW_NOT*
Column.TOTAL_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS
// Retrieve your ad group.var adGroup = AdWordsApp.adGroups().get().next();// Create a keyword operation.var keywordOperation = adGroup.newKeywordBuilder(). .withCpc(1.2) .withText("shoes") .withDestinationUrl("http://www.example.com/shoes") .build();// Optional: examine the outcome. The call to isSuccessful()// will block until the operation completes.if (keywordOperation.isSuccessful()) { // Get the result. var keyword = keywordOperation.getResult();} else { // Handle the errors. var errors = keywordOperation.getErrors();}
addSitelink
addPhoneNumber
addMobileApp
Today we’re announcing the release of v6.5 of the Google Mobile Ads SDK! It’s listed as Google Play services 6.5 (Rev. 22) in the Android SDK manager, and is available for download right now. Those of you using Android Studio should download Google Repository (Rev. 14) to get the latest Gradle artifacts.
Under the hood improvements (greater stability, more efficient use of resources) make up most of the changes, but we’re pleased to note that this will be the first version of the SDK to support a split jar architecture. Previously, the SDK was compiled as a single, all-encompassing JAR file. Beginning with this release, however, it’s also built into separate JARs, each covering a specific domain of functionality. Interactive Media Ads (IMA) and Mobile Ads developers can now reference part of the Play Services SDK without needing to import the whole thing. This in turn reduces the APK size and memory footprint of your applications.
Taking advantage of the new architecture is easy -- you just need to change how you’re incorporating the SDK in your build process. Here’s an excerpt from a typical build.gradle file for an app that uses the SDK to display mobile ads:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:6.+'}
And here’s one that targets the ads library specifically, new in v6.5:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services-ads:6.+'}
That’s it! Gradle will now incorporate the new, smaller JAR into your application. If your app consumes other services from the SDK, simply add the relevant JARs (play-services-games or play-services-location, for example) to your build file as well.
IMA developers can make this change now. If you’re a Mobile Ads developer, one important thing to note is that the new split jar architecture currently works only with projects that configure banner ads in Java code, and not in XML. We plan to support XML configurations in the future, but for now if you’re defining and configuring your AdViews in an XML layout file, you should continue to reference Play Services in the existing manner.
You can read the Google Play Services Announcement on the Android Developers Blog for a summary of what’s new with this release. For a full list of Mobile Ads SDK changes, check out our release notes. For technical questions, post them on our forum.
- Andrew Brogdon, Mobile Ads Developer Relations
A lot of our DFP API developers have been asking recently about how to filter report data by custom targeting key ID. Currently the DFP API allows you to filter report data by custom targeting value ID only. Until we have official support for filtering by custom targeting key ID in reports, you can use the CustomTargetingService and the ReportService together to achieve this goal.
WHERE customTargetingKeyId IN (17, 18, 19)
If you have a lot of keys and values in your network, a better approach is to store these in a local database and do nightly syncs. Use getCustomTargetingKeysByStatement to obtain all the keys in your network, and then iterate through them, calling getCustomTargetingValuesByStatement for each key to obtain their values. Our client libraries all have examples of this. For instance, the Java example can be found in our ads Java client library GitHub repository. This way, you can look up the values associated with a custom targeting key more quickly and not do an additional API call.
IN
WHERE CUSTOM_TARGETING_VALUE_ID IN (3211, 88990, 123456)
However, please be aware that if you have a lot of custom targeting value IDs to filter on, you should batch them by querying for no more than 500 IDs at a time in the PQL IN clause. For example, you will run your report filtering on the first 500 IDs you’ve collected and save that report. Then you will run the same report on the next page of 500 IDs you’ve collected and so on until you have no more IDs. You can then combine the reports locally so that you have all the data for those custom targeting IDs.
If you have any questions about this, feel free to drop us a line on the DFP API forums or Ads Developer Google+ page.
- Vincent Tsao, DFP API Team
Last week we released beta 10 of the IMA SDK for iOS. This release comes with a few new features including the following:
The most important thing to know about this release is that you will now need to include the WebKit framework as an optional framework in your implementation and build for 64-bit support. If you are a Cocoapods user, this will be done for you in the generated xcworkspace when you upgrade to beta 10 via pod install.
install
kIMAAdEvent_TAPPED
- (void)adsManager:(IMAAdsManager *)adsManager didReceiveAdEvent:(IMAAdEvent *)event { if (event.type == kIMAAdEvent_TAPPED) { // Handle TAPPED event } }
This event will be fired any time a user taps on a non-clickable part of an ad (taps on the "Learn more" or "Skip" buttons will not result in a TAPPED event).
As always, if you have any questions feel free to contact us via the support forum.
- Shawn Busolits, IMA SDK Team
PretargetingConfig
Budget
billingId
budgetAmount
Today we are releasing v201411 of the DFP API. This release supports creating and updating VideoRedirectCreatives, enhances cross-sell via the new SharedAdUnitService, and adds an experimental Targeting field to the Line_Item PQL table. There are also new Sales Manager enhancements, including derived custom criteria on proposal line items and PQL filtering for Product.lastModifiedDateTime. A detailed list of these and other changes can be found on our release notes page.
videoRedirectAsset.setRedirectUrl("http://0.thirdpartyadserver.com/ad.mp4")
You will also need to set the VideoMetadata information for both externally hosted and YouTube hosted ads. For streaming videos, set the minimumBitRate and maximumBitRate; for progressive videos, use the static bitRate.
WHERE status = 'ACTIVE'
<Value.Type>TargetingValue</Value.Type> <value> <inventoryTargeting> <targetedAdUnits> <adUnitId>33985943</adUnitId> <includeDescendants>true</includeDescendants> </targetedAdUnits> </inventoryTargeting> </value>
If you've been waiting for a faster way to retrieve line item targeting, try it out and let us know what you think. Head over to the API forum and tell us what works for you, and how we can improve.
- Chris Seeley, DFP API Team
This is a reminder that starting from January 1, 2015, new releases of the ads PHP client library will only support PHP 5.3 or later versions. This will allow us to implement namespacing and autoloading, which aren’t available in PHP 5.2. Please see our original blog post announcement for more information. If you have any questions about this, feel free to drop us a line on the DFP API forums, AdWords API forums, or Ads Developer Google+ page.
adgroup_id
disapprovalReasons
var report = AdWordsApp.report(query, { apiVersion: 'v201409'});
As an avid reader of this blog, you have undoubtedly already seen the announcement that our dear old friend, the client library known as ‘AdsPyGoogle,’ will be sunset on January 5, 2015. Yes—we too at Google are very sad about this.
Fret not! In its place, we have a more than capable replacement in the form of our new GoogleAds Python client library which is more lightweight, has far fewer dependencies, boasts improved utilities and functionality, and perhaps most importantly, supports Python 2.7 as well as 3.x.
If you need a starting point on how to perform this switch, we have a blog post detailing the differences between the two, as well as a nifty migration guide on Github.
As usual, if you have any questions, feedback, or comments, please don’t hesitate to reach out on the DFP or AdWords forums.
- Nicholas Chen, DFP API Team
http://pubads.g.doubleclick.net/gampad/ads? sz=640x360& iu=/6062/iab_vast_samples/skippable& ciu_szs=300x250,728x90& impl=s& env=vp& gdfp_req=1& output=xml_vast2& unviewed_position_start=1& url=[referrer_url]& correlator=[timestamp]& scor=[timestamp]
The size of the video ad that you’re requesting.
Your “inventory unit” - the ad unit you created in Part I. This is in the format <network_code>/<ad_unit_code path>.
If your ad unit has associated companion ads, their sizes will be listed here.
The request mode. Here, “s” for “sync”.
The environment. Here, “vp” for “video player”.
Indicates that this is a DFP request rather than the legacy Google Ads Manager.
The type of output you want from your ad request. Typical values are “vast” or “vmap”.
Enables delayed impressions for your ad. This ensures that an impression isn’t counted until the ad starts playing.
The URL of the page requesting ads. This will also be automatically filled in by the SDK.
This randomly-generated value will be filled in by the SDK. It’s used for a number of things, but they all boil down to detecting ad requests that come from the same instance of a page load.
Like the correlator, but refreshed when your video stream changes rather than when the page refreshes. Used to detect ad requests that come from the same video stream instance.
adsRequest.adTagUrl = “YOUR_AD_TAG_HERE”;
Update: This integration is specifically for the Cocos2d-x branch developed by Chukong Technologies.
With more than $1 billion paid to app developers in the last two years, AdMob is committed to supporting industry growth. So we are happy to announce that Cocos2d-x developers can now easily monetize their games with AdMob!
AdMob has integrated with the AnySDK platform, which means Cocos2d-x developers who use the AnySDK Ads System can now easily include AdMob when publishing their Android and iOS apps. If you haven’t checked out Cocos2d-x before, you can learn more here.
Once you’ve configured your app for ads, the AnySDK package tool is where the magic happens. In the SDK Management section of your app configuration, specify AdMob as your ad provider.
In the Parameter Config section, configure your ad unit IDs for banners and/or interstitials, as well as the size and position for banner ads.
When you reach the Publishing section, simply Browse for your app and select Start.
That’s it! This step will generate the new version of your app with AdMob included!
For help integrating AnySDK into your apps, consult the contact link on AnySDK’s homepage.
We’d also love to get your feedback! Please let us know your experience integrating AdMob into your Cocos2d-x apps on our developer forum.
- Eric Leichtenschlag, Mobile Ads Developer Relations
Your DFP network is already serving thousands of image, text, and custom ads. But now you want to start monetizing your video content. This two-part blog post will get you started with video ads. We'll start with creating and trafficking your ad using the DFP API, and then show you how to display it using the IMA SDK.
If you're new to video ads, check out this help center article for a little more background. This post shows how to use a VAST redirect creative, so you'll need to host a VAST tag and your video ad before making the creative in DFP. If you just want an example VAST tag to get up and running, you can use the XML here.
Note that this example tag will only return VAST for the first request. Subsequent requests will need to update the correlator timestamp in the URL. The IMA SDK will handle this for you, so there's no problem using this as your example URL.
If your network doesn't have a video ad unit already, you'll need to create one. Set the fields as you would for any other ad unit, but use a size appropriate for video and the VIDEO_PLAYER environment type.
VIDEO_PLAYER
Size videoSize = new Size(); videoSize.setWidth(640); videoSize.setHeight(480); videoSize.setIsAspectRatio(false); AdUnitSize videoAdUnitSize = new AdUnitSize(); videoAdUnitSize.setSize(videoSize); videoAdUnitSize.setEnvironmentType(EnvironmentType.VIDEO_PLAYER);
Beginning in v201403, you can create and update VAST redirect creatives with the DFP API. If video features are enabled on your network, creating VAST redirect creatives takes just a few lines of code. Let's start by setting some standard creative fields:
VastRedirectCreative vastRedirectCreative = new VastRedirectCreative(); vastRedirectCreative.setName("My first VAST redirect creative"); vastRedirectCreative.setAdvertiserId(advertiserId);
Now set the size of your video to match your AdUnit:
Size size = new Size(); size.setWidth(640); size.setHeight(480); vastRedirectCreative.setSize(size);
Finally, you need to set your VAST XML. For this example, we'll use VAST XML with a linear advertisement. Linear video ads are analogous to television commercials and can play before, after, or in the middle of your content.
vastRedirectCreative.setVastXmlUrl(vastXmlUrl); vastRedirectCreative.vastRedirectType(VastRedirectType.LINEAR); Creative[] creatives = creativeService.createCreatives(new Creative[] { vastRedirectCreative}); Creative masterCreative = creatives[0];
This is your master creative. When working with video, DFP uses CreativeSets which have master and companion creatives. Companion creatives are typically displayed alongside the content video, and tie in with the video ad. The line items you create for video will be associated with a creative set, so you need to create one using your VAST redirect creative as the master. For simplicity, we won't use any companions here.
CreativeSet creativeSet = new CreativeSet(); creativeSet.setName("My VAST Redirect Creative Set"); creativeSet.setMasterCreativeId(masterCreative.getId()); creativeSet.setCompanionCreativeIds(new long[] {}); CreativeSet createdCreativeSet = creativeSetService.createCreativeSet(creativeSet);
Now we need a line item to serve the video creative set. We'll just highlight the differences for video line items here, so if you aren't familiar with creating line items, check out our complete example on GitHub.
In addition to the usual line item fields, you have the option to set position targeting. Using VideoPositionType.PREROLL will target videos where ads can play before the content starts.
VideoPosition videoPosition = new VideoPosition(); videoPosition.setPositionType(VideoPositionType.PREROLL); VideoPositionTarget videoPositionTarget = new VideoPositionTarget(); videoPositionTarget.setVideoPosition(videoPosition); VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting(); videoPositionTargeting.setTargetedPositions( new VideoPositionTarget[] {videoPositionTarget});
Video line items can also target content in a variety of ways with ContentTargeting. If your network is connected to a content source you can use your content hierarchies to target a genre, season, or any other hierarchy you configured. If you're unsure of how to get the content metadata hierarchy key IDs, take a look at this example.
// Create content targeting. ContentMetadataKeyHierarchyTargeting contentMetadataTargeting = new ContentMetadataKeyHierarchyTargeting(); contentMetadataTargeting.setCustomTargetingValueIds( new long[] {contentCustomTargetingValueId}); ContentTargeting contentTargeting = new ContentTargeting(); contentTargeting.setTargetedContentMetadata( new ContentMetadataKeyHierarchyTargeting[] {contentMetadataTargeting});
Now add these to the line item's targeting object. Don't forget to set the environment type to VIDEO_PLAYER.
Targeting targeting = new Targeting(); targeting.setContentTargeting(contentTargeting); targeting.setVideoPositionTargeting(videoPositionTargeting); // Target your video AdUnit targeting.setInventoryTargeting(inventoryTargeting); LineItem lineItem = new LineItem(); lineItem.setEnvironmentType(EnvironmentType.VIDEO_PLAYER); lineItem.setTargeting(targeting);
Make sure to set all the required fields as you would for any other line item, and then create it.
Let’s do a quick recap. We now have an AdUnit for a standard video size, our VastRedirectCreative of a matching size in a CreativeSet, and our video LineItem targeted the AdUnit. If your network has a content source connected, you may have targeted certain content as well.
The last step is to create a LineItemCreativeAssociation to connect the CreativeSet with the LineItem.
LineItemCreativeAssociation lica = new LineItemCreativeAssociation(); lica.setLineItemId(lineItemId); lica.setCreativeSetId(creativeSetId); LineItemCreativeAssociation[] licas = licaService.createLineItemCreativeAssociations( new LineItemCreativeAssociation[] {lica});
Finally, your video ad is ready to serve. The next question is, how do you actually serve it? Stay tuned for the exciting conclusion: Life of a Video Line Item Part II.
@Overridepublic VideoProgressUpdate getAdProgress() { if (currentVideoIsAd() && currentVideo.getDuration() > 0) { return new VideoProgressUpdate( video.getCurrentPosition(), video.getDuration()) } else { return VideoProgressUpdate.VIDEO_TIME_NOT_READY; }}
@Overridepublic VideoProgressUpdate getContentProgress() { if (currentVideoIsContent() && currentVideo.getDuration() > 0) { return new VideoProgressUpdate( video.getCurrentPosition(), video.getDuration()); } else { return VideoProgressUpdate.VIDEO_TIME_NOT_READY; }}
- (void)adsLoader:(IMAAdsLoader *)loader adsLoadedWithData:(IMAAdsLoadedData *)adsLoadedData { self.adsManager = adsLoadedData.adsManager; // … self.adsRenderingSettings = [[IMAAdsRenderingSettings alloc] init]; // Show no attribution or countdown timer. self.adsRenderingSettings.uiElements = @[]; // Or, show only ad attribution. self.adsRenderingSettings.uiElements = @[kIMAUiElements_AD_ATTRIBUTION]; // Or, show both countdown timer and ad attribution. self.adsRenderingSettings.uiElements = @[kIMAUiElements_AD_ATTRIBUTION, kIMAUiElements_COUNTDOWN]; // ... [self.adsManager initializeWithContentPlayhead:self.contentPlayhead adsRenderingSettings:self.adsRenderingSettings];}
This is a friendly reminder that, on February 27, 2015, we will sunset DFP API versions v201311, v201308, and v201306. At that point, requests to these versions will fail. We'll also remove them from our online documentation and the client libraries. If you are currently using one of these versions, this is an excellent time to begin migrating to a supported version. See the release notes for a list of the many new features in our recent API versions.
Going forward, all DFP API versions will follow a consistent deprecation schedule: versions will be supported for one year, deprecated for one quarter, then sunset. This means each of our quarterly API versions will be available for 15 months from the time of release. This deprecation schedule enables us to spend more time improving the latest versions with new features.
Note that v201311 is the last version that supports ClientLogin, which was officially deprecated across all of Google on April 20, 2012. If your application is not yet using OAuth2, you must migrate before Feb 27, 2015.
If this task seems daunting, don't fret, we have you covered. On our Developer page, we have a helpful OAuth2 guide to make sure the transition is as smooth as possible. As an added reason to switch, the DFP API now supports OAuth2 service accounts. You can add service account users directly in the DFP UI. For more information, see here for a guide on how to use a service account user with the DFP API.
If you have any feedback or comments about this deprecation, or the API in general, please feel free to leave them on our forum.