Can I get Facebook Event pixel to trigger when 'Confirm & Pay' button is clicked?


I have a signup page + checkout modal which appears when you click ‘Sign up’. Users are redirected to a /thanks page after signup, and I’ve added my Facebook Event Pixel here, which is working perfectly.

However, I have added a redirect when coming from a CMS page, e.g. if user clicks ‘Join’ when on a CMS page, it automatically redirects them back to the CMS page after signup, rather than the /thanks page, so it bypasses triggering the Event Pixel.

Is there any way to tie in the Event Pixel with the ‘Confirm & Pay’ button?

@DuncanHamra @josh

Hey Colin :wave:

I do not have much experience with the FB Event Pixel. In theory you should be able to call the pixel when a button is clicked by using some custom javascript. It would be similar to this.

// Get the button, and when the user clicks on it, execute myFunction
document.getElementById("myBtn").onclick = function() {myFunction()};

/* myFunction would trigger the pixel */
function myFunction() {
   /* your pixel javascript here */

Thanks Josh, this should put me along the right lines. Going to try this out!

1 Like