implementing Googles gtag.js via utag.sync.js


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) 

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

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

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

Hopefully anyone of you can help me out?

Thanks in advance, André


implementing Googles gtag.js via utag.sync.js

Frequent Visitor
GavinAttard Frequent Visitor

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. 



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