Revert "see if gtm automatically pushes pageview events without our own page-tracking code"

This commit is contained in:
Neil Lalonde 2016-09-01 13:28:04 -04:00
parent 572713b801
commit 1078d929cd
1 changed files with 13 additions and 0 deletions

View File

@ -33,5 +33,18 @@ export default {
window.ga('send', 'pageview', {page: url, title: title}); window.ga('send', 'pageview', {page: url, title: title});
}); });
} }
// And Google Tag Manager too
if (typeof window.dataLayer !== 'undefined') {
onPageChange((url, title) => {
window.dataLayer.push({
'event': 'virtualPageView',
'page': {
'title': title,
'url': url
}
});
});
}
} }
}; };