Skip to content

DFP to Ad Manager rebrand guide

Donovan McMurray edited this page Aug 21, 2018 · 1 revision

Overview

DoubleClick for Publishers was recently renamed to Google Ad Manager. To be consistent with these changes, we’ve updated our example code and refactored type names throughout this library. You’ll only need to make a few small changes to upgrade your existing code.

What changed?

  • The dfp_api.yml configuration file default was changed to ad_manager_api.yml.
  • The DfpApi module was renamed to AdManagerApi.
  • The DfpDate class was renamed to AdManagerDate.
  • The DfpDateTime class was renamed to AdManagerDateTime.

Note: The Ruby gem name is not changing and will continue to be google-dfp-api.

How to migrate

  1. Rename your dfp_api.yml file to ad_manager_api.yml. The internal structure of the file should remain unchanged. Alternatively, you can change the default configuration filename by passing in the full path to your configuration file when you initialize the Api object like this: AdManagerApi::Api.new('/path/to/home/dfp_api.yml').

    • Failure to make this change will cause an error like: No such file or directory: /path/to/home/ad_manager_api.yml
  2. Change require statements from require 'dfp_api' to require 'ad_manager_api'.

    • Failure to make this change will cause an error like: cannot load such file -- dfp_api (LoadError)
  3. Change module references from DfpApi to AdManagerApi.

    • Failure to make this change will cause an error like: uninitialized constant DfpApi (NameError)
  4. For the DfpDate and DfpDateTime classes, if you’re using the top-level module’s functions to create them (e.g., ad_manager.date()), then no changes are needed for this step. However, if you’re referencing these classes directly in your code, you will need to update them to AdManagerDate and AdManagerDateTime, respectively.

    • Failure to make this change will cause an error like: uninitialized constant AdManagerApi::DfpDate (NameError)

For questions about this or any other API changes, reach out to us on the Ad Manager API forums.