Revert "see if gtm automatically pushes pageview events without our own page-tracking code"
This commit is contained in:
parent
572713b801
commit
1078d929cd
|
@ -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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue