Creating custom audience based on Facebook Pixel

Pixel is a few lines of code from Facebook that you copy into the header section of your website. The basic code is able to track all activity on the website. This way Pixel receives information about the actions taken on your website and lets you make your Facebook ads more relevant to your audience and more personalized.

This article contains instructons on how to:

  • Generate the Pixel and adjust it so the Synerise can send data to Facebook
  • Prepare a dynamic content campaign that uses the Pixel
  • Create a Facebook Audience based on segments of users who visit your website

Procedure

Prepare the Pixel


  1. Log in to your Facebook advertising account.

  2. Generate the Facebook pixel.

  3. Open a notepad.

  4. From the generated pixel copy the part between <script> and </script> tags (example below).

            
        !function(f,b,e,v,n,t,s)
        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
        n.callMethod.apply(n,arguments):n.queue.push(arguments)};
        if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
        n.queue=[];t=b.createElement(e);t.async=!0;
        t.src=v;s=b.getElementsByTagName(e)[0];
        s.parentNode.insertBefore(t,s)}(window, document,'script',
        'https://connect.facebook.net/en_US/fbevents.js');
        fbq('init', 'XXXXXXXXXXXXXXXX');
        fbq('track', 'PageView');
        
    
  5. Paste it to the notepad.

  6. Add custom event tracking (additional lines) to Pixel, which will send custom events:

    • event-synerise is an event sent to Facebook and based on this event you can build a custom audience on your advertising account (this is an exemplary name, replace it with your event name).
    • sampleParams: "sampleValue" is an additional parameter of such event (replace it with a proper event parameter and value).
    • 3000 is the delay in milliseconds after which the event is sent.
        setTimeout(function(){
        fbq('trackCustom', 'event-synerise', {sampleParam: "sampleValue"});
        SR.event.trackCustomEvent('facebook.', {},     'Facebook');
        }, 3000); 
        
    

    More info available in the Facebook documentation

  7. Save the file. You will use it later in a dynamic content campaign.

Create a campaign with Pixel


The dynamic content campaign uses a Pixel prepared in previous steps and sends the data to Facebook.

  1. Go to Campaign icon Campaigns > Dynamic content > Create campaign > Content.

    The dynamic content campaign settings
    The dynamic content campaign settings
Tip: The detailed instruction on creating a dynamic content campaign is available at the link.
  1. As the campaign type, select Insert object.
  2. In the Audience section, to select the recipients of the campaign, click Define. Choose the segment of users who will receive the Facebook Pixel campaign and who will be sent to Facebook Audience.
    Tip: You can select the segment to whom the advertisement will be shown (for example, those who visited the website in the last 7 days and abandoned a cart).
  3. In the Content section, define the content of the campaign.
    1. In the CSS selector field, select After (in div) and type .snrs-modal-wrapper.
  4. Click Create message.
  5. In the window that opens, click Code editor.
  6. In the code editor, in the JS field, paste the script prepared here.
  7. Save the template.
  8. Approve the template or send it for approval.
  9. In the Schedule section, schedule your campaign immediately or at a specific time.
  10. In the Display settings section define how often and where (on which URL) your Pixel is activated.
  11. Skip the URL parameter section.
  12. If the campaign is ready, to launch it, click Activate.
Tip: The Pixel used in each campaign must be unique. This means that it cannot be used in any other action.

Check the Pixel status


  1. Log in to Facebook.
  2. Go to Ad Manager and in the top menu, select Pixels.
    • If the status is active, the Pixel has been installed correctly. The Pixel may take up to 20 minutes to become active.
    • If the Pixel status is set to No action has been recorded yet, it means that the Pixel does not work.
      Download the Pixel Helper tool and for more information check this link.
Important: Remember that pixel starts working after 24 hours from its first implementation.

Create Custom Audience


  1. Log in to Facebook.
  2. Create a Custom Audience campaign.
    1. Select a group of recipients based on the pixel, the pixel name is available on the drop down list
    2. Specify the place where you want to display the ad
    3. Determine the budget
    4. Select the format
    5. Place the order
    6. Measure effectiveness
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.