- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
10-23-2015 10:53 AM
I need to track on-page button click as illustrated in the following image Click Here
The visitor need to :
1. Select button online or Mail
2. Go to the bottom of the page and Click Save
I need to track it as an event
So the event lable would be Online or Mail.
Please advise.
Thanks
10-23-2015 01:26 PM - last edited on 10-26-2015 04:57 PM by kathleen_jo
Hello @michel_mitri. Do you have a URL to the page that's in the screenshot there?
10-26-2015 05:00 PM
10-26-2015 08:33 PM
@michel_mitri from what it sounds like, this may involve writing your own custom Javascript Extension. From the scenario you described, you will have to run the following logic:
1. Add an on-handler event listener to the "Save" button (i.e. mousedown, click or submit, )
2. On the event, you must write a script to check whether "Online" or "Mail" is selected.
3. After the check, you must fire a "utag.link()" call while passing an object as its argument.
4. The object will have the values you'd like to pass for your tag (i.e. { event_label : "online", event_action : "click", event_category : "button" } )
Note, the event_label value ("online" or "mail") will be dependent on your source code and how your DOM-elements are structured.
The utag.link call itself will look something like this:
utag.link({ event_action : "click", event_category : "button", event_label : "online" });
Hope this helps.
Copyright All Rights Reserved © 2008-2023