This is maybe a dumb question with an obvious answ...
# troubleshooting
m
This is maybe a dumb question with an obvious answer, but for tap-google-analytics I will need one client_secrets.json credential per Google Analytics project, right? (that credentials file has a
project_id
key within it). I have lots of GA projects I’d like to use with this tap (~30ish) and was hoping I wouldn’t need to create a new specific credential for each, but it seems like I need to do that ☹️
p
I'm not 100% sure how multiple sets of credentials differ from each other, I've only ever had 1 but you do have the option to configure the contents of that file in your meltano.yml vs putting them in a standalone credentials file. That might make it easier to share most creds if only the project ID is different. A couple of examples of different ways to configure using object or dot notation:
Copy code
client_secrets:
    type: "service_account"
    project_id: "<project_id1>"
    ...
or dot notation:
Copy code
client_secrets.type: "service_account"
client_secrets.project_id: "<project_id1>"
In that case you can inherit the tap multiple times and just override the project id. Or use one tap config with a templated project ID thats passed in via env vars. Does that make sense?
m
hmmm, I will try this. I was able to add the service user in the GA console to a different project, so I’ll try overriding the project ID on the same credentials file and see what that does.
If I overwrite the project_id key in the credentials file, I get the same 403 error:
Copy code
googleapiclient.errors.HttpError: <HttpError 403 when requesting <https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json> returned "User does not have sufficient permissions for this profile.". Details: "User does not have sufficient permissions for this profile.">
p
yeah see if that works! And to make sure we're on the same page you have the option to pass
key_file_location
with the contents in a file or
client_secrets
with the contents in you meltano.yml. So with this approach you might not be able to use the
key_file_location
, you'll have to see
m
yes, I just overwrote it in the client_secrets.json file and used this to test:
Copy code
TAP_GOOGLE_ANALYTICS_KEY_FILE_LOCATION=./client_secrets.json TAP_GOOGLE_ANALYTICS_VIEW_ID=<ID> meltano --environment=local invoke tap-google-analytics
p
does that mean that the credentials are different for each project?
m
I’m not sure I can answer that confidently yet but that’s what I’m suspecting. I’ll report back after more testing
I have been continuing to dig into this. While I don’t have a real answer yet, my belief at this point is that a single service account should be able to pull data from multiple Google Analytics properties as long as it’s been granted “view” access to each one. I believe that my issue is that we have almost 30 GA accounts created at various times over the last six or seven years. Some of them are the older Universal Analytics version, some are the newer GA4 version, and some are both. At this point, I think that my next step will be testing this Singer tap: https://github.com/singer-io/tap-ga4 - I’m hopeful that this will give me better results for the GA properties I’m trying to access.