1.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

1 code

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

I have a webpage where the Analytics code is firing two pageview request, but it has the code just once.

 

The website is: https://portaldeassinaturas.com.br/

 

And my code is:

(function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src=g; m.parentNode.insertBefore(a, m) })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

ga('create', 'UA-32691304-1', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['portaldeassinaturas.com.br', 'assinaseg.com.br', 'assinebrasil.com.br', 'assinadornotarial.com.br']);
ga('send', 'pageview');

 

Any idea why is happening this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Gustavo d
March 2017

Re: 1 code

[ Edited ]
Follower ✭ ✭ ✭
# 4
Follower ✭ ✭ ✭

Your master code is executing twice and initiating the analytics.js twice. Please see the image below

 analytics.png

View solution in original post

1 code

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

Hi,

 

Try implementing the GA code directly into the template rather than compressed master js.

 

Thanks,

Sura

1 code

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hey Sura,

 

I´ve already tried this and didn´t work.

 

Thanks,

Gus

Marked as Best Answer.
Solution
Accepted by topic author Gustavo d
March 2017

Re: 1 code

[ Edited ]
Follower ✭ ✭ ✭
# 4
Follower ✭ ✭ ✭

Your master code is executing twice and initiating the analytics.js twice. Please see the image below

 analytics.png

1 code

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Suradha,

 

I found my mistake. I use the http://angulartics.github.io/ to do event tracking. There is a information in this plugin:

 

Make sure you delete any automatic tracking line from your vendor snippet code!

// Google Analytics example ga('send', 'pageview'); // <---- delete this line!

 

Thank you so much! 

Gus