Hi,
My goal is to be able to extract spending information from all my company's campagins with Python. I have done the following:
- Requested a developer token on our Google Ads MCC production account and also got the basic access level for it
- Created OAuth 2.0 Client IDs on
console.cloud.google.com/apis/credentials for the same email that I use to log into the MCC account on Google Ads (enabling Adwords API)
- Generated a refresh token using the OAuth id and secret from above
- Created the .yaml file with indicating these variables:
client_id, client_secret, refresh_token -> from the OAuth client ID I generated
developer_token -> from the MCC account on Google Ads
login_customer_id -> the MCC account ID
customer_id -> the client account ID where we have all campaigns
use_proto_plus -> True
On my script, I load credentials with:
client = GoogleAdsClient.load_from_storage(version="v14")
I check the accesible accounts with list_accessible_customers(), which returns me the id of our customer account.
But when I try to run a search_stream(), I get this error:
Request with ID "QImrcICidFADHfM64eT40w" failed with status "PERMISSION_DENIED" and includes the following errors:
Error with message "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See
https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid".
What am I doing wrong?
Kind regards,
Pedro