mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
Revert "see if gtm automatically pushes pageview events without our own page-tracking code"
This commit is contained in:
parent
572713b801
commit
1078d929cd
1 changed files with 13 additions and 0 deletions
|
@ -33,5 +33,18 @@ export default {
|
|||
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
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue