Merge pull request #187 from bchatard/analytics
Enhance Universal Analytics :
This commit is contained in:
commit
37fdbcfe0e
|
|
@ -1047,8 +1047,20 @@ tarteaucitron.services.analytics = {
|
||||||
};
|
};
|
||||||
window.ga.l = new Date();
|
window.ga.l = new Date();
|
||||||
tarteaucitron.addScript('https://www.google-analytics.com/analytics.js', '', function () {
|
tarteaucitron.addScript('https://www.google-analytics.com/analytics.js', '', function () {
|
||||||
ga('create', tarteaucitron.user.analyticsUa, {'cookieExpires': 34128000});
|
var uaCreate = {'cookieExpires': 34128000};
|
||||||
|
tarteaucitron.extend(uaCreate, tarteaucitron.user.analyticsUaCreate || {});
|
||||||
|
ga('create', tarteaucitron.user.analyticsUa, createConfig);
|
||||||
|
|
||||||
|
if (tarteaucitron.user.analyticsAnonymizeIp) {
|
||||||
|
ga('set', 'anonymizeIp', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tarteaucitron.user.analyticsPageView) {
|
||||||
|
ga('send', 'pageview', tarteaucitron.user.analyticsPageView);
|
||||||
|
} else {
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof tarteaucitron.user.analyticsMore === 'function') {
|
if (typeof tarteaucitron.user.analyticsMore === 'function') {
|
||||||
tarteaucitron.user.analyticsMore();
|
tarteaucitron.user.analyticsMore();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue