Facebook data sharing

The Data sharing settings in your Facebook channel lets you choose how customer data and activity is collected in your online store. Data sharing tools, such as the Facebook pixel, let you track orders and other events, which can help you analyze your store traffic and improve ad targeting through dynamic ads.

Data sharing is a choice. While customer data improves campaign performance and sales tracking, not everyone wants their data shared. It's important to tell your customers how you share data, and to decide what type of data, or how much data, you want to track and share. Make sure that your privacy policy is up to date to provide this information to your customers.

For more information on data sharing, refer to Cookies and customer tracking.

Before you begin

To add a Facebook pixel to your online store using the Facebook channel, you need to have a Facebook ads account that has associated ad spend. To create a Facebook ads account, go to Facebook. You can set up your Facebook pixel using Facebook Ads Manager, or create one using the Facebook channel.

If you've added a Facebook pixel to your online store theme code before, then you can remove the Facebook pixel code from your online store after you set up your new pixel using the Facebook channel.

Change or remove a Facebook pixel code from your online store

If you have a pre-existing Facebook pixel ID added to the Facebook channel, then you can replace it in the Data sharing settings of the Facebook channel by clicking Disconnect.

If you've edited your theme file code to add a Facebook pixel, then you need to remove the pixel code before you can add a Facebook pixel ID using the Facebook channel. If you don't remove the pixel code, then your store will have more than one pixel on it, which can result in duplicate or incorrect data in your reports.

Remove pixel code from your theme file

  1. In the Current theme section, click Actions, and select Edit code.
  2. Click the theme.liquid file to open the code editor.
  3. Delete the Facebook pixel code. You can find it between the <head> and </head> tags.
  4. Click Save.

Remove your Facebook pixel in your Online Store preferences

  1. In your Shopify admin, click Online Store > Preferences.
  2. In the Facebook pixel section, click Change.
  3. Delete the Facebook pixel, and then click Save.

Creating a Facebook pixel

You can create a new Facebook pixel directly in the Facebook channel by clicking Create new in the pixel set up box. or you can create a Facebook pixel in Facebook Ads Manager. To create a pixel in Facebook Ads Manager, refer to the Facebook Help Center.

Add a Facebook pixel to the Facebook channel

When you add a Facebook pixel to your Facebook channel, the pixel integrates with your Online Store. A Facebook pixel can be added when you're setting up Instagram, Shops, or Facebook Marketing, but it's required only for the Facebook Marketing feature. Before you can add a Facebook pixel, you need to enable tracking in the Customer tracking section.

You can manage your Facebook pixel in the Data sharing settings within the Settings section of the Facebook channel.

In the Customer tracking section of your Data sharing settings in the Facebook channel, there's a list of pixels that you have created. Click Connect to connect a preexisting Facebook pixel or click Create new to create a new Facebook pixel.

After you add a Facebook pixel to your online store, make sure that it's working by using Facebook Ads Manager. Learn about how to tell if your Facebook pixel is working from the Facebook Help Center.

Before you add a Facebook pixel

Before you can add a Facebook pixel to your store, you need to set up a Facebook account and a Facebook Business Manager. If you have those already, then complete the steps in Add a Facebook pixel. If you don't have those set up, then complete the following.

Steps:

  1. Click Get Started in the Get started with Facebook section.
  2. Click Start setup in the Market your products on Facebook section.
  3. Connect your Facebook account, Business manager, Facebook page and Ad account.

Add a Facebook pixel

  1. In your Shopify admin, click Facebook in the Sales channels section.
  2. Click Settings, and then click Data sharing settings.
  3. In the Customer tracking section, click the Enable tracking toggle.
  4. In the Choose tracking level section select Standard, Enhanced, or Maximum.
  5. Select your pixel from the list.
  6. Click Confirm.

Choosing Facebook's customer tracking level

The Facebook channel lets you choose how you want data to be collected and shared between your online store and Facebook. In the customer tracking settings you have three options to choose from: Standard, Enhanced, or Maximum. For more information about customer tracking, refer to our Cookies and customer tracking documentation.

If you select Standard, then a Facebook pixel tracks customer browsing behavior in your online store. A browser-based ad blocker can prevent the Facebook pixel from tracking data.

If you select Enhanced, then a Facebook pixel tracks the personal information of your customers using Advanced Matching. Advanced Matching lets a Facebook pixel extract your customer's name, location, email address, and phone number, as well as their browsing behavior in your online store to improve customer tracking. Browser-based ad blockers can prevent the Facebook pixel from tracking data. For more information on Advanced Matching, refer to Facebook's documentation about Advanced Matching for Web.

If you select Maximum, then your store uses Facebook's Conversions API as well as the Facebook pixel. Data is shared using the customer's web browser and from Shopify's servers, and is sent directly to Facebook's servers. Data sent from server to server can't be blocked by browser-based ad blockers. The Maximum setting shares your customer's personal information to match users on Facebook's network. The information collected using this setting includes your customer's name, location, email address, and phone number, as well as their browsing behavior in your online store. For more information, refer to Facebook's documentation about Conversions API.

Customer tracking standard events

After you add a Facebook pixel in Shopify, the pixel tracks certain events on your online store, such as when a customer views a certain page. The events Facebook tracks by default are called standard events, and you can use the data from these events to learn more about how customers interact with your store. Learn more about using Facebook pixel standard events to create campaigns and track conversions at the Facebook Help Center.

Events that track an order value use an order's subtotal, which doesn't include taxes or shipping costs.

After you integrate a Facebook pixel with your online store, the pixel automatically tracks the following standard events.

Facebook pixel standard event descriptions
Event name Event description
ViewContent When a visitor views a page, such as a product page
Search When a visitor makes a search
AddToCart When a visitor adds a product to the shopping cart
InitiateCheckout When a visitor clicks the checkout button
AddPaymentInfo When a visitor enters payment information in the checkout
Purchase When a customer completes a purchase and views the thank you page in the checkout

Tracking customer data using Facebook's CAPI

Facebook's Conversions API (CAPI) is a way of sharing your customers' browsing behaviour with Facebook from Shopify's servers directly to Facebook's servers. Facebook pixels send data using your customer's web browser. CAPI works with your Facebook pixel to help you measure, optimize, and build Facebook ad campaigns.

Ready to start selling with Shopify?

Try it free