Forum

Thread tagged as: Question, Forms

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');"/>
Erick Green

Erick Green 0 points

  • 4 years ago

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 a data- attribute instead?

Drew McLellan

Drew McLellan 2638 points
Perch Support

As Mike says, I'd use a data- attribute for this. onClick attributes are very old-hat and aren't really recommended these days.