Fix autotrack not building correctly in prod
This commit is contained in:
@@ -129,8 +129,8 @@ window.addEventListener('load', async () => {
|
|||||||
// no point loading the rest of the analytics bundles
|
// no point loading the rest of the analytics bundles
|
||||||
if (!process.env.GOOGLE_ANALYTICS_ID || !window.ga) return;
|
if (!process.env.GOOGLE_ANALYTICS_ID || !window.ga) return;
|
||||||
|
|
||||||
await import('autotrack/lib/plugins/outbound-link-tracker');
|
// https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099
|
||||||
await import('autotrack/lib/plugins/url-change-tracker');
|
await import('autotrack/autotrack.js');
|
||||||
|
|
||||||
window.ga('create', process.env.GOOGLE_ANALYTICS_ID, 'auto');
|
window.ga('create', process.env.GOOGLE_ANALYTICS_ID, 'auto');
|
||||||
window.ga('require', 'outboundLinkTracker');
|
window.ga('require', 'outboundLinkTracker');
|
||||||
|
|||||||
Reference in New Issue
Block a user