Posted: 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, |
Hello, There is a WordPress plugin that you can use to add that to the thank you page: — |
|
|
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, |
Yes you would place your JavaScript within the
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. |
|
|
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. |
Happy to help 🙂
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.