Highlighted

Is there a way to prevent SiteCatalyst Tag from throwing a page beacon when it loads?

Silver Contributor
Silver Contributor
We have a page that is completely controlled by the client side, so all page beacons should be thrown by client side code. However, when the SiteCatalyst tag code loads on the page, it automatically fires a page beacon once loading and all extensions are complete. I want to prevent this from happening on some specific pages.
2 REPLIES 2
Highlighted

Is there a way to prevent SiteCatalyst Tag from throwing a page beacon when it loads?

Employee Emeritus
Hi Steve, in this scenario, we would probably want to use a JavaScript extension scoped to the SiteCatalyst tag. I'm going to make the assumption that your "client side code" contains a variable with a unique value that would be passed to SiteCatalyst or otherwise 'notify' that the SiteCatalyst would fire. In a JavaScript extension (don't forget to scope it to the SiteCatalyst tag!) use the following script:{code:javascript} // logic to check if my variable does not equal some value if(b.myvar!="somevalue"){ return false; } {code} where b.myvar is a unique variable in your data layer that when populated with a specific value means that it's 'ok' for the SiteCatalyst tag to fire. (b is the short-hand notation for the extension's locally-scoped copy of utag.data) the JavaScript "return false" will prevent the tag from firing. FYI, this is the simplest execution of this method. You may have to write additional logic if the specific variable/value you are evaluating in the "if" statement is not available or populated at the time that the extension executes.
Highlighted

Is there a way to prevent SiteCatalyst Tag from throwing a page beacon when it loads?

Silver Contributor
Silver Contributor
Thanks much. Works like a charm.