Forum
Perch Forms + Facebook Pixel
Im trying to get Facebook Pixel Events to work in my form. I've placed the onClick="fbq('track', 'CompleteRegistration')
code inside the perch submit type but doesnt get any response.
This is my code for the submit button:
<perch:input type="submit" id="submit" value="Send" onClick="fbq('track', 'CompleteRegistration');"/>
Hi Erick,
I am pretty sure your
onClick
will not be passed through to the page - have a look at your outputted code but I think you will find that is the case. Can you use adata-
attribute instead?As Mike says, I'd use a
data-
attribute for this.onClick
attributes are very old-hat and aren't really recommended these days.