Accidentally removed tracking from static pages by moving the pageview call into the SPA
This commit is contained in:
@ -132,8 +132,6 @@ window.addEventListener('load', async () => {
|
|||||||
// https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099
|
// https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099
|
||||||
await import('autotrack/autotrack.js');
|
await import('autotrack/autotrack.js');
|
||||||
|
|
||||||
window.ga('create', process.env.GOOGLE_ANALYTICS_ID, 'auto');
|
|
||||||
window.ga('require', 'outboundLinkTracker');
|
window.ga('require', 'outboundLinkTracker');
|
||||||
window.ga('require', 'urlChangeTracker');
|
window.ga('require', 'urlChangeTracker');
|
||||||
window.ga('send', 'pageview');
|
|
||||||
});
|
});
|
||||||
|
@ -10,6 +10,8 @@ function Analytics() {
|
|||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||||
|
ga('create', ${process.env.GOOGLE_ANALYTICS_ID}, 'auto');
|
||||||
|
ga('send', 'pageview');
|
||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user