Facebook Pixel
Facebook pixel lets you track your store visitors, giving you a lot of data about your customer's behavior. You can use that data to more effectively plan your ad campaigns to get even more customers. Installation takes a couple of minutes, with no technical skills whatsoever.
Understanding the Facebook pixel
The Facebook pixel is an analytics tool that helps you understand actions customers take on your website/store. The pixel will “know” when your store visitors:
- view products and categories
- search products
- add items to the shopping cart
- enter the checkout flow
- start the checkout
- complete the checkout, etc.
Later this data allows you to:
- Retarget your visitors with ads on Facebook, Instagram, and Audience Network. For example, you can find people who have visited a specific page or taken the desired action in your store and then offer these customers a 15% off coupon through a targeted Facebook ad to spur conversions. Also, the pixel can help you advertise to people similar to your existing customers.
- Measure conversions and sales so that you know exactly how your ads are performing.
- Set up Dynamic Ads to automatically promote multiple products or your entire product catalog on Facebook, across all devices.
Verifying your domain on Facebook
After Apple iOS 14 privacy policy updates, Facebook created new algorithms to optimize ad campaigns for iOS 14 users. Now, you have to verify the ownership of your domain so you can create conversion events. For example, you need to verify your domain to create retargeting campaigns.
Once you verify your domain, you can create and manage up to 8 conversion events that can be used for campaign optimization. You can learn more about how Apple iOS 14 release may affect your ads.
If you use Instant Site, you can verify your store for Facebook, but you won’t be able to create Facebook ads conversion campaigns. Still, you can create other types of Facebook ad formats. To create conversion-focused events for your Facebook ads, you should first connect your own domain to your Instant site, and then verify it.
To verify domain on Facebook:
- From your Facebook Business Manager, go to Settings → More Business Settings → Brand Safety → Domains.
- Click Add New Domains.
- Type the address of your site and click Add Domain. The domain will be added to your assets.
- Click on the domain you want to verify and choose one of the three domain verification methods:
- Add a meta tag to your domain's home page (recommended).
- Upload an HTML file to your web directory and confirm ownership of your domain in Business Manager.
- Add a DNS TXT entry to your DNS record to confirm ownership of your domain.
- Follow the Facebook wizard to complete the verification.
(for Instant Site users) To add meta tag to your home page from your Store admin, go to Website → SEO. In the Header meta tags and site verification block, click Add code and paste the code you copied from Facebook.
For more details, watch a quick video about verifying a domain on Facebook.
After verifying the domain, you can create and install the Facebook pixel to your store. You can also configure and prioritize your top 8 events on your domain. You can learn more about configuring events in Facebook Help Center →
Installing the Facebook pixel to your store
The installation is easy for everyone regardless of technical skills. First, you need to generate your Pixel ID in the Ads Manager, the Facebook service where you can view, check and change your Facebook ad campaigns. Then you need to add the pixel to your store admin.
To create and install the Facebook pixel to your store:
- Open your Facebook Ads Manager.
- Click on the Business Tools icon in the left panel and choose Events Manager.
- Click the Connect a new Data Source button.
- In the popup window, hit Web and click Get Started:
- In the Set up Web Events window, select Facebook Pixel and click Connect:
- Enter the name of the pixel and the URL of your store in the appropriate fields and click Continue.
- You’ve created the Facebook pixel. The next step is to add it to your store. In the Choose how you want to install your pixel code window click the Install code manually button.
- Copy the code.
- Open your store admin page and go to Settings → General → Tracking & Analytics.
- In the Facebook pixel field, paste the base code and click Save.
- Return to the Facebook page and click Continue.
- Optional: Toggle on Automatic Advanced Matching and verify the customer information you want to send. Click Continue.
- Add events.
To add events by using the Event Setup Tool, click Launch Event Setup Tool to add events and parameters without additional coding. Follow the onscreen instructions to add events to your website.
To add events manually, visit Facebook for Developers to learn how to set up pixel events using code.
Done! Now you have created and added the Facebook pixel to your store.
Facebook pixel standard events
After you’ve added a Facebook pixel in store, the pixel start counting actions that happen on your online store as events. You can use event data to create personalized ads for your customers.
The following events will be sent from store to Facebook:
- ViewContent: for each time a customer visits your product or category pages.
- Search: for each time a customer uses the search box to find products.
- AddToCart: for each time a customer adds products to the shopping cart without finishing the purchase or clicks "Buy now" button on single product page.
- InitiateCheckout: for each time a customer visits the checkout page.
- AddPaymentInfo: for each time a customer enters payment information in the checkout.
- Purchase: for each time a customer completes a purchase and views the thank you page in the checkout.
Learn more about using Facebook pixel standard events to create campaigns and track conversions at the Facebook Help Center.
Removing Facebook pixel code from your website
If you've used a Facebook pixel with your website before embed online store into it, you might need to remove its code before adding a new pixel. Adding a second Facebook pixel to your online store and the website could cause duplicate or incorrect data in your reports.
As a website owner, deleting a pixel from your site is as easy as removing the code from your site by deleting the code implemented in your header. If you used the injection method to place the code in your site through services like Squarespace and other platforms, it’s also possible to delete the code using that tool. Facebook’s guide specifically uses Squarespace as a reference guide for deleting the pixel from your injected code, but it should also be similar for most online site platforms.
Removing Facebook pixel code from your store
You can remove the existing pixel code from your online store:
- From your store admin, go to Settings → General → Tracking & Analytics.
- Remove your Facebook pixel ID from the Pixel ID field.
- Save changes.
If you've used a Facebook pixel with your store in the past, you might need to remove its code before adding a new pixel, otherwise it may result in duplicated or partial data. From your store admin, go to Settings → General → Cart & Checkout and remove the Facebook pixel codes, if you have any, from the section Custom tracking code on Order Confirmation page:
Next steps
As an e-commerce store owner, you’ll mostly use Facebook Pixel for retargeting (to advertise to people who have visited a specific page or taken the desired action in your store) and conversion tracking (to measure conversions and sales so that you know exactly how your ads are performing and let Facebook optimize your ads for you).
As a merchant with connected Facebook Shop, you can set up Facebook ads yourself using Product Catalog feature.
Related articles
Selling on Facebook
Tagging products on Instagram
Ads campaign on Facebook