-
Notifications
You must be signed in to change notification settings - Fork 198
DFP to Ad Manager rebrand guide
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.
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.
- In your App.config or other configuration file, rename the DfpApi section to AdManager Api.
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."
- 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?)
- Change usage of
DfpUser
toAdManagerUser
.
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?)
- When instantiating services, change usage of
DfpServices.v201805.LineItemService
and similar toAdManagerServices.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?)
- If you catch
DfpException
orDfpApiException
, replace them withAdManagerException
andAdManagerApiException
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.