How To Set A Conversion Tag With The Facebook Pixel In Code

by | Mar 7, 2018 | Blog, How To

What is the Facebook Pixel?

It can be recognized as an analytical tool that helps you with your advertising campaigns on Facebook. The idea behind Facebook Pixel is to create a way for the business to understand the actions people take on their websites.

What is Facebook Pixel used for?

  • Make sure your ads are being shown to the right people
  • Build advertising audiences
  • Unlock additional Facebook advertising tools

Benefits of using Facebook Pixel

Facebook Pixel collects data that can be used in a several ways to refine your advertising strategy.

Here are couple of the benefits of using Facebook Pixel:

  • Reach the right people

    Find new customers, or people who have visited a specific page or taken a desired action on your website. Plus, create Lookalike Audiences to reach more people who are similar to your best customers.

  • Drive more sales

    Set up automatic bidding to target people who are more likely to take an action you care about, like making a purchase.

  • Measure the results of your ads

    Understand how successful your ad is by seeing what happened as a direct result. You can view information like your conversions and sales.

Using Facebook Pixel

What do you need?

Before we begin creating the Facebook Pixel code and it's implementation it's very important to mention what you need:

  • a website for your business
  • access to the code of your website with ability and permission to edit it

Creating a Facebook Pixel

  1. Go to your Pixels tab in Events Manager.
  2. Click Create a Pixel.
  3. Click Create in the box that appears to finish creating your pixel.

Adding Facebook Pixel to your website

After creating your Facebook Pixel, next thing would be implementation of the code on your website. We will cover 3 situation in this article:

  1. Someone else makes changes to my website:
    1. Go to the Pixels tab in Ads Manager.
    2. Click Set Up Pixel
    3. Click Email Instructions to a Developer.

    4. Enter the recipient’s email address.
    5. Click Send at the bottom of the page.
  2. I update my website's code
    1. Locate the header code for your website
      Go to your website's code and find the header of your website.
    2. Copy the entire code and paste it in the header of your website
      Paste the code at the bottom of the header section, just above the closing head tag.
    3. Check that your code's working correctly
      Click Send Test Traffic after placing the code on your website to make sure your pixel's working properly. If your status says "Active", your base code has been installed correctly. This can take several minutes to update.
  3. If your website uses some of the most famous website platforms like WooCommerce, Shopify, Wix, Squarespace, BigCommerce, Magento or Weebly then there is either plugin or addon implementation that you can explore and learn more about.

Track the most important actions and conversions

Now after you have set everything up you are ready to do some tracking and see what people are actually doing on your website.

Events are actions that happen on your website (like when someone makes a purchase). To track an event, you'll need to place a piece of code on your website to help Facebook understand that someone has taken an action.

How to setup events on your website?

  1. Go to the Pixels tab in Events Manager.
  2. Click Set Up Pixel.
  3. Click Manually Install the Code Yourself.
  4. Click Continue.
  5. Click Install Events.
  6. Click the toggle icon next to an event you'd like to track.
  7. Select Track Event on Page Load or Track Event on Inline Action.

    1. Track Event on Page Load: Choose this option if the action you care about can be tracked when someone lands on a certain page, like a confirmation page after completing a purchase.
    2. Track Event on Inline Action: Choose this option if the action you want to track requires someone to click something (like an add to cart or purchase button).
  8. Add event parameters, like Conversion Value or Currency, to measure additional information about your event (Recommended)
  9. Copy this event code and paste it on the relevant page of your site. Be sure not to modify the pixel code you've already placed in the header of your website.
    1. For page load events: place the code just below the closing header section of the page (for many websites, this will be right after the opening <body> tag).
    2. For inline action events: add the event code between script tags next to the action you want to track (like a button).

If you want to track events not listed here, then see how to use custom events. Unlike the events featured above, custom events can't be used for tracking and optimization without additional action.

If you would want your Facebook pixel to activate on specific button clicks, you'll have to update the code to tie an event to an action.

Participating in local events is a great way to get…