Facebook Pixel integration for Consentmo GDPR app
How it works
Our app deletes the Facebook Pixel cookies when the page loads. However, those cookies are then created by Facebook again on the next page load. Because of that, we are removing the cookies on every refresh. With that said, when a customer visits a page, a small bit of information is sent to Facebook Pixel.
We are using this method because Shopify's limitations prevent us from getting the tracking codes for each store.
When the initial state is set to block the Analytics and Marketing cookie groups or the customer opts out, the script that is setting the Facebook Pixel will not be executed.
NOTE: The below integration is only applicable if the service is added via a script placed in the theme files of the store. If the integration for the service is done through any other channel or service, please check the Help Center for the relevant integration as per your case: Social Media Pixels integration for Consentmo GDPR app
Integration Steps
Open Shopify Admin.
Click on Online Store link in the left menubar.
Click on the Actions dropdown button and select Edit Code from there.
A new page will open with a list of files on the left side of the screen.
Create a new liquid file in the Snippets section of the theme files, called facebook-pixel-integration-script
After that copy the content of the integration script provided below and paste it in the newly created Snippet file:
Download Facebook Pixel integration script
Locate the original Facebook Pixel script and do the following:
Step 1. Copy the content of the Facebook Pixel script and paste it under the line “// The content of Facebook Pixel script goes here” in the integration script again
Step 2. Comment out or delete the original Facebook Pixel scripts and save the changes.
Open the theme.liquid file.
Locate the opening <head> tag and after it, add the following line of code:
<!-- Facebook Pixel integration script Consentmo -->
{% render 'facebook-pixel-integration-script' %}
A reference on the process can also be checked here:
NOTE: Make sure to remove the added code before deleting the app. This way, no snippets of code will be left in your theme. For more information on what you should be aware of when deleting our app check this article of our FAQ page.
Need help?
In case you need any assistance, please make sure to reach out to our support team via live chat or at support@consentmo.com
Updated on: 01/01/2025
Thank you!