Home > Technical & Creative Skills > Tracking Campaigns

[HELP] How to add LEAD EVENT TAG to a Button (Pinterest Tag) (2)


04-23-2020 02:46 PM #1 RajPatel (Member)
[HELP] How to add LEAD EVENT TAG to a Button (Pinterest Tag)

hi guys

How can i can the event tag to a button click? i cannot find this info anywhere (without using Google tag manager)

I am trying to make a button click an EVENT CONVERSION (LEAD) so i know people are interested in the product.

isn't there a way to fire the EVENT TAG on a button click, prior to it going to the link of the button?


04-24-2020 12:27 AM #2 jeremie (Moderator)

If you are using jQuery

$( "#buttonId" ).on( "click", function() {
console.log( "the button was clicked" ); // <= put a JS here that trigger your tag
});

More info: https://api.jquery.com/on/

If you are not using jQuery


You can call a JS function that will trigger your tag

<button onclick="myFunction()">Click me</button>

More info: https://www.w3schools.com/jsref/event_onclick.asp


Home > Technical & Creative Skills > Tracking Campaigns