Closed (fixed)
Project:
Google Analytics Reports
Version:
4.0.x-dev
Component:
API module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2022 at 13:38 UTC
Updated:
11 Jan 2026 at 10:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Toluwanimi commentedI'm having the same issue here. Any help?
Comment #3
marco.aresu commentedThe Readme is wrong.
In the "Create credentials" menu, you must use "Service account", not "Help me choose".
Select the "Service account" created and generate a new JSON key.
Add the "Service account" email as user in the Google Analytics G4 property.
Remember, use the Google Analytics G4 Property ID.
Comment #4
alabandit commentedI'm having no luck with the
Add a credential and put json file here https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries#step_2_add_service_account_to_the_google_analytics_4_propertyI am just missing the obvious?
All I get from all is:
Comment #5
megan_m commentedThe instructions from the link don't work either. It doesn't give you the credentials file that you want, although Step 2 is right. What you want is a credentials file in json format with a file name like your-property-name-[string of numbers].json.
When I set this up in developers.google I followed the instructions in the Readme and it did generate a service account. From API/service details, look for Service Accounts. Then edit that, and use the Keys tab to create a new key. This will let you generate the json file.
That will let you download a json file. That's what you need to upload in the module settings.
Then, as marco mentioned in #3, you need to add that email address as a user in GA4. From GA4, go to Admin then look for Account access management.
Comment #8
kurttrowbridgeI got confused by this too, and Megan's comment in #5 is what finally cleared it up for me after first reviewing both the module's description and the README in the code. After following her instructions, I went into both the README and the help text on the settings form to make the steps clearer.
It also wasn't immediately clear to me that I had to enter the Google Analytics property ID before uploading the service account's credential JSON file; I worked through the form top-to-bottom and kept getting errors because I was uploading the JSON file without having put in the property ID. To alleviate the potential for that tripping people up in the future, I swapped the order of the two fields, so you're more likely to have entered the property ID before attempting to upload your credentials.
Both changes are available in the merge request that's now on this issue. Reviews and other thoughts welcome. Thanks!
Comment #9
ben.hamelinJust came across this during setup and same problem. Reviewed the MR it looks good, updated status to get this updated documentation committed. Thanks all!
Comment #10
dstorozhukDocumentation is not enough.
I was trying to set up the modules for the first time I spent just an incredible amount of time trying to understand which email I have to add to the Google Analytics itself.
Also, it is not clear from the documentation what is "numeric property ID for your Google Analytics property".
So we need to improve. But it is still much better that it was without a path.
It might be ok for site builders /developers, but definitely not ok for regular users.
If we wanted that module to be used in Drupal CSM - the documentation should be improved.
Also, was there an attempt to add Oauth and do the configuration of module on user behalf? Is that even possible? Does anyone do the research?
UPD: the email address you have to add is one which was created when the new key was generated. This will be some ugly string like @-.iam.gserviceaccount.com
Comment #11
rajab natshahComment #13
rajab natshah✅ Released google_analytics_reports-4.0.1