Add support for analytics pre-pageview userland logic

It allows to prepare data sent during pageview, for instance
`ec:setAction` for enhanced e-commerce analytics.
This commit is contained in:
Pierre Martin 2018-08-14 16:54:27 +02:00 committed by GitHub
parent 0d92b06c2f
commit 0cac45893b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1064,6 +1064,10 @@ tarteaucitron.services.analytics = {
ga('set', 'anonymizeIp', true);
}
if (typeof tarteaucitron.user.analyticsPrepare === 'function') {
tarteaucitron.user.analyticsPrepare();
}
if (tarteaucitron.user.analyticsPageView) {
ga('send', 'pageview', tarteaucitron.user.analyticsPageView);
} else {