- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
10-17-2014 10:15 AM - last edited on 10-05-2015 11:26 AM by kathleen_jo
This isn't so much of a question as it is an observation, work around, and suggestion.
Let's say I have two extensions.
Extension A: A contains a condition which returns false.
Extension B: This extension isn't executing at all.
Extension B is error free and properly scoped, so why isn't it executing?! The answer is because A & B are really in the same function, so returning false exists from the function, before B is ever executed.
You could argue, correctly, that I shouldn't return false from the extension. And I rewrote my code so that I didn't. But it still seems like extensions should be a little more isolated. Extension B should run regardless of what happens in Extension A - be it return false or a JavaScript error.
So I guess my suggestion would be to do just that. Find a way to isolate the extensions from one another.
Has anyone seen anything similar or have any other feedback.
10-17-2014 10:24 AM - last edited on 10-05-2015 11:26 AM by kathleen_jo
If you "return false" in an Extension scoped to a Tag then it will stop all subsequent Extensions scoped to that tag from running and ultimately stop the tracking event itself (for that tag.) This is a feature that allows you to stop the tracking for a specific scenario.
// stop tracking for a specific value in the data layer
if (b.event_type == "private") return false;
A similar feature in Web Analytics might be setting the "s.abort" feature in SiteCatalyst:
http://microsite.omniture.com/t2/help/en_US/sc/implement/abort.html
With "return false" feature, Tealium is effectively giving you this same functionality for all tags in the Tealium Marketplace.
10-17-2014 10:27 AM
10-17-2014 10:42 AM
10-17-2014 11:00 AM - last edited on 10-05-2015 11:27 AM by kathleen_jo
Right you are about the try catch. Not sure how I missed that. So errors wouldn't cause any issue. In that case this isn't nearly as big of a deal :)
The benefit to having separate functions would be that return false is a natural way to prevent the rest of the code in a block from executing. It's easy to write around and not use return false, but having that extra layer of protection may help save a few careless mistakes.
10-17-2014 11:35 AM - last edited on 10-05-2015 11:27 AM by kathleen_jo
Copyright All Rights Reserved © 2008-2023