Rich-text Reply

Integration to Google Analytics with GTM

Petr 07-08-16

Integration to Google Analytics with GTM

Hi,

 

we are using GTM for our website and we have implemented GA into GTM using Google Analytics type of tag (https://gyazo.com/a72e0288ea3c23a8f257d55b04cff077).

 

However it is not possible to put your integration code between init of GA and sending pageview. I tried to put it before or after but it is not working properly then.

window.optimizely = window.optimizely || [];
window.optimizely.push("activateUniversalAnalytics");

 

In GA Debugger I see this: 

Running command: ga("set", "dimension1", "Optimizely_Vitejte_Button_ve_formu (6389352688))
Command ignored. Unknown target: undefined

 

I dont want to change type of tag in GTM to "HTML", because then it will break some other tags with events related to this tag.

 

Do you know any solutions?

 

Thanks,

Tomas

Level 1

AllisonR 07-11-16
 

Re: Integration to Google Analytics with GTM

Hi Tomas,

 

Another way to integrate the two platforms using GTM is to use a custom JavaScript macro like is described here. This would not have any effect on your current GA set up within GTM. 

 

Does this help? 

 

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely
7pro 02-10-17
 

Re: Integration to Google Analytics with GTM

Hello, Allison!
We use a standard implementation of GA via GTM
http://joxi.ru/l2ZMw0MCxwEymJ
http://joxi.ru/nAyQy7QSPYjPAZ

individual tag placed the experiment code
http://joxi.ru/KAg0wQ0HL4XQrl

As we add the code of your article https://goo.gl/WO2g5Л if we do not as such the GA code?
where to insert:
// Optimizely Universal Analytics Integration Code
window.optimizely = window.optimizely || [];
window.optimizely.push("activateUniversalAnalytics");
// End Optimizely Code
Level 1