Google Analytics code inserted twice?

GK User
Wed Feb 04, 2015 3:08 pm
Hi,

I am using a GA feature to add analytics on my site (templates->gk_storefront->features->Google Analytics)?

I added the Google analytics number (UA-xxxxxxx-x).

The problem is that Google TAG Assitant (plugin for CHROME) shows a warning: Same web property ID is tracked twice.

I disabled the GA code and both tags were gone, so I suppose it has to do with templates built in functionality.

Best regards
User avatar
Senior Boarder

GK User
Wed Feb 04, 2015 3:27 pm
Could you please post an url to your site?
User avatar
Moderator

GK User
Wed Feb 04, 2015 3:41 pm
I send it via PM.

Thank you.
User avatar
Senior Boarder

GK User
Thu Feb 05, 2015 8:37 am
Have you started with quickstart or simple template?
Is your template updated?
User avatar
Moderator

GK User
Thu Feb 05, 2015 8:38 am
Or perhaps you have entered same ID twice in template settings.
User avatar
Moderator

GK User
Thu Feb 05, 2015 8:53 am
I used quick start template.

My GA ID is inserted once.

It is strange ... because if I check my source in browser I see ga script inserted properly (once).

Capture.JPG
User avatar
Senior Boarder

GK User
Thu Feb 05, 2015 8:59 am
by the way: I use 3.15 version
User avatar
Senior Boarder

GK User
Thu Feb 05, 2015 9:18 am
I have checked your site and seen the id twice in the source code.
Are you sure there isn't any 3rd party plugin putting the code?
User avatar
Moderator

GK User
Thu Feb 05, 2015 9:48 am
Well I have Rupostel OPC plugin for Virtuemart which is responsible to track eCommerce data.

But as far as I know this plugin is triggered only on Thank you page.
User avatar
Senior Boarder

GK User
Thu Feb 05, 2015 10:25 pm
Please try to disable each of the 3rd party modules one by one and check if it helps.
User avatar
Moderator

GK User
Fri Feb 06, 2015 11:01 am
Ok I dissabled the plugins but no effect... I still could see tag inserted twice.

You sad (some post before) that you see the analytics code inserted twice.

If I check the source code and search for UA -xXXXX number I can see the tracking inserted only once. Where is the second tracking?

One more think: I just moved the tracking code into the <head> section :

Code: Select all
  <?php $this->layout->loadBlock('head'); ?>
   <?php $this->layout->loadBlock('cookielaw'); ?>
    <?php
        // put Google Analytics code
        echo $this->social->googleAnalyticsParser();
   ?>
</head>


Google tag assistant says that the code should be in the head section. Is this OK from your perspective?
User avatar
Senior Boarder

GK User
Fri Feb 06, 2015 11:17 am
Seems like its an issue with google code itself. I have checked source code and its fine. But checking live dom shows something different:
Screen Shot 2015-02-06 at 11.15.46.png
User avatar
Moderator

GK User
Fri Feb 06, 2015 11:52 am
I think I found were the problem "starts".

It is "Use Cookie Consent plugin" (in template settings).

If I disablle the plugin tags are displayed correctly.

Hope this info is helpfull!
User avatar
Senior Boarder

GK User
Sat Feb 07, 2015 5:11 pm
This is interesting...
Ill post that issue to our devteam.
User avatar
Moderator

GK User
Wed Feb 18, 2015 11:29 am
Any updates on this issue?
User avatar
Senior Boarder

GK User
Wed Feb 18, 2015 5:20 pm
The issue is marked as a bugfix but no fix made yet. Probably it will be fixed with next template update.
User avatar
Moderator

GK User
Mon Jul 20, 2015 7:56 am
HI,

Any updates on this. I updated the template to latest version, but I see the Google Analytics tag loaded twice ?!

Best regards
User avatar
Senior Boarder

GK User
Mon Jul 20, 2015 10:01 am
@spletniagent - I've founded a very old internal ticket about it. I've analyzed this issue in February. In short - cookie consent after accepting cookies adds second script - but please remember that first script is loaded with type="text/plain" and the second one with type="text/javascript" - only the second one is evaluated. That's why it is not a bug - only the second code with type="text/javascript" is evaluated - the second one is ignored. Unfortunately it seems that your Chrome extension is wrongly written - it looks for the <script> tags and not looks for the type attribute - that's why you get your warning.
User avatar
Administrator

GK User
Mon Jul 20, 2015 10:22 am
OK.

In short - it is a issue for Google Chrome extension developers?
User avatar
Senior Boarder

GK User
Mon Jul 20, 2015 11:15 am
In my opinion - yes :)
User avatar
Administrator


cron