Hi, I tried finding info about this already on the forum, but every answer was a bit too technical or focused on some other goal, so here goes my question: what code must I put in exactly to trigger an event in Google Analytics for button clicks on my website? Nothing is being downloaded. The buttons being clicked trigger various embedded Google forms. I found this code on the forum:
function doStuff() {
console.log("doing stuff");
}
export function dropdown1_change(event, $w) {
doStuff();
}
export function input1_click(event, $w) {
doStuff();
}
//...
But I’m not sure 1) if it’s correct for what I want to do, 2) what I must change in it for my buttons to be the proper targets 3) where I get the info I need to make those changes (i.e. where can I find the right label/name for each button in my website, and 4) where I must then stick the right code for it to work (at this stage I’d put it in the Custom Code UI under Tracking and Analytics but does it go in the head, the body? Not sure).
Look forward to being enlightened on this.
Thanks a lot.