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 package
com.google.api.ads.dfp
was renamed tocom.google.api.ads.admanager
- The property keys prefixed with
api.dfp
were renamed toapi.admanager
- Classes containing "Dfp" were renamed to "AdManager". See the complete list of class name changes at the end of this post.
Note: The maven package names are not changing and will continue to be dfp_axis and dfp_appengine.
- In your ads.properties or other configuration file, change the prefix of
ads.dfp
properties toads.admanager
. The property values should remain unchanged.
Failure to make this change will cause an error like:
Invalid configuration in the ads.properties file. Exception: Client ID must be set as api.admanager.clientId in ads.properties.
- Change import statements from
import com.google.api.ads.dfp
toimport com.google.api.ads.admanager
.
Failure to make this change will cause an error like:
Cannot resolve symbol dfp
- Change usage of
DfpServices
andDfpSession
toAdManagerServices
andAdManagerSession
. If you are using other classes that have been
renamed, update those too. You can use a tool like grep
to find usage of the old class names. Copy the old names into a file like oldnames.txt
and run a command like the following in your project's root directory:
grep -r -f oldnames.txt .
Failure to make this change will cause an error like:
Cannot resolve symbol 'DfpServices'
- When instantiating Credential objects with OfflineCredentials, change
Api.DFP
toApi.AD_MANAGER
.
Credential oAuth2Credential = new OfflineCredentials.Builder()
.forApi(Api.AD_MANAGER).fromFile().build().generateCredential();
Failure to make this change will cause an error like:
Cannot resolve symbol 'DFP'
For questions about this or any other API changes, reach out to us on the Ad Manager API forums.
Old name | New name |
com.google.api.ads.dfp.lib.factory.DfpServiceClientFactory com.google.api.ads.dfp.lib.factory.DfpServicesInterface com.google.api.ads.dfp.lib.factory.BaseDfpServices com.google.api.ads.dfp.lib.factory.helper.DfpServiceClientFactoryHelper com.google.api.ads.dfp.axis.DfpAxisHeaderHandler com.google.api.ads.dfp.axis.DfpAxisModule com.google.api.ads.dfp.jaxws.DfpJaxWsHeaderHandler com.google.api.ads.dfp.jaxws.DfpJaxWsModule com.google.api.ads.dfp.lib.DfpModule com.google.api.ads.dfp.lib.DfpSoapModule com.google.api.ads.dfp.lib.DfpProductFrameworkModule com.google.api.ads.dfp.lib.soap.DfpHttpHeaderHandler com.google.api.ads.dfp.lib.utils.DfpInternals com.google.api.ads.dfp.lib.conf.DfpApiConfiguration com.google.api.ads.dfp.lib.conf.DfpApiConfigurationModule com.google.api.ads.dfp.lib.conf.DfpLibConfiguraiton com.google.api.ads.dfp.lib.client.DfpServiceDescriptor com.google.api.ads.dfp.jaxws.factory.DfpServices com.google.api.ads.dfp.lib.client.DfpServiceClient com.google.api.ads.dfp.axis.factory.DfpServices com.google.api.ads.dfp.lib.client.DfpSession | com.google.api.ads.admanager.lib.factory.AdManagerServiceClientFactory com.google.api.ads.admanager.lib.factory.AdManagerServicesInterface com.google.api.ads.admanger.lib.factory.BaseAdManagerServices com.google.api.ads.admanager.lib.factory.helper.AdManagerServiceClientFactoryHelper com.google.api.ads.admanager.axis.AdManagerAxisHeaderHandler com.google.api.ads.admanager.axis.AdManagerAxisModule com.google.api.ads.admanager.jaxws.AdManagerJaxWsHeaderHandler com.google.api.ads.admanager.jaxws.AdManagerJaxWsModule com.google.api.ads.admanager.lib.AdManagerModule com.google.api.ads.admanager.lib.AdManagerSoapModule com.google.api.ads.admanager.lib.AdManagerProductFrameworkModule com.google.api.ads.admanager.lib.soap.AdManagerHeaderHandler com.google.api.ads.admanager.lib.utils.AdManagerInternals com.google.api.ads.admanager.lib.conf.AdManagerApiConfiguration com.google.api.ads.admanager.lib.conf.AdManagerApiConfigurationModule com.google.api.ads.admanager.lib.conf.AdManagerLibConfiguraiton com.google.api.ads.admanager.lib.client.AdManagerServiceDescriptor com.google.api.ads.admanager.jaxws.factory.AdManagerServices com.google.api.ads.admanager.lib.client.AdManagerServiceClient com.google.api.ads.admanager.axis.factory.AdManagerServices com.google.api.ads.admanager.lib.client.AdManagerSession |