How To: Configure Consent for Facebook in Shopify

A step-by-step technical guide for managing Facebook pixels in Shopify

In order to manage pixels in Shopify, such as Facebook for advertising, you will need to install the Ethyca Consent Javascript Tag to ensure consent is appropriately configured.

The Ethyca Consent Javascript Tag is a javascript code snippet hosted by Ethyca that will show up in the header of your website as "emp-shopify.js". This will be added to your liquid theme templates to ensure that consent for Facebook is managed appropriately. This will be added directly to your themes as Shopify does not provide a method to correctly set consent through existing API's for Facebook's pixel.

Configuring Consent for Facebook's Advertising Pixel in Shopify

In order to setup the emp-shopify.js pixel, please navigate to the Themes section of your Shopify storefront admin panel.

From here, select to Customize your current theme as shown in the image below:

12681268

Now click on the ellipsis beside Theme Actions and select "Edit Code" from the pop up menu.

12431243

From here, you will need to edit the theme.liquid and checkout.liquid template files.

10691069

For each template page, locate the opening <head> tag and directly beneath this, paste in the Ethyca Management Pixel:

<!-- Ethyca Management Platform -->  
    <script language="javascript" type="text/javascript" src="https://harpocrates.ethyca.com/emp-shopify.js"></script>  
<!-- Ethyca Management Platform -->

As shown in the screenshot below, this should be located beneath the <head> to ensure that it's loaded as early in the page sequence as possible to manage other events on the site such as the Facebook pixel.

14531453

Save both of your template pages and you're all set.

Testing with Facebook Pixel Helper

In order to test, you'll need to download the Facebook Pixel Helper widget in Chrome to see if the dpo parameter is displayed. If dpo: shows inside your pageview event, then your shopify-emp.js tag is correctly configured.

395395

For a more detailed instruction guide, check out our support article on how to end to end test Facebook Limited Data Use.

Support

Please contact [email protected] if you require any technical assistance or troubleshooting support.