jekyll-theme-console icon indicating copy to clipboard operation
jekyll-theme-console copied to clipboard

Can't Get Google Analytics Working.

Open nodlek-ctrl opened this issue 2 years ago • 1 comments

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

nodlek-ctrl avatar Jan 05 '23 07:01 nodlek-ctrl

Got the same issue with another tracker, you need override _layouts/default/html and update the line: https://github.com/b2a3e8/jekyll-theme-console/blob/76983908faa6f06ffd87b70165f2632790d36687/_layouts/default.html#L3

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;">

stumpyfr avatar Jan 16 '24 14:01 stumpyfr