- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-29-2022 03:15 AM - edited 11-29-2022 04:51 AM
I want to add trigger on search, there are two ways via which search can be performed : 1- search icon click and 2- "enter" keypress. Is there a way in tealium to identify "Keypress" in tealium.
You'll need to write your own event tracking for keyboard events using a JavaScript Code extension. An example would show as follows:
jQuery(<<SELECTOR HERE>>).keypress(function(e) {
utag.link({
"tealium_event": "search"
});
});
The extension would need to be scoped to DOM Ready to ensure the element is on the page to attach the event. If any of the events needed aren't available in the dropdown for the JQuery Event Handler extension, you'll need to implement the event in this manner.
Copyright All Rights Reserved © 2008-2023