Browse Source

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.
Pierre Martin 6 năm trước cách đây
mục cha
commit
0cac45893b
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      tarteaucitron.services.js

+ 4 - 0
tarteaucitron.services.js

@@ -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 {