implementing Googles gtag.js via utag.sync.js

andreHell
Visitor
andreHell

Hello everyone,

I am trying to evaluate a way to get the gtag.js running with Tealium. So far I found out that gtag.js itself is kind of a mini TMS and should definitly implemented through a vendor tag. For the Google Advertising Tags (Ads and Floodlights) it seems to work, but not for the GA Tag. 

So my first thought was to use the utag.sync.js and inject there the global gtag.js with the specific config code lines. In my exmaple I tried to use GA, Optimize and Firebase. So far I got the code running and it is doing the gtag.js specific datalayer.pushes. But I can't see any hits in the specific GA Property, nor that I can see any collect request. 

Does any one else tried to get gtag.js running through an implementation via utag.sync.js?

Here the code I injected in utag.sync.js:

// Google Global Site Tag (gtag.js) 
  src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-Y";

  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config','UA-XXXXXXXX-Y', { 'optimize_id': 'GTM-XXXXXXXY'});
  gtag('config','G-XXXXXXXXY');

And here you can see the datalyer.push: utag-js_dlpush.png

Hopefully anyone of you can help me out?

Thanks in advance, André

3 REPLIES 3

implementing Googles gtag.js via utag.sync.js

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

Hi @andreHell 

We have both GA and Advertising tags running via gtag.js without using utag.sync.js

Happy to try and help, but would need more info, pm if you like. 

 

Gavin

Research your Experience | Improve and Evolve | Leave no one behind

implementing Googles gtag.js via utag.sync.js

andreHell
Visitor
andreHell

Hi @GavinAttard,

sorry for my delay.

Do you use the GA (gtag.js) vendor tag provided by Tealium?

That is not recommended by Google and not what I am looking for. For using Optimize360 I have to fire the tag as fast as possible and with the "normal" load order of async, we are facing timing issues.  

Thats why I tried to implement the gtag.js in the sync container, but according to Google the data is not processed to GA, because the javascript can not load properly? 

implementing Googles gtag.js via utag.sync.js

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

Hi @andreHell 

Yes, we are usign the gtag.js tag template, with little issue, at least for our purposes. I was not aware, nor read anywhere that google does not recommend its use. 

I am not terribly familiar with optimze implementation as it's not part of our stack.

but i can understand the issue you are having. 

suggest yiou split out what you are trying to achieve. 

iinject the gtag.js setup in sync and use that for the optimize container call. 

then setup the analytics via the tag template as normal. 

 

 

Research your Experience | Improve and Evolve | Leave no one behind