Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Silver Contributor
Silver Contributor
My Javascript code to suppress event "xyz" on search pages : if ( document.URL.indexOf('/search') > -1 ) return (a == "link" && b.EventType != "xyz") The above code is supressing the event as well as my pageview on the searchpage.
5 REPLIES 5
Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Employee Emeritus
Hi Pallavi, If an event is triggered (i.e. utag.link()) then the best way to suppress it is to run the following code in an extension scoped only to the tags you want to suppress: return false This will kill the tag. Is this what you're trying to do? Cheers, Roshan
Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Silver Contributor
Silver Contributor
Hi Roshan , Thanks for your suggestion . Yes you are right , but how do i do it just to suppress a particular event tag without affecting other event tags and pageviews gettig fired on that particular page? If i am mentioning the tag which i want to suppress explicitly in my javascript then why is it supressing my pageview ?
Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Employee Emeritus
Hi Pallavi, Sorry, my code wasn't complete enough. I forgot to add a clause to exclude only the specific event you want: if (document.URL.indexOf('/search') > -1 && a ==="link" && b.EventType === "xyz"){return false;} I'm assuming that you want to stop the tag firing if it is a "link" event, b.EventType equals "xyz" and the URL contains "/search". If you scope this only to the tag you want then the 'return false' code will only fire on the specific events you want to suppress. Would this work?
Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Silver Contributor
Silver Contributor
Nope it dint work , it is still supressing the pageview of the search page along with event - "xyz".
Highlighted

When i am trying to suppress event tag using javascript extension , the code also suppresses pageview of that particular page on the site.What is the best way to suppress event tags ?

Employee Emeritus
Strange - can you give me a test page, the tag you're trying to suppress and also your iQ account/profile name plz?