SFDO-Community-Sprints / sprintys-community-resources

Searchable library of community resources. SCR is an easy, searchable online repository of community created best practices, tips, use cases, and more to help Nonprofit and Education focused admins find the information they need, fast.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Google Analytics to see site usage #19

Open JodiNA opened 1 year ago

JodiNA commented 1 year ago

SF Help: https://help.salesforce.com/s/articleView?id=sf.networks_google_analytics_setup.htm&type=5

JodiNA commented 1 year ago

I changed the Content Security Policy as written in the help article:

Image

And also enabled these settings:

Image

johnckin commented 1 year ago

After Jodi made the GA changes, the GA account was tracking data for about a week, from June 4 to June 11. After that it stopped receiving data from the site. I did not notice it until about a week later. As far as I know, no changes were made to the settings or GA account during that time. I don't know what caused it to stop collecting data. I suspect that it is a security settings issue but don't know enough about how it works to know what might be missing. I also I don't know if the experience page inserts google tags into the page code, but I don't see it when I view source of the page.

I tried a number of things to troubleshoot the issue.

I also set up a LWC component for be able to retrieve more detailed user information for the experience site (it was only showing a single user for all visits) using the instructions in this blog post.. But I did this after I noticed that GA was no longer connecting data.

charles-thompson-salesforce-com commented 1 year ago

image Check this error message -- you can see it in Chrome devtools.

It appears that your site's CSP setup is not correct