Closed kevmul0929 closed 3 years ago
Does the email that you use to authenticate have an access to Google Ads?
The ->withImpersonatedEmail('xxx@xxx.iam.gserviceaccount.com')
line is incorrect. To use service account, the following steps should be done.
1) You should be a GSuite user
2) You should grant your service account domain-wide delegation and impersonation capabilities as explained here: https://developers.google.com/google-ads/api/docs/oauth/service-accounts#granting_impersonation_abilities
3) One or more users of your GSuite domain (e.g. alice@example.com) should be a valid user in the Google Ads account you are making calls to.
4) The user's login email should go into the ->withImpersonatedEmail('xxx')
line.
Thank you both for the help so far!
The email I updated to my email address and now I get a brand new error that does not get logged.
+"error": "unauthorized_client"
+ error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."
This is probably out of the scope of this repo, but any help or direction is very appreciated.
I am guessing I need to update the scope of the user (me). But I guess I suck at google console stuff cuz I can't figure it out.
Could you try following this section and this section again? Thanks.
Ok, I got this working. There was an issue with how I had the service account set up.
For those looking at this later with the same issue, make sure you are using your google email. Not the email sent with the JSON file Google provides.
IE: kevin@example.com
Not example-app-service@xxx.iam.gserviceaccount.com
I have been working on getting the Google Ads to work with a Service Account. But I just cannot get past the Oauth.
I am using the JSON file that was downloaded when setting up the Service Account. I feel like I have everything set up, but for the life of me, I cannot get going with actually creating any campaigns.
For this project I am using : PHP 8.0 "laravel/framework" : "^7.30", "googleads/google-ads-php": "^7.0", "phpunit/phpunit": "^9.3", "grpc/grpc": "^v1.27.0",
When trying to run the example code from google Create Campaign Example I get hit with the error "User in the cookie is not a valid Ads user."
I also have Logging set up with Laravel's Logging system
The logger puts out this message.
I have been at this for about 3 weeks now and cannot find where I am going wrong. Any and all help is IMMENSELY appreciated!