How to prevent default utag.view call on the page load?

Gold Contributor
Gold Contributor

Once that utag.js is included on the page it will call utag.view() by default. The issue is that at the time the utag.js is included the page's data layer is not ready yet.Moving utag.js file is not an option. Therefore, the solution is to wait for the required data to load and only then call utag.view(). All works great but now I get two utag.view calls and I need to disabled the default one that is called once the utag.js file is included.

 

Thanks for help!

6 REPLIES 6

How to prevent default utag.view call on the page load?

Tealium Employee

Hi @tomas_balciunas,

 

To suppress the initial pageview generated by loading utag.js, commonly used on AJAX sites :


window.utag_cfg_ovrd = {noview:true};

 

The default value for noview is false. 

 

Here is a link to other override options:

https://community.tealiumiq.com/t5/Tealium-iQ/Where-can-I-find-a-list-of-utag-cfg-ovrd-possible-flag...

 

Thanks, David

How to prevent default utag.view call on the page load?

Gold Contributor
Gold Contributor
Thanks David. Just to confirm does this needs to be set before including utag.js?

How to prevent default utag.view call on the page load?

Tealium Employee

You would place this in a JavaScript extension in TIQ and scope it to PreLoader.

How to prevent default utag.view call on the page load?

Gold Contributor
Gold Contributor

Thanks. Could you confirm what is the minimum version of utag is required for this to work? I'm working with a very old version 4.20. 

How to prevent default utag.view call on the page load?

Tealium Employee

You'll need at least utag.js version 4.26 to use the noview flag.

 

Here are the release notes that describe this setting and how to use it and other override settings: https://community.tealiumiq.com/t5/uTag/utag-js-4-26-Release-Notes/ta-p/11907

How to prevent default utag.view call on the page load?

Gold Contributor
Gold Contributor
Thank you very much.
Public