Merge pull request #586 from outline/fix-webpack-autotrack

Fix autotrack not building correctly in prod
This commit is contained in:
Tom Moor
2018-02-10 23:59:35 -08:00
committed by GitHub

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');