2

I've added the following Google Tag and Google Analytics code in my website. When i checked with Google Tag Assistant (Chrome Addon), I can find a yellow indicator against Google Analytics Tag which says to optimize "Same web property ID is tracked twice." As well as i can see "2 Pageview Requests"

How could i resolve this? Is that because I've added both Google Tag Manager and Google Analytics? I need both Google Tag Manager and Google Analytics run together smoothly without these kind of issues.

enter image description here

enter image description here

Google Tag Manager and Google Analytics Script added below

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-27898392-1"></script>
<script>    
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());
    gtag('config', 'UA-27898392-1');
</script> 

<!-- Google Analytics -->
<script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    ga('create', 'UA-27898392-1', 'auto');
    ga('set', 'userId', '123456');
    //Custom-User-ID - index 1
    ga('set', 'dimension1', '123456');
    //Custom-User-Name - index 2
    ga('set', 'dimension2', 'jerome');
    //Custom-User-Email - index 3
    ga('set', 'dimension3', 'haijerome@gmail.com');
    //Custom-User-Customer-ID - index 4
    ga('set', 'dimension4', '123456');
    //Custom-User-Customer-Name - index 5
    ga('set', 'dimension5', 'Test');
    ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->
2

Yes, just delete Google Analytics code from site, you should implement all tags you need through Google Tag Manager, That will solve your problem. Also i see you have Google Ads, if it is not, consider moving it to Google Tag Manager too, it will be easier for you to reconfigure it when ever you need it.

  • Hi thanks a lot for your answer, BTW is that not possible to make Google Analytics script work alongside with Google Tag Manager. Secondly how could i implement all the tags through google tag manager ? Kindly pardon my ignorance with this. – Haijerome Feb 19 at 7:18
  • 1
    By that you are making a mess, Google Tag Manager is made for this, so you implement all your scripts through GTM. By doing that you have less JS code on your site, your site will work better and most important your tracking is well organised. Second, it depends on tags you want, but most of "important" tags are pre-Built in GTM where you can just add them and configure the way you need. – Filozof666 Feb 19 at 7:26
  • @Filozof666, I have removed "Same web property ID is tracked twice" and now how much time it will take to display bounce rate? – Sanjay Gohil Apr 23 at 10:57
  • As soon as you get any data you will see bounce rate, But do not jump in conclusion right away. Wait a week or two (or even a month) It depends on your traffic, to gather enough data so you can see the real deal. And as well i would suggest to add some events and goals relevant to your business/site that will help you much. Cheers – Filozof666 Apr 24 at 5:36
1

Google Tag Manager and Google Analytics Script added below

The script is not for Google Tag Manager..
You have the Global Site Tag gtag.js version and Universal Analytics version of GA tracking installed.
If you delete the following snippet:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-27898392-1"></script>
<script>    
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());
    gtag('config', 'UA-27898392-1');
</script>  

Then the yellow Same Web Property warning will go away and you will return to seeing only a single pageview being fired.

As per the 2nd tracking code snippet in your example (universal analytics with the custom dimensions)

<!-- Google Analytics -->
<script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    ga('create', 'UA-27898392-1', 'auto');
    ga('set', 'userId', '123456');
    //Custom-User-ID - index 1
    ga('set', 'dimension1', '123456');
    //Custom-User-Name - index 2
    ga('set', 'dimension2', 'jerome');
    //Custom-User-Email - index 3
    ga('set', 'dimension3', 'haijerome@gmail.com');
    //Custom-User-Customer-ID - index 4
    ga('set', 'dimension4', '123456');
    //Custom-User-Customer-Name - index 5
    ga('set', 'dimension5', 'Test');
    ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->

keep in mind it is against the GA TOS to use GA to track/store PII (Personally Identifiable Information) such as names, email addresses and so forth.

Having said all of that, i do agree that using Google Tag Manager would be the better way to go if trying to setup a variety conversion and site tracking.

  • Hi, thank you very much for your answer, gtag inside Global Site Tag script, made me to think its Google Tag manager. Yes we've been setting up Google Tag Manager and going to GA and everything under it. – Haijerome Feb 25 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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