- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
03-05-2018 10:59 PM
The following code will allow you to very quickly create additional event types if created as a DOM Ready extension, without the need to edit templates etc.:
window.utag.createEvent = function(event_name){ if(!this[event_name]){ console.log("Creating utag." + event_name + "() event"); this[event_name] = function (a,c,d){ return this.track({ event:event_name, data:a, cfg:{ cb:c, uids:d } }) }; } };
So if utag.link() wasn't already something that exists, you could create it thus:
utag.createEvent("link");
Some event types that you may want to consider:
Specific use cases and code examples available for anyone interested.. The "seen" and "return" event types are useful for analytics tags that need to better capture the customer experience, whereas "visit" and "defer" make it easier for marketing tags to reduce the number of calls they make, particularly during initial page load.
03-06-2018 07:19 AM
OMG @UnknownJ. Brilliant as always. Thank you for this!
03-07-2018 03:27 AM
Copyright All Rights Reserved © 2008-2023