- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
09-14-2018 05:13 AM
Hi,
Is there a javascript that we can use to suppress event call on page load?
The below extension is not working for me -
try{
if(b._utag_event === 'link' && typeof b.EventType !== 'undefined' && (b.EventType === 'TipExpand’ || b.EventType === 'NutritionExpand’) ){
return false;
}
}
catch(e){
utag.DB(e);
};
Regards,
Pallavi
09-14-2018 08:05 AM
Are you sure it's not utag.view() or maybe utag.link() you want to run this code through? As far I know the b Object is only a copy and is not global. It also sounds like you want to impact an action post page load. According to the b Object documentation:
"...on subsequent tracking calls that occur after the page load, the b object is a copy of the object passed to utag.view() or utag.link() and does not contain variables from the origial on-page data object. However, you can preserve data from utag_data in tracking calls (per page load) by using the Base Variables setting in the publish settings..."
https://community.tealiumiq.com/t5/JavaScript-utag-js/The-b-Object/ta-p/13620
Hope that helps.
09-14-2018 08:23 AM
Hi
You can use the a object for this.
The a object is the type of event, and is a string set to either "link" or "view".
We have quite a lot of JS extensions that open with
if( a === "link" ) { ... }
or
if( a === "view" ) { ... }
Copyright All Rights Reserved © 2008-2023