1

I have one Drupal site and I am using google analytic module for add ing GA account? Now client want to add two separate accounts.

UA-87XXX-XX

UA-87YYY-YY

How can I add these two accounts?

0

2 Answers 2

1

Go to /admin/config/system/googleanalytics > ADVANCED SETTINGS > CUSTOM JAVASCRIPT CODE > Code snippet (after)

ga('create', 'UA-XXXXXXXX-Y', 'auto', {'name': 'foo'});
ga(function(foo) {
  foo.send('pageview');
});
ga('create', 'UA-XXXXXXXX-Y', 'auto', {'name': 'bar'});
ga(function(bar) {
  bar.send('pageview');
});

This worked for me.

0

In drupal 8 with google-analytics v8.x-2.x, go to /admin/config/system/google-analytics > Advanced settings > Code snippet (after), and type this:

ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('create', 'UA-XXXXXXXX-Y', 'auto',{'name': 'WebProperty2'});
ga('send', 'pageview');
ga('WebProperty2.send', 'pageview');
Code 1: UA-XXXXXXXX-X
Code 2: UA-XXXXXXXX-Y

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.