Highlighted

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é

1 REPLY 1

implementing Googles gtag.js via utag.sync.js

GavinAttard
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. 

 

Gavin

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