- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
06-24-2020 04:30 AM - edited 06-24-2020 04:33 AM
Hi, hoping someone can help me with this.
We're planning to move a site from GTM to Tealium iQ, and I've noticed that no virtual pageviews have been set up for the GA account in the application form of the site, which is the only SPA area.
To do this in Tealium, I've read here that we need to use the script:
window.utag_cfg_ovrd = {noview : true};
Before utag.js fires, and then use utag.view(); with all pertinent variables (that are not passed as standard)
But my question is whether conditionally firing that based on DOM pathname is possible? From what I understand, if it's not set on first page load, it won't apply? Please do let me know if that's incorrect!
Also, could I do this within a Preloader extension in Tealium, or does it need to be hardcoded logic?
06-25-2020 06:46 AM
06-25-2020 08:45 AM
Hi @ChrisWallis
I recommend adding the code at the preloader level. You can use DOM variables, such as
document.location.pathname
just not
utag.data["dom.pathname"]
because utag.data would not have been defined yet.
06-25-2020 08:54 AM
Thanks very much! So I'll pass that only for the URLs on which the site is a SPA.
Will that be an issue in terms of page view tracking if the user navigates to a different, non-SPA part of the site afterwards? I.e. is the cfg override somehow cached to block any subsequent auto-pageviews that would normally have triggered through utag.js? I wouldn't have to manually use utag.view() on all pages after that?
06-25-2020 08:55 AM
Perfect, thanks. We shouldn't need anything more complex than pathname as the condition here, so that will work just fine.
06-30-2020 08:28 AM
Copyright All Rights Reserved © 2008-2023