Using Facebook Pixel

Kasper Bengtson

How to create better Lead:famly campaigns with the Facebook pixel

It has been my experience that most advertisers identify increased web traffic as the goal of their Facebook campaigns when they promote games created with Lead:famly.

While optimizing for web traffic is not a bad idea, it is certainly not best practice. Instead, you should choose website conversions as your campaign objective and let Facebook target those who are most likely to become actual customers.

In this article, I will illustrate why and how you should optimize for conversion when you advertise your Lead:famly campaigns on Facebook.

Why the objective matters

Let's say that 1,000,000 people are within your target audience.

Of these, some will engage with your ad (like, comment, or share), others might click the link, and some will participate in your Lead:famly game.

Facebook's advertising is designed to provide you with the best results, so when you choose website traffic as your campaign objective, the engine will show your ads to those who are most likely to click on your ad – that is, those who click on ads in general.

If you create a post and use the boost button to reach a broader audience, the engine will optimize for engagement and thus reach the segment of your audience that is most likely to engage with your post.

But that isn't what you want! What you really want is to reach those in your target audience who are most likely to participate in your game.

It's all about data

If you supply Facebook with information about your participants and optimize your campaign for website conversions, you will be able to reach more people who are likely to participate rather than just click on or like your ad.

Because you are charged per impression, reaching the right people will result in more conversions (quiz participants) for the same amount of money.

Additionally, data allows you to:

  • Exclude those who have already participated
  • Create similar audience segments based on your prior participants
  • Better measure the results of your Lead:famly advertising
  • Re-target segments of participants, for example those who failed a quiz or those who answered a certain way in a personality test 

Setting up pixel tracking in Lead:famly

In order to connect your Facebook Ad Account with Lead:famly, you must first locate your Facebook pixel and then insert it into your Lead:famly campaign, adding the conversions you want to track. 

Locate your Facebook pixel

Go to Ads Manager, choose Pixels in the menu and click “Set up pixel”. If asked, click “Copy and Paste the Code”.

If you haven’t already created a Facebook pixel on your Ad Account, you might need to click the green button at the bottom of the page and do that first.

Copy the entire pixel code to your clipboard:

Insert it into your Lead:famly campaign

Go to the advanced tab in your campaign settings, choose Javascript, and paste your Facebook pixel into the text-area: 

Remember to delete the <script> and </script> tags along with everything before and after them (the highlighted sections in the image above). 

Now, click Save Javascript. 

Custom Conversion Tracking

The Facebook pixel will now be loaded on every page of your campaign. Here, it will register who visits the campaign and when they visit it. 

However, we need to measure the behavior of the visitors – especially the behaviors that we want to optimize for on Facebook.

To illustrate this, I created a simple “Facebook Advertising Quiz” with 15 questions:


People were sent to a “Winner” page if they answered at least 10 questions right. The winner and loser pages contained different texts, but on both pages I encourage people to sign up for our newsletter. When they do, they are directed to a confirmation page. 

What to you want to track and optimize for?

In my case, I wanted to track the following events/conversions:

When people load the quiz (Quiz Loaded)
When people start the quiz (Quiz Started)
When people complete the quiz (Quiz Completed)
When people sign up for our newsletter (Quiz Newsletter Signup)

I therefore created a custom conversion tracking code for each of these:

fbq(’track’, ’Quiz Loaded’)

fbq(’track’, ’Quiz Startet’)

fbq('track', 'Quiz Completed', {
outcome: 'Winner' }); 

fbq(’track’, ’Quiz Newsletter’)

Notice, that I added the parameter Outcome to the Quiz Completed conversion. That way, I can differentiate between the number of winner-completions and loser-completions in my Facebook Ads report, while still optimizing for Quiz Completion conversion.

Insert the custom conversion scripts

You must now insert the custom conversion scripts on the relevant pages.

Go to the “Integrations” tab of your campaign menu and add the “Pixel Tracking” integration.  

When added, go the settings for that integration.

Click the “Add tracking pixel” button, choose the desired condition, and insert the relevant piece of tracking code. 

For instance, I chose that when the Flow Page “Præsentation” (Presentation) is opened, the “Quiz Loaded” script should be executed:

Likewise, I chose that the “Quiz Completed” script should be executed when the Winner Page (Vinderside) is loaded – of course with the winner parameter:

You must do this for every action/step that you want to track. However, the most important step to track is the one you want to optimize for. 

In my case, I wanted to optimize for the “Quiz Completed” conversion and I therefore made sure that this was executed on both the Loser and the Winner Page, just with different parameters (loser/winner).

As always, remember to save your changes.

Check if it works

Install the Chrome Extension, Facebook Pixel Helper.

Go to the demo version of your game and click the Pixel Helper icon in your browser to see if the right events are executed on the relevant pages.

In my quiz, I checked the pages and found that all events were executed correctly. The more steps I went through, the more events were executed. 

Create Custom Conversions

Now, you must tell Facebook to track these exact conversions. 

Go to Ads Manager, choose Custom Conversions in the menu and click “Create Custom Conversion”. 

In the pop-up, choose “event” and pick the first conversion, you want to create. 

Name it – and repeat until you have created all events as custom conversions within your Ad Account:

Create the campaign

As soon as you have set up all the technical stuff, you are ready to create a campaign in Ads Manager or Power Editor. 

On the campaign level, choose “Conversions” as the objective:

On the Ad Set level, choose the conversion, you want to optimize for:

In my case, I want people to complete the quiz and therefore choose Quiz Completed.

You should choose the conversion that reflects the success of the campaign. If the success for your campaign is registrations/newsletter signups, you should choose optimize for registration events instead.

Set up the campaign as usual via Facebooks Ads Manager or Power Editor. Because of the conversion set-up, Facebook will automatically make sure to reach the segment of your audience that is most likely to convert. The result is … well … better results!

Better reporting

As a result of the custom conversion setup, you can easily see the results of your campaign in Facebooks Ads Manager:

The standard reporting template will show you the amount of conversions the ad spend has resulted in – and thus the price per conversions.

As you can see, the price for a Quiz Completion is only DKK 8,82 in my fairly advanced Facebook Advertising Quiz! 

The more custom conversions you have created, the more data will be visible in your report. To see data from your secondary custom conversions, click the “Columns” dropdown and choose “Custom Report”. 

Click “Website” in the left menu and choose the data that you want to include in your report:

When you apply these settings, a report with a great overview of the relevant data appears. 

As you can see, more than half of the people who started the quiz didn’t complete it. In my case, this is good because otherwise it would have meant the quiz was too easy.

Also, I can see that only 20% of the participants signed up for our newsletter after participating in the quiz. This number is a bit lower than expected, so I could make an effort to communicate the advantages of our newsletter better in a future campaign. 

This quiz was just a demo that I created for this blog post, but as you can see, optimizing for conversions on Facebook results in a low cost per participant. This is true even for an advanced Facebook advertising quiz made for fun - and with very little effort - by a social media agency.