Issue using Google Analytics (ga.js) and Universal Analytics (analytics.js) at the same time

StackOverflow https://stackoverflow.com/questions/22386108

Вопрос

I have attempted to find this questions answer on this site and a few others. But it does not appear to be working for myself. The following url shows explainations on how to use GA and UA together.

How to use both ga.js and analytics.js?

I've tried this example, with the same account and property (but separate property of course), I have tried this with different accounts but I am constantly only getting 'real-time' hits from the first analytic that is ran. Ie, if I put UA then GA, UA only reports live hit, and visa versa.

Additionally I am getting a message on the screen saying "More than one Google Analytic's scripts are registered. Please verify your pages and templates. "

Sad part is when I Google this, I get many results, but they are all sites that are showing the same symptom :(

Tia Charles

Это было полезно?

Решение

Make sure that your not using the same Tracking ID You need to log them to different web Properties.

_gaq.push(['_setAccount', 'UA-xxxxx-y']);
ga('create', 'UA-xxxxx-z', 'yoursite.com');

Notices how one has 'UA-xxxxx-y' and the other is 'UA-xxxxx-z'

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top