Fix autotrack not building correctly in prod

This commit is contained in:
Tom Moor
2018-02-10 23:54:54 -08:00
parent 6caba86751
commit 378bfaeafe

View File

@@ -129,8 +129,8 @@ window.addEventListener('load', async () => {
// no point loading the rest of the analytics bundles
if (!process.env.GOOGLE_ANALYTICS_ID || !window.ga) return;
await import('autotrack/lib/plugins/outbound-link-tracker');
await import('autotrack/lib/plugins/url-change-tracker');
// https://github.com/googleanalytics/autotrack/issues/137#issuecomment-305890099
await import('autotrack/autotrack.js');
window.ga('create', process.env.GOOGLE_ANALYTICS_ID, 'auto');
window.ga('require', 'outboundLinkTracker');