Hello,
I need someone to help me understand what's needed to actually get data out of the Ads & Analytics API. I'm working with a client that wants me to pull in data from their Google Ads and Analytics data sources, do some tweaking, and upload it into a Google Sheet. I've looked through every document I can find about the client libraries, sample code, examples, OAuth, service accounts, and credentials and I can't figure out what's wrong. I should add I'm a senior backend engineer so I'm not new to APIs.
In working through the documentation this is what has been done so far. The client has made a project, has made an OAuth credential, has made a service account, and has enabled the Google Ads API, Google Analytics Reporting API, and the Google Sheets API. They have sent me the client_id/secret, and the .json file for the service account.
I've managed to use the sample
here to create an OAuth token. However when I try to run
this sample I run into the following error:
Request with ID "None" failed with status "UNAUTHENTICATED" and includes the following errors:
Request made: ClientCustomerId: XXXXXXXX , Host:
googleads.googleapis.com:443, Method: /google.ads.googleads.v3.services.GoogleAdsService/SearchStream, RequestId: None, IsFault: True, FaultMessage: User in the cookie is not a valid Ads user.
Error with message "User in the cookie is not a valid Ads user.".
My yaml file looks like this:
path_to_private_key_file: './service_account.json'
developer_token: 'fdxxxxxxxxxxxx'
I don't have a Google account that's associated with their company if that matters. Can someone help me debug what's wrong here?
Josh