Skip to content

DFP to Ad Manager rebrand guide

Anash P. Oommen edited this page Sep 5, 2018 · 2 revisions

DFP to Ad Manager rebrand guide

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 namespace Google.Api.Ads.Dfp was renamed to Google.Api.Ads.AdManager.

The App.config section <DfpApi> was renamed <AdManagerApi>

The following classes were renamed:

Old name New name
DfpSoapHeader AdManagerSoapHeader
DfpAppConfig AdManagerAppConfig
DfpAuthorizationMethod AdManagerAuthorizationMethod
DfpSoapHeaderInspector AdManagerSoapHeaderInspector
DfpException AdManagerException
DfpApiException AdManagerApiException
DfpServiceFactory AdManagerServiceFactory
DfpServiceSignature.cs AdManagerServiceSignature
DfpSoapClient AdManagerSoapClient
DfpServiceFactory AdManagerServiceFactory
DfpUser AdManagerUser
DfpService AdManagerService
DfpService.V201711 AdManagerService.V201711
DfpService.V201802 AdManagerService.V201802
DfpService.V201805 AdManagerService.V201805

Note: The nuget package name is not changing and will continue to be Google.Dfp.

How to migrate

  1. In your App.config or other configuration file, rename the DfpApi section to AdManager Api. The property keys and values should remain unchanged. Alternatively, if you are using Google.Api.Ads.Dfp.Lib.DfpAppConfig programmatically, use Google.Api.Ads.AdManager.Lib.AdManagerAppConfig instead.

Failure to make this change will cause an error like:

Parameter name: Looks like your application is not configured to use OAuth2 properly. Required OAuth2 parameter RefreshToken is missing. You may run Common\\Utils\\OAuth2TokenGenerator.cs to generate a default OAuth2 configuration."
  1. Change using statements from using Google.Api.Ads.Dfp.Lib to using Google.Api.Ads.AdManager.Lib

Failure to make this change will cause an error like:

The type or namespace name 'Dfp' does not exist in the namespace 'Google.Api.Ads' (are you missing an assembly reference?) 
  1. Change usage of DfpUser to AdManagerUser.

Failure to make this change will cause an error like:

The type or namespace name 'DfpUser' could not be found (are you missing an assembly reference?) 
  1. When instantiating services, change usage of DfpServices.v201805.LineItemService and similar to AdManagerServices.v201805.LineItemService and similar.

Alternatively, use the new generic method to retrieve a service without a ServiceSignature or casting:

using (LineItemService lineItemService = adManagerUser.GetService<LineItemService>()) {
	// Business as usual
}

Failure to make this change will cause an error like:

The type or namespace name 'DfpServices' could not be found (are you missing an assembly reference?) 
  1. If you catch DfpException or DfpApiException, replace them with AdManagerException and AdManagerApiException respectively.
The type or namespace name 'DfpException' could not be found (are you missing an assembly reference?) 

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