Using Facebook pixel with Squarespace

30/11/2019

If you're using Squarespace for your website and want to install the Facebook pixel, follow these steps:

In this article

Get your Facebook pixel code

If you haven't created a Facebook pixel yet
  1. Go to the Facebook pixel section in Ads Manager.
  2. Click Create a pixel.
  3. Enter a name for your pixel. You can only have one pixel per ad account, so choose a name that represents your business.
  4. Tick the box to accept the terms.
  5. Click Create pixel.
  6. (Optional) Click the toggle icon to enable Advanced matching.
  7. Click anywhere on the Facebook pixel code to copy it.
If you've already created a Facebook pixel
  1. Go to the Facebook pixel section in Ads Manager.
  2. Click Set Up Pixel.
  3. Click Copy and paste the code.
  4. (Optional) Click the toggle icon to enable Advanced matching.
  5. Click anywhere on the Facebook pixel code to copy it.

Add the Facebook pixel to your website

  1. Log in to Squarespace.
  2. Select your site.
  3. In the Home menu, click Settings.
  4. Click Advanced.
  5. Click Code injection.
  6. Paste your Facebook pixel code in the Header box.
  7. (Optional) Type in em: '{customerEmailAddress}' on line nine to leverage your customer email address data to help you optimise for conversions.
  8. Click Save in the upper left-hand corner.

Track events happening on your site

Once you've created a Facebook pixel and installed it on your site, you'll get access to richer audience targeting and measurement options by placing event code on key pages of your website.

  • Create new audiences based on actions people took on your site. For example, you can create an audience with people who visited your shop page but didn't convert, and then set up a Facebook remarketing campaign.
  • Find potential customers similar to people who have taken actions you care about on your site, like making a purchase, by creating a Lookalike Audience based on people who completed purchase events.

Getting started

Add event code to your site to track actions you care about, like page visits, purchases and how many items people add to their baskets.

Track page visits of people who've visited your Shop page
  1. Go to the pixels tab in Ads Manager
  2. Click Set up pixel
  3. Click Copy and paste the code
  4. Click Install event code
  5. Click View content and click to copy the view content code.
  6. Log in to Squarespace.
  7. Select your site.
  8. In the Home menu, click Settings.
  9. Click Advanced.
  10. Click Code injection.
  11. Paste your view content code in the footer section to be able to track visits to each page of your website.
  12. Click Save in the upper left-hand corner.

Note: The value represents an estimate of what a visit to your page is worth. For example, if your average order size is £100 and, based on your site's history, two out of every one hundred visitor converts, then the value of a page visit is £2.

Track purchases people make on your site
  1. Go to the pixels tab in Ads Manager
  2. Click Set up pixel
  3. Click Copy and paste the code
  4. Click Install event code
  5. Select Purchase and click to copy the purchase code.
  6. Log in to Squarespace.
  7. Select your site.
  8. In the Home menu, click Settings.
  9. Click Advanced.
  10. Click Code injection.
  11. Paste the code from step 5 in to the Order confirmation page section.
  12. Change the text after "value" in your code to "{OrderGrandTotal}". For example, in the image above, we deleted the dollar amount value of "247.35" from the code and typed in "{OrderGrandTotal}" instead. Making this change will help you best track the actual value of purchases that customers make on your site as a result of your Facebook ads.
  13. Click Save in the upper left-hand corner.
Track how many items people add to basket
  1. Go to the Custom conversions section in Ads Manager.
  2. Click Create custom conversions
  3. Type in the URL that appears when people click to add an item to their basket on your website.
  4. Click Choose a category.
  5. Select Add to basket.
  6. Name your event. Use a descriptive name so you'll be able to keep track of this event in case you plan to make more conversion events. You can also click to add a description for your event.
  7. Tick the box if you'd like to set a conversion value (how much it's worth to you when someone adds an item to their basket). For example, if your average order amount is £100 and, in general, three out of every ten times an item is added to a basket results in a purchase, then you might say the conversion value for someone adding an item to their basket is £30 . Next, you have the option to set a conversion value.
  8. Click Create to finish setting up your custom conversion.

Check if your pixel is working

Once you've clicked Save/Publish at the top of your Tealium dashboard, you should check if your pixel is firing correctly. To check that your pixel is working properly:

  1. Navigate to the web page that the pixel was placed on. If it's working, the pixel will send information back to Facebook and you'll be able to see activity on the Facebook pixel page in your Ads Manager. Your pixel's status will also be set to Active. Bear in mind that the activity column reports all conversion events regardless of whether or not these events are associated with an ad.
  2. If it didn't work (No activity yet, No recent activity), use the Facebook Pixel Helper to troubleshoot the problem. Bear in mind that you have to be using the Chrome browser for it to work. Once the Pixel Helper has been installed, a small icon will appear next to your address bar. Navigate to your website in your Chrome browser and click the Pixel Helper icon.
  3. The pop-up will tell you which pixels were found on the page and whether they have loaded successfully. If not, it will give you tips on why it may have failed. Learn more.

You can now start running ads on Facebook using conversion optimisation and tracking.

* Nguồn: Facebook