How to Setup Snapchat Pixel Tracking on Shopify
Learn how to setup your sitewide pixel tracking with custom events and email variables on your Shopify store.
Snapchat is growing in popularity to try and prospect new audiences which isn’t a big surprise given the potential size in audience compared to Facebook, Instagram, Twitter, and others.
Take a look at this chart put together by MarketingLand that shows the total addressable audience comparison for all pages:
So if you are marketing to a younger demographic (under 34 years old) then Snapchat might be a good channel to try for yourself.
But before you can do this, you will need to implement Snapchat event tracking on your Shopify store just like you would with Facebook, Adwords, etc.
I’ll show you how to do this via Google Tag Manager so you are free to update and modify your theme moving forward without having to worry about pixels breaking or being deleted!
Implement Snapchat Pixel on Shopify
Step 1: Create Email Variable on Shopify
This can be done one of two ways:
Option a) If you don’t currently have a custom GTM dataLayer implemented on your store then copy this script at the bottom of your theme.liquid file, just above the closing </body> tag:
Then you need to create a variable in Google Tag Manager that looks like this:
Make sure you set this up exactly the way it looks above (case sensitive).
(COMING SOON!) Option b) Implement our GTM App for Shopify which automagically adds the customer email variable (among many others) to your Shopify store
We know how difficult it is to think about all potential dataLayer variables needed in GTM so we’ve built an app to fix this for you! We’re testing with a few stores right now before we release to publish but feel free to chat us if you’re interested in this automated step.
Step 2: Install Snapchat Sitewide Script into GTM Tag
This step requires you to log in to your Snapchat Ads Manager > Go to Snap Pixel > Set Up Pixel
You should see something like this below which you have to click to copy:
Then you will need to head over to Google Tag Manager > Tags > Create New Tag > Custom HTML Tag > Paste your script you just copied from Snapchat:
You’ll notice the red arrow is pointing to the email variable within the script that you will need to modify and update to be your email variable created in Step 1.
IMPORTANT: When setting your trigger, do not just use the built-in All Pages trigger from GTM. You will need to create a new All Pages trigger that fires on DOM Ready like this:
Step 3: Install Snapchat Conversion Pixel via Shopify Thank You Page Scripts
This next step implements the Snapchat Conversion Pixel Event for tracking purchases. You can use the script below to copy into your Shopify Store > Settings > Checkout > Additional Scripts
You will need to update the bolded ID section below to match your own Snapchat pixel ID from your Ad center settings.
Step 4: Install Snapchat Add to Cart and Initiate Checkout Events via GTM Tags
The last step is optional but will be good for you to track performance higher up in your funnel besides purchases.
We’ll use the Add to Cart event as provided by Snapchat as an example and the same can be applied to Initiate Checkouts as well.
- First you’ll need to be sure you have a custom trigger in GTM that is for Add to Cart events on your store. If you need help creating this trigger, read my guide on how to create custom triggers in GTM here.
- Copy the add to cart event (shown below)
- Update the bolded pixel ID with your own pixel ID
You can copy this step for any other custom event that you want to track. Once you preview and publish your new tags you are good to go!
Your final GTM updates ready to publish should look something like this:
Happy Snapchatting marketing 🙂
If you found this helpful then please sign up for our emails where we share more helpful guides for Shopify and making $$ with your store!