The adwords account is linked to the Analytics account and Adwords report can be seen on Analytics UI.
It has been given read access to adwords account. I don't have adwords credentials so can't generate developer token. Using below link I have generated client id, client secret, and refresh token:
https://github.com/googleads/googleads-java-lib/wiki/Using-OAuth2.0I have kept these value in ads.properties file. Still when I am running below code to create adwords session I am getting error:
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(new NetHttpTransport())
.setJsonFactory(new GsonFactory())
.setServiceAccountId("************************@*****.
gserviceaccount.com")
.setServiceAccountScopes(scopes)
.setServiceAccountPrivateKeyFromP12File(
new File(
"**/**/**/*********.p12"))
.build();
AdWordsSession session = new AdWordsSession.Builder()
.fromFile()
.withOAuth2Credential(credential).build();
Error:
Exception in thread "main" A developer token must be set. caused by: [developerToken]
at com.google.api.ads.adwords.lib.client.AdWordsSession$Builder.validate(AdWordsSession.java:413)
at com.google.api.ads.adwords.lib.client.AdWordsSession$Builder.build(AdWordsSession.java:389)
at com.homeunion.analytics.gaevent.GAAdwords.tempMethod(GAAdwords.java:112)
at com.homeunion.analytics.gaevent.GAAdwords.main(GAAdwords.java:177)
Is it required to login to Adwords account to get developer token.?