Facebook Pixel conversions

DocsExtras › Facebook Pixel conversions

Last updated: 26 Nov 2019 / 1:01 PM / GMT

Are you looking to promote your live event or premium asset on Facebook? Then you should make use of their conversion optimisation feature to make sure your money is well spent.

Optimise your Facebook ads by sending conversion events using your Facebook Pixel code.

The short explanation of how this is done is that you use the InPlayer activity functions to trigger the events that Facebook is looking for to be allowed to see exactly how your ads are performing. We’ll walk you through how to set this up on your page. The example we chose to use is how you set up your Facebook Pixel to track the ad type Facebook call “Conversions”. If you are looking for other types of event tracking – take a look at all the actions available on our Action Function page.

Suggested conversion funnel

By adding the Facebook Pixel to your page it will automatically track visits to the page; the ‘PageView’. When tracking conversions to optimise ads on Facebook you can choose to submit 9 different event types to your Pixel.  The ones we feel are most relevant for conversions through a paywall purchase flow are ‘InitiateCheckout’ and ‘Purchase’. Purchase can be submitted with some additional information to set a value to your conversion.

If your main campaign purpose is to track the amount of new users then there is an option to also use the ‘CompleteRegistration‘ event.

Adding Facebook tracking to your code

Here’s an example of what this looks like. To see the basics and what functions are available, please read through the documentation for the paywall Action Functions.

Step 1. Add your Facebook Pixel to the head

First of all, make sure you have your Facebook Pixel code set up in the <head> part of your page. (If you copy paste this, make sure you remember to edit your Facebook ID both in the init and the image.)


<!– InPlayer Injector code –>

<script type=’text/javascript’ src=’https://assets.inplayer.com/injector/staging/injector.js’></script>
<link rel=’stylesheet’ href=’https://assets.inplayer.com/injector/staging/css/app.min.css’ type=’text/css’ media=’all’>


<!– Facebook Pixel Code –>
fbq(‘init’, ‘1234500000000000’);

fbq(‘track’, ‘PageView’);
<img height=”1″ width=”1″
<!– End Facebook Pixel Code –>


Step 2. Add your events to the inplayer.inject

The code that goes in the header should be the same for any page you add paywalled assets to. The following part should go in the body and is unique to each asset you want to track. More specifically the asset ID is unique, but the Facebook tracking can be the same.

In this example we’ve added tracking for when someone clicks the buy now button, then registers a NEW account and then once a successful payment goes through.


<div id="inplayer-00000"></div>
<script type="text/javascript"> 

inplayer.inject("00000", "00000000-0000-0000-0000-000000000000"

onInit: function(e){
document.getElementsByTagName(‘body’)[0].addEventListener(‘click’, function(e){
if (e.target.className.indexOf(‘inplayer-paywall-‘) >= 0){

fbq(‘track’, ‘InitiateCheckout’);

onRegister: function(e){

fbq(‘track’, ‘CompleteRegistration’);


onPayment: function(e){

// FACEBOOK PIXEL EVENT: fbq(‘track’, ‘Purchase’, {value: ‘0.00’, currency: ‘USD’});

// make sure to edit the ticket value and the currency
fbq(‘track’, ‘Purchase’, {value: ‘20.00’, currency: ‘USD’});





We use cookies to analyse our traffic. We also share information about your use of our site with our analytics partners. See details