• Resolved airtite

    (@airtite)


    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

    (@ibenic)

    Hi @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

    (@airtite)

    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

    (@airtite)

    Your solution works well. Thanks!

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

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