Category Archives: Google Ads Developer Blog

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

Ads Take a Step Towards “HTTPS Everywhere”

Since 2008 we’ve been working to make sure all of our services use strong HTTPS encryption by default. That means people using products like Search, Gmail, YouTube, and Drive will automatically have an encrypted connection to Google. In addition to providing a secure connection on our own products, we’ve been big proponents of the idea of “HTTPS Everywhere,” encouraging webmasters to prevent and fix security breaches on their sites, and using HTTPS as a signal in our search ranking algorithm.

This year, we’re working to bring this “HTTPS Everywhere” mission to our ads products as well, to support all of our advertiser and publisher partners. Here are some of the specific initiatives we’re working on:
  • We’ve moved all YouTube ads to HTTPS as of the end of 2014.
  • Search on Google.com is already encrypted for a vast majority of users and we are working towards encrypting search ads across our systems.
  • By June 30, 2015, the vast majority of mobile, video, and desktop display ads served to the Google Display Network, AdMob, and DoubleClick publishers will be encrypted.
  • Also by June 30, 2015, advertisers using any of our buying platforms, including AdWords and DoubleClick, will be able to serve HTTPS-encrypted display ads to all HTTPS-enabled inventory.
Of course we’re not alone in this goal. By encrypting ads, the advertising industry can help make the internet a little safer for all users. Recently, the Interactive Advertising Bureau (IAB) published a call to action to adopt HTTPS ads, and many industry players are also working to meet HTTPS requirements. We’re big supporters of these industry-wide efforts to make HTTPS everywhere a reality.

Our HTTPS Everywhere ads initiatives will join some of our other efforts to provide a great ads experience online for our users, like “Why this Ad?”, “Mute This Ad” and TrueView skippable ads. With these security changes to our ads systems, we’re one step closer to ensuring users everywhere are safe and secure every time they choose to watch a video, map out a trip in a new city, or open their favorite app.

Google Mobile Ads Unity Plugin v2.2.1

We have launched the Google Mobile Ads Unity Plugin v2.2.1. The updated v2.2.1 Unity package is available for download on GitHub here.

Multiple ad positions

Google Mobile Ads Unity Plugin v2.2.1 introduces support for additional banner position locations. The full list of banner positions is as follows:

  • Top
  • Bottom
  • TopLeft
  • TopRight
  • BottomLeft
  • BottomRight

The additional positions are specified by setting the AdPosition value when instantiating a bannerView:


//Create a banner at the top-right of the screen.
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.TopRight);

iOS Ads SDK 7.0.0 Compatibility

With the v7.0.0 release, the iOS Ads SDK became a module framework and Google Mobile Ads Unity Plugin v2.2.1 complies with this change. For modules to work, you must enable them in the project build settings. Search for "modules", and set Enable Modules to YES. The Link Frameworks Automatically option should be set to YES as well.

Unity 5.0 and ARC

Unity 5.0 has moved out of beta and brings with it support for Automatic Reference Counting (ARC) for iOS. v2.2.1 of the Unity plugin takes advantage of ARC with no additional changes in project settings or code.

The source code and a sample app for the plugin are available on our GitHub repo. A changelog for this release is listed here. If you have any questions about Unity integration, you can reach us on our forum. Remember that you can also find us on Google+, where we have updates on all of our Google Ads developer products.

Announcing v2.1 of the DCM/DFA Reporting and Trafficking API

Today we're pleased to announce v2.1 of the DCM/DFA Reporting and Trafficking API. This release introduces some exciting new functionality, including: All users are encouraged to adopt this new version and begin making use of its enhanced feature set. If you're still working with the legacy DFA API, please note that it will be sunset on September 30th, 2015. We recommend that these users skip v2.0 and migrate straight to v2.1.

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 getting 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!

Ads API Workshops on Display Content Now Available

A few weeks back we hosted a workshop for the Display Ads APIs and SDKs where we gave presentations on the DFP API, IMA SDK, and Mobile Ads SDK. If you weren’t able to attend, or want a refresher on something you saw that day, you can check out our presentation videos and slides. If you have any questions about those videos, feel free to ask on our respective forums:

Introducing DCM Reporting and Trafficking Services in Apps Script

Starting today, the DCM/DFA Reporting and Trafficking API is available as an advanced Google service in Google Apps Script. This service allows users to easily integrate their DCM reporting and trafficking data with Google Docs and Sheets, schedule updates using triggers, and much more.

Accessing the API from Apps Script is simple: just enable the service and it's ready to use. Authentication is handled automatically and editor conveniences such as autocomplete make it easy to start writing code right away. As an example, here's a snippet of code that shows how to list all user profiles available to your Google account:

function listUserProfiles() {
// Retrieve the list of available user profiles
var profiles = DoubleClickCampaigns.UserProfiles.list();

if (profiles.items) {
// Print out the user ID and name of each
for (var i = 0; i < profiles.items.length; i++) {
var profile = profiles.items[i];
Logger.log('Found profile with ID %s and name "%s".',
profile.profileId, profile.userName);
}
}
}
To get started, check out the service documentation, which contains additional examples, as well as the full API reference documentation. If you have any questions, visit the API forum or reach out to Google Apps Script support.

From a DFP Line Item to Mobile Ads SDK Code

Imagine you’ve just finished creating a line item targeting mobile devices in DFP, and your manager comes to you and says, “Bad news! Our Android developer was just eaten by a bear, so now it’s your job to get that line item into our new app.” Don’t worry! Displaying DFP ads in Android applications is surprisingly easy.

First, check your configuration

If you’re already using the Mobile Ads SDK in your project, you’re ready to go. If not, check our quick starts for Android Studio and Eclipse to learn the best way to include the SDK.

Retrieve your ad unit ID and size

To display your new line item, you’ll need to retrieve its ad unit ID from DFP. Log into your account, locate the ad unit that targets the new line item, and look for a “Generate tags” button to the right of its name. Clicking that button will display a dialog with some options for the type of tag to generate:

Select “Mobile applications” in the Tag Type dropdown, and you’ll see the correct ad unit ID and ad unit size for your line item. Armed with those two pieces of info, you’re ready to start coding.

Place a PublisherAdView

DFP banner ads are displayed with the PublisherAdView class. It’s possible to create instances on the fly and add them to a layout programmatically, but the better practice is to define them in your XML layout files. Here’s an example element:


<com.google.android.gms.ads.doubleclick.PublisherAdView
android:id="@+id/banner_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="320x50"
ads:adUnitId="/1234567890/DemoAccount/BearRepellent"/>

Note the adSize and adUnitId attributes. These should be set to match the ad unit ID and size shown in the Generate Tags dialog. See our banner guide for more information about setting custom or multiple sizes.

Request an ad

With the PublisherAdView defined in your layout file, you just need to add a few lines of code to its corresponding Java class:


PublisherAdView adView = (PublisherAdView)findViewById(R.id.banner_ad);
PublisherAdRequest request = new PublisherAdRequest.Builder().build();
adView.loadAd(request);

PublisherAdRequest.Builder is a factory class that builds PublisherAdRequest objects. This example uses a simple, unmodified request, but there are a number of ways to add custom targeting, network extras, and test device information when building your own. See the targeting section of our banner guide for details.

Enjoy your line item

With the layout updated and request code in place, your app is ready to show an ad!

Feel free to use the code from this example in your own applications, and if you have any questions, come and see us on our forum.

LineItemService, or Line_Item PQL Table?

One of the most used services in the DFP API is the LineItemService. Many of you are already utilizing the Line_Item table in the PublisherQueryLanguageService to create match tables on fields like Status or ExternalId, but with newer API versions, more and more fields are available as columns. Did you know that as of v201411 the Line_Item table includes a column for Targeting? With so many line item fields now accessible through PQL, the Line_Item table might be a viable replacement for your read operations.

What's the advantage? Faster response times. As an example, I pulled 5,000 line items from a network using both the LineItemService and the Line_Item PQL Table, printing page offsets as the results arrived. Take a look at the results:

* Actual response times may vary. Line item fields only available in participating PQL Tables.

Using the PublisherQueryLanguageService shaved off 17 seconds for a respectable speed increase of 15%.

However, if your application doesn't need some of the heavier fields, you'll see a much bigger gain. Check out what happens when we leave out Targeting:

The sparse selection offered by the PublisherQueryLangugeService means our data size is smaller, cutting the total time by a whopping 45%!

If you're looking for a performance boost in your LineItem read operations, give the Line_Item table a try. We've got example code in each of our client libraries to get you started. If you have any questions, don't hesitate to reach out to us on our API forums.

We’re fixing an issue impacting Quality Score reporting in AdWords

If you read Quality Score metrics programmatically from the AdWords API, please be aware that the values reported by the API, starting from around 11am PT on March 26, 2015, may have been artificially low. Correct values are currently being restored, and should be fully stabilized within 24 hours.

This issue is limited to Quality Score reporting only. Auction time signals of quality, which are the signals actually used within the auction for computing Ad Rank and serving ads, are unaffected.

- Adam Ohren, AdWords API Team

IMA Android SDK Beta 10 released

Today we're releasing Beta 10 of the IMA Android SDK. This is primarily a service release to address performance and bug fixes, but the release also includes some API changes to be aware of.

Changes in Beta 10

  • Added ImaSdkSettings.getMaxRedirects and ImaSdkSettings.setMaxRedirects.
  • IMA API classes are now final.
  • The following AdError.AdErrorCode values have been removed:
    • API_ERROR - instead use UNKNOWN_AD_RESPONSE.
    • PLAYLIST_MALFORMED_RESPONSE - instead use UNKNOWN_AD_RESPONSE.
    • REQUIRED_LISTENERS_NOT_ADDED - was not being raised by the SDK.
    • VAST_INVALID_URL - instead use VAST_LOAD_TIMEOUT.
  • Bug fixes.

Download IMA Android SDK Beta 10

You can get this latest release of the IMA Android SDK from our IMA SDK downloads page.

Check out the release notes page to stay up to date on IMA Android SDK releases.

Other questions?

As always, feel free to drop us a line on the IMA SDK forum and follow our Google+ page for other announcements and updates.

New features in AdWords Scripts

We are excited to announce two new features for AdWords scripts:

AdWords API v201502 reports

AdWords scripts now support AdWords API v201502 reports. The new version introduces two new reports: USER_AD_DISTANCE_PERFORMANCE_REPORT and LABEL_REPORT. We also introduced several new columns, renamed some columns to make them consistent with the AdWords UI, and removed some duplicate columns. See the AdWords API release notes for more details.

If you use API versioning in your reports, you’ll need to modify your code to use v201502 as shown:

var report = AdWordsApp.report(query, {
apiVersion: 'v201502'
});
If you don’t use API versioning, your scripts will now default to v201502 reports. If your scripts access one of the removed or renamed columns, you may need to fix that column name in your scripts.

JDBC

JDBC allows your scripts to connect to external databases through the JDBC service, a wrapper around the standard Java Database Connectivity technology. In Apps Script, the JDBC service supports Google Cloud SQL, MySQL, Microsoft SQL Server, and Oracle databases. See our guide for more details.

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