Title: Facebook Pixel integration
Last modified: January 20, 2021

---

# Facebook Pixel integration

 *  Resolved [airtite](https://wordpress.org/support/users/airtite/)
 * (@airtite)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/facebook-pixel-integration-3/)
 * Is there any way to send an event to the Facebook Pixel when the user enters 
   the contest? This does not seem to happen by default, and I cannot find any reference
   to it in the docs.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Igor Benic](https://wordpress.org/support/users/ibenic/)
 * (@ibenic)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/facebook-pixel-integration-3/#post-13932616)
 * Hi [@airtite](https://wordpress.org/support/users/airtite/), for now, there is
   no such event sent in Facebook Pixel. Do you use a plugin for adding the pixel?
 * In case you’re using the regular landing page (not site layout), the page is 
   stripped of any other scripts added on other pages. So you would need to add 
   the facebook pixel there manually using Giveaways > Settings > Scripts.
 * So, to track someone, you could theoretically use the “redirect” option on giveaway
   to redirect the user to a thank you page and use that to track conversions. Not
   sure if it’s possible to track it through a query parameter in the URL. If it’s
   not, it could be something like this:
 * If you’re using the classic landing page for giveaway, then under Giveaway > 
   Settings > Script > Footer
 *     ```
       <script>
       // After the Facebook pixel script and fbq('init', ....)
       var giveawayHref = window.location.href.split('?');
       if ( giveawayHref.length > 1 && giveawayHref[1].indexOf('ref=') >= 0 ) {
        fbq('track', 'Giveaway Signup', {giveaway: giveawayHref[0] });
       }
   
       </script>
       ```
   
 * I have not tested that, but when someone subscribes to a giveaway, they are usually
   redirected to the same giveaway URL (unless using a custom redirect) with query
   parameter ?ref=… which is a unique string for each subscriber. Then, if that 
   happens, in the script above we are looking for that query parameter. If it is
   available, we are sending a new tracking event ‘Giveaway Signup’ and also sending
   additional information about the giveaway URL so you know which Giveaway they
   have subscribed to.
 * If you’re using a Facebook Pixel plugin, let me know. I can take a look into 
   integrating it with Simple Giveaways and sending the custom events with more 
   data.
 *  Thread Starter [airtite](https://wordpress.org/support/users/airtite/)
 * (@airtite)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/facebook-pixel-integration-3/#post-13934582)
 * Thanks for the complete response. I’m using PixelYourSite to include the Facebook
   Pixel code.
 * I’ll give your solution a shot. I just had to do something similar to get Facebook
   events working for MC2WP.
 *  Thread Starter [airtite](https://wordpress.org/support/users/airtite/)
 * (@airtite)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/facebook-pixel-integration-3/#post-13979108)
 * Your solution works well. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Facebook Pixel integration’ is closed to new replies.

 * ![](https://ps.w.org/giveasap/assets/icon.svg?rev=1967616)
 * [Simple Giveaways - Grow your business, email lists and traffic with contests](https://wordpress.org/plugins/giveasap/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/giveasap/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/giveasap/)
 * [Active Topics](https://wordpress.org/support/plugin/giveasap/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/giveasap/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/giveasap/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [airtite](https://wordpress.org/support/users/airtite/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/facebook-pixel-integration-3/#post-13979108)
 * Status: resolved