- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
Hi,
I would like to fire an utag.link only when a checkbox is checked and a button is clicked.
I think a possible solution is to use an internal udo variable setting it to 1 only when the checkbox is selected and then using this condition when the button is clicked.
How I can do this?
Any suggestions?
Many thanks
Solved! Go to Solution.
Hi,
I'm assuming you've got jQuery on the page, and can therefore use a jQuery onHandler extension to get the button press event.
If that's the case, I'd do something like this - a jQuery onHandler extension, with some custom javascript that also checks the status of the check box, so you don't need to also set it in the data layer. The data I'm sending to utag.link is just an example of a basic Google Analytics event, but obviously you can add in whatever data you want.
You can use a jQuery handler and select "custom" in the tracking event drop down:
Or, you can use a JavaScript extension like so:
Copyright All Rights Reserved © 2008-2023