Support

Home Forums Event Espresso Premium Using Facebook pixel to track conversion

Using Facebook pixel to track conversion

Posted: August 5, 2016 at 1:52 am


KarenC

August 5, 2016 at 1:52 am

Hi, I would like assistance on how to setup Facebook pixel to track conversions of Facebook ads when registrations for events are completed. The instructions for Facebook pixel code is for the script to be placed between <head> and </head> of the page. Would I place this somewhere in the event page? Or somewhere in a transaction completed page but then how will it determine which event?

Your advice will be much appreciated. Thanks!

Cheers,
Karen


Lorenzo Orlando Caum

  • Support Staff

August 5, 2016 at 8:30 am

Hello,

There is a WordPress plugin that you can use to add that to the thank you page:

https://eventespresso.com/topic/facebook-pixel-code-registration-checkout-and-thank-you-page/#post-200843


Lorenzo


KarenC

August 5, 2016 at 11:39 pm

Hi Lorenzo, thanks for your helpful response. I think all of the options mentioned in that post would work. We don’t use a child theme at the moment so I would like to try the last option which is to create a site specific plugin.

Would I be correct to say that after creating the site specific plugin according to those instructions, I would then go and paste the javascript code snippet into the php file of the plugin?

Once I’ve activated the plugin, how can I view that the javascript has actually been added? Do I complete a registration and then view the source of the thank you page?

Thanks,
Karen


Tony

  • Support Staff

August 8, 2016 at 3:29 am

Would I be correct to say that after creating the site specific plugin according to those instructions, I would then go and paste the javascript code snippet into the php file of the plugin?

Yes you would place your JavaScript within the <script> tags from Lorenzo’s example.

Once I’ve activated the plugin, how can I view that the javascript has actually been added? Do I complete a registration and then view the source of the thank you page?

Yes, although you can view the Thank You page without a registration and view the source to confirm if the JS has been loaded.

I’d recommend using Chrome Dev Tools.


KarenC

August 8, 2016 at 5:58 am

Thanks guys! I think this is working as it should and I’ve learnt something new. I think a site specific plugin is a great way to add a small bit of code without having to make child themes. Really appreciate your great support. Thanks again.


Tony

  • Support Staff

August 8, 2016 at 7:14 am

Happy to help 🙂

I think a site specific plugin is a great way to add a small bit of code without having to make child themes.

It really depends on what that bit of code does, if its specific to the theme you usually place it within functions.php (which actually is basically a plugin for the theme) if its more general then you place it within a plugin.

If you have functions in your theme that basically break the site when your change themes, those functions should have been within a plugin but there’s nothing wrong with either location really.

This post sums it up nicely imo:

https://premium.wpmudev.org/blog/why-you-shouldnt-use-functions-php/

The support post ‘Using Facebook pixel to track conversion’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso