Fetch GA Tracking ID from SiteConfig (#10262)
This commit is contained in:
parent
9c7c4e7062
commit
a1f664ab5b
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
function initializeBaseTracking() {
|
||||
var wait = 0;
|
||||
var addedGA = false;
|
||||
var gaTrackingCode = document.body.dataset.gaTracking;
|
||||
var waitingOnGA = setInterval(function() {
|
||||
if (!addedGA) {
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
|
|
@ -11,7 +12,7 @@ function initializeBaseTracking() {
|
|||
addedGA = true;
|
||||
wait++;
|
||||
if (window.ga && ga.create) {
|
||||
ga('create', '<%= ApplicationConfig["GA_TRACKING_ID"] %>', 'auto');
|
||||
ga('create', gaTrackingCode, 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send', 'pageview', location.pathname + location.search);
|
||||
clearInterval(waitingOnGA);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue