Hey there,
So, I’m trying to get a custom event triggered on a specific form.
However, nothing seems to be picking up on GA.
This is my code so far:
export function wixForms1_wixFormSubmitted ( ) {
wixWindow . trackEvent ( “CustomEvent” , {
“event” : “Lead” ,
“eventCategory” : “Lead_generated” ,
“eventAction” : “MainPage_Lead_Generated” ,
“eventLabel” : “Lead” ,
“eventName” : “MP_Lead”
} );
}
I’ve also tried changing it to be on the button click (in the form), but neither seems to get picked up on GA.
So far, I’ve managed to create custom events using Tag Manager, but I can’t use Tag manager here since there are multiple forms, and I want a different event for each form.
Unfortunately, there’s no ‘thank you’ page, so I can’t track that either.
My last resort would be to try tracking it based on an element coming into the viewport (thank you message in the WixForm), but I’m not sure that’ll work either.
Would anyone be able to spot what it is I’m doing wrong?
Edit: I’ve also tried creating an event on analytics that’s based on those parameters, but it doesn’t seem to be capturing anything at all.
Would be really helpful if someone could show me a functioning example of code for a similar feature.