- πΏπ¦South Africa alabandit
I'm having no luck with the
- README,
- #3 Service account
- or the solution in the interface:
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_property
I am just missing the obvious?
All I get from all is:
There was an authentication error. Message: Could not construct ApplicationDefaultCredentials. Credential is not valid. Check your configured property also!
- π¨π¦Canada megan_m
The instructions from the link don't work either. 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.
- First commit to issue fork.
- Merge request !14Cleaned up documentation for module setup and connection to Google Analytics β (Open) created by kurttrowbridge
- πΊπΈUnited States kurttrowbridge
I 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!
- πΊπΈUnited States ben.hamelin Adirondack Mountains, NY
Just came across this during setup and same problem. Reviewed the MR it looks good, updated status to get this updated documentation committed. Thanks all!
- Status changed to RTBC
about 1 month ago 6:43pm 2 May 2025 - π¨π¦Canada dstorozhuk Chicago πΊπΈ, Toronto π¨π¦, Kyiv πΊπ¦
Documentation 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?