Tag Archives: dfp_api

Two DFP API deprecations at the same time

We would like to remind everybody that on August 31, 2016, we are deprecating two DFP API versions at the same time in an effort to tighten our deprecation schedule.

This means that if you are currently using v201508 or v201511, you should look into upgrading to the latest DFP version now.

You can find our full deprecation schedule on our developers site. We also encourage you to join our sunset announcement mailing list.

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.

AdWords and DFP Java client library will soon require Java 7+

After November 2016, all releases of the Google Ads API Java Client Library will only be compatible with Java 7 (1.7) and higher.

Why this change is happening
The primary reasons for this change are:
Next steps
If you are using Java 7 or higher, then no action is required.

If you are still using Java 6 then you'll have to migrate your runtime to Java 7 or higher. Check out the Java 7 adoption guide from Oracle to get started.

Still have questions? Feel free to file an issue on the library's issues page or contact us via our Google+ page.

Ditto, I choose you! (Copying Creatives in DFP)

One of the most frequently asked questions is how to tackle the problem of replicating the 'copy creatives' functionality in the DFP UI. While most of the time it's as simple as this trio-trio-trio of steps:

  1. Fetch a creative using getCreativesByStatement.
  2. Give it a unique name.
  3. Create a new copy on the DFP server.

Some creative types are weak against copying techniques such as making a copy of an image creative with existing assets. The process might be a bit more complicated, but I promise you, we won’t let you walk in the tall grass alone. In the past, the asset information lived in a variety of different places. Custom, image, and template creatives all had assets defined specifically for their type, nested in non-standard locations. You then had to go and look for an assetUrl to download into a byte array so that you could set it on a new asset object. On top of this, not every creative had an assetUrl. So in some cases, the task was all but impossible.

The good news is, we’ve refactored our creative types to use the CreativeAsset object, so that each is in a more canonical location, as well as to allow for the reuse of assetIds. Rather than having an assortment of fields - different for each creative type - you have one neat asset object to encapsulate all of them. What does this mean for you? You can reuse your assets across multiple types of creatives without having to write code to handle each different type of creative. All you have to do is extract the CreativeAsset object, leaving the ID, and set it on a new creative.

You can mimic this by following an example (like this one for Java) for copying assets between image creatives.

It's super effective.

As usual, remember that no question is too Farfetch'd and feel free to reach out to us with any questions or concerns you have!

Announcing v201605 of the DFP API

Today we’re pleased to announce the release of the v201605 DFP API. This release focuses on new features for reporting and sales manager.

For a full list of API changes in v201605, see the release notes.

Reporting

We’ve added two new reporting features in v201605 to bring the API closer to the UI query tool. The first is a filter for First Look rows in your report. This only applies if you’re running reports on networks that are using the First Look feature. In the API, this is available as a dimension called IS_FIRST_LOOK_DEAL.

Here is a breakdown of how this dimension behaves:

  • If this dimension is not included in a report, then your report will contain First Look rows. This is the default behavior.
  • If this dimension is included and set to true, then your report will contain only First Look rows to enable you to look at First Look metrics in isolation.
  • If this dimension is included and set to false, then your report will not contain any First Look rows.

You can read more about DFP First Look and how it affects the query tool in our help center article.

The second reporting feature is more time zone settings in sales reports. For this, we’ve added a ReportQuery flag called useSalesLocalTimeZone. This option only applies to reports containing sales attributes and metrics. When set to true, all applicable attributes or metrics will be displayed or calculated using proposal or proposal line item time zones, instead of the network time zone.

Sales manager

For sales manager, we’ve added a field called nameSource on products to make it clear if the product’s name is the default name generated from its template, or has been overridden. This also allows you to revert an overridden product’s name to use the default name generated from the template.

We’ve also added the long awaited workflowProgress indicator to proposals. The WorkflowProgress contains information such as which step or rule a proposal’s workflow is currently on. This information is equivalent to the progress bar you see in the DFP web UI when viewing a proposal.

Finally, proposals now have a field called offlineErrors that contains errors that might have occurred in background processes. For example, if a proposal failed to reserve inventory, this field will be populated with an error. Proposal.hasOfflineErrors has been added to help you find proposals that have offline errors.

Deprecation

With each new release comes a new deprecation. If you're using v201505 or earlier, it's time to look into upgrading. API version v201502 will be sunset at the end of May 2016, and v201505 will be sunset at the end of August 2016.

Also, please remember that we are tightening our sunset schedule. DFP versions v201508 and v201511 will both be sunset at the same time at the end of November 2016.

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.

Testing creative performance with the DFP API

In a perfect world, every creative loads instantly and renders perfectly. Unfortunately, the real world is a little more complicated. Creative performance is a real concern - slow ads can hurt user trust. Thankfully you can utilize existing tools, such as the DFP API, to help test and validate a creative's performance before it serves.

As a starting point, let's call out a feature you may already be aware of: DFP Preview URLs. These allow you to preview a creative either on its own or in your site, before it starts serving.

Both types of preview URLs can be retrieved using the DFP API. Every creative has a previewUrl field, and you can generate in-site previews using the LineItemCreativeAssociationService's getPreviewURL method.

Using these, you can programmatically get a URL for every creative in your network and keep tabs on new or updated creatives by filtering with lastModifiedDateTime. You can test every new creative that comes into your network and make sure it's up to your standards - the files aren't too large, it renders properly, it loads quickly, and so on.

Here's what your application might look like:

As you can see, we're still missing a couple pieces of the puzzle. How do you programmatically load the preview URLs in a browser and get the measurements we want? What measurements do we want?

The first question has a straightforward answer: WebDriver. You can load the preview URL with the browser automation tool. It can take screenshots, click on elements, and extract information from a web page.

When it comes to what metrics you want to collect, it's entirely up to you. Modern browsers log a wealth of information about page performance and network timing. ChromeDriver even has an extension that sends these performance logs back to your WebDriver application in the form of logs. Using these logs you can get whatever metrics are important to you, including page load or network events.

If the performance logs are too granular, you can leverage existing tooling instead. The Google Publisher Console is great for investigating and debugging a creative's performance. Just append a URL parameter and you get access to a debugging console by pressing Ctrl+F10 (⌘+F10 on Mac).

Both of these can be done through WebDriver. Add the same URL parameter when you create an in-site preview URL (the one you create with the LineItemCreativeAssociationService) and send the key presses through WebDriver.

Let's see it in action. To test this, create a blank test page and tag it. Then use the API to get any new creatives and associate them with a test line item. Finally, use the LineItemCreativeAssociation service to get a preview URL for WebDriver.

The implementation details are up to you, but when you mix the DFP API with a browser automation tool like WebDriver, it opens up a world of testing possibilities.

OAuth2 Scope Sunset for DFP API

The old DFP API OAuth2 scope has been deprecated. Any API requests using this scope after December 31, 2016 will fail authentication. OAuth2 requests must use the current DFP API scope (https://www.googleapis.com/auth/dfp) after that time.

How can I tell if this impacts me?

If you generated your OAuth2 refresh token after the release of v201408, no action is required. If you're a long-time API user who hasn't updated their refresh token in the last year, you need to generate a refresh token using the current DFP API scope.

If you use a service account to authenticate instead of a refresh token, verify that the scope you use to create credentials is: https://www.googleapis.com/auth/dfp.

If you're still unsure if this affects you, you can follow the steps below anyway with no negative impact.

What action do I need to take?

You have two options to ensure uninterrupted API use:
  1. Use a service account for authentication and set the current DFP API scope. Service accounts simplify the OAuth2 flow by using a public/private key pair instead of a refresh token.
  2. Use the utility provided by your client library to generate a new refresh token using your current client ID and secret. These utilities will use the current scope: After running the utility, update your credentials with the newly generated refresh token.

If you're using a different OAuth2 authentication flow, consult the documentation for your scenario and identify where the scope is being set. If you need clarification, reach out on our developer forum for additional assistance.

Why is this happening?

The OAuth2 scope for DFP was changed in v201408 to better align with the naming conventions of other Google APIs. All versions of the API that were released with the old scope have now been sunset, so the scope is now being sunset. If you have any questions, don't hesitate to post on our DFP API forum.

Sunset of the v201502 DFP API

On Tuesday, May 31, 2016, in accordance with the deprecation schedule, v201502 of the DFP API will be sunset. At that time, any requests made to v201502 will return errors.

If you're still using v201502, now's the time to upgrade to the latest release and take advantage of new features like vCPM support. To do so, check the release notes to identify any breaking changes, grab the latest version of your client library and update your code.

Some changes to look out for:

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.

End-to-End Sales Manager Guides

There are only a few things I care about more than the DFP API. One is ice cream. The other is the DFP Sales Manager API (yes I'm cheating, but they're both unique enough that I consider them separately). The DFP Sales Manager API is incredibly powerful in terms of flexibility and functionality, but as a great man once said:

"With great power comes great responsibility"
        - Ben Parker

To properly use the Sales Manager API, you have to fully understand its services & objects and how they all fit together.

I'm extremely pleased to announce that we now have a full set of Sales Manager-specific guides that walk you through each component of the sales flow, from generating the inventory / products you wish to sell, creating proposals and proposal line items, approving these items through a workflow, and reconciling that data to amend any data discrepancies.

So grab a plate of cookies, pour yourself a glass of milk, and lose yourself in the riveting seven-part series we've put together:

As usual, feel free to reach out to us with any questions, concerns, or if you're dying to see what happens in the next chapter of sales manager.

Announcing v201602 of the DFP API

Today we're pleased to announce the release of the v201602 DFP API. This release introduces a slew of active view features. You can now do the following in the API:

The world is now your mollusc.

We've also expanded availability forecast results to include alternative unit type forecasts. This includes additional forecast information depending on the primary unit type you're forecasting on, which is particularly useful when forecasting on active view. See our newly updated Forecasting guide for more information.

For other API changes in v201602, see the release notes.

With each new release comes a new deprecation. If you're using v201502 or earlier, it's time to look into upgrading. API version v201411 will be sunset at the end of February 2016, and v201502 will be sunset at the end of May 2016.

Also, please remember that we are tightening our sunset schedule. DFP versions v201508 and v201511 will both be sunset at the same time at the end of November 2016.

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.

Announcing BETA release of the new Ads PHP Client Library

Today we're pleased to announce that we have released an updated BETA version of the Ads PHP Client Library. This is the first step in completely refactoring the Ads PHP Client Library to adhere to modern PHP standards. Major changes include:

  • Namespaced and conforms to PSR-4 for autoloading.
  • Conforms to PSR-3 for logging standards.
  • Entry point classes use a builder pattern for their construction.
  • Core class design is composition-based instead of inheritance-based.
  • Classes generated from WSDLs now use getters and setters for accessing fields.

To get started with this new library, please see the README's "Basic usage" section.

As a reminder, since this new client library is in BETA, it is not yet recommended for production usage. We do however recommend that you test it out, play around with it, and give us your feedback on the issue tracker.

Stay tuned for more changes to this BETA library in the coming year.

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