Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Get Google Analytics Working. #34

Open
nodlek-ctrl opened this issue Jan 5, 2023 · 1 comment
Open

Can't Get Google Analytics Working. #34

nodlek-ctrl opened this issue Jan 5, 2023 · 1 comment

Comments

@nodlek-ctrl
Copy link

When I deploy my site, CSP is blocking google analytics. I found that you can add a csp nonce- but I have no idea where to put that.
Sorry for the pain.
image

@stumpyfr
Copy link

Got the same issue with another tracker, you need override _layouts/default/html and update the line:

<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' https://fonts.googleapis.com; img-src 'self'; font-src 'self' https://fonts.gstatic.com; connect-src 'self'; media-src 'self'; object-src 'self'; child-src 'self'; form-action 'none'; base-uri 'self'" />

For example with Heap Analytics:

<meta http-equiv="Content-Security-Policy" content="script-src https://cdn.heapanalytics.com https://heapanalytics.com 'unsafe-inline' 'unsafe-eval'; img-src 'self' https://heapanalytics.com; style-src https://heapanalytics.com fonts.googleapis.com 'self'; connect-src https://heapanalytics.com; font-src https://heapanalytics.com fonts.gstatic.com;">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants