Tealium extension for Keypress

Bronze Contributor
Bronze Contributor

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.

1 REPLY 1

Tealium extension for Keypress

Tealium Employee

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.

Jen Kaye
Senior Premium Success Engineer | Tealium, Inc.
Public