How to Add Your Facebook Pixel

How to Add Your Facebook Pixel

This article will guide you through setting up your Facebook Pixel on Magento 2.

This article will cover how to add the Facebook Pixel to all pages and to the order success page for conversions.

Step 1: Adding Facebook Pixel to All Pages

  1. In the Magento Admin Panel, go to to Content > Design > Configuration
    41812258.png
  2. In the configuration record corresponding to your store view, click Edit.
  3. Go to Other Settings > HTML Head > Scripts and Style Sheets.
    Scripts.png
  4. Copy and paste the Facebook Pixel into the area next to Scripts and Style Sheets.
  5. In the upper right hand corner, press Save Configuration.
  6. Clear cache.

Step 2: Setting Up Facebook Pixel on Order Success Page

  1. Login to your Magento Admin Panel.
  2. Go toContent>Blocks.
    1. 41812256.png
  3. This will bring you to the Blocks page. Click onAdd New Block:
    1. 41812255.png
  4. You should now be on the following page:
    1. 41812254.png
      1. Enable Block- Leave this setting as Yes
      2. Block Title- Enter "Facebook Pixel"
      3. Identifier- Enter facebook_pixel
      4. Store View- By default, this should be selected as All Store Views. If it is not, click All Store Views.
      5. Text Area- Add the pixel here.
  5. Once you have configured the settings in Step 4, press Save in the upper right hand corner.

Step 2: Creating the Widget

  1. Go to Content> Widgets.
    1. 41812253.png
  2. Click Add Widget.
    1. 41812252.png
  3. Change the Type to CMS Static Block.
    1. 41812250.png
  4. Change Design Theme to Smartwave Porto CPC.
    1. 41812249.png
  5. Press Continue
  6. You should now see the following form:
    1. 41812248.png
      1. Set the Widget Title to Facebook Pixel.
      2. Next to Assign to Store Views, click All Store Views.
      3. You can leave Sort Order blank.
  7. Click Add Layout Update.
    1. Change Display On to Specified Page.
      1. 41812247.png
    2. Change Page to One Page Checkout Success.
  8. Set Container to Main Content Top. 
    1. 41812245.png
  9. On the left under Widget, click Widget Options.
    1. 41812243.png
  10. Click Select Block.
    1. 41812242.png
  11. Choose the block with the ID facbook_pixel.
  12. Press Save.


    • Related Articles

    • How to add HTML Code to Pages

      This article covers how to add HTML code that works in the header of all pages of the store's website. This feature is useful for many things, including adding scripts and links for targeting pixels, campaigns, branding, and more. Navigation 1. Log ...
    • How to Add a Brand

      This tutorial will require the shop by brands add on. This allows customers to shop by a specific attribute in your store. It can let customer shop by the brands offered in your store, but also allows you to select something else to sort by. If you ...
    • How to Add Category Information

      This article will guide you through the steps of adding category information to the website. Step-by-step guide Go to Catalog → Categories and select the category you would like to edit. Once a category has been synced from Counterpoint, you can ...
    • How to Add/Modify Homepage Slideshow - Porto

      This article covers the basics of adding and modifying the slide contents on your homepage. Please note that this tutorial only applies to Porto Themes actively installed. Your slider(s) on the homepage is powered by a JQuery plugin calledOWL ...
    • How to Add a Sale to yourWebsite

      This article will cover the two options you can add new Sales/Discounts to your website. Shopping Cart Price Rules: These are discounts that get applied after the products have been added to the cart. Things like coupon code, free shipping, discounts ...