An essential part of implementing Meta ads is setting up your Meta pixel with key events like purchase and add to cart. Tracking these events on your Shopify storefront will help your marketing team not only understand and troubleshoot customer behaviour but it will also provide useful feedback on which Meta ads are converting for your business.
Setting up the meta pixel for events tracking requires several procedures, but this guide will walk you through each of them, step-by-step.
How to set up the Meta pixel with events:
Step 1
Log into https://business.facebook.com/ with your credentials to access your Meta Business Suite.
Step 2
In the bottom left corner, click the gear icon to open your Business Settings.
Step 3
On the left-hand side, under "Data sources," click "Pixels".
Step 4
Click on "Add".
Step 5
Give your pixel a name and add your website, then click "Continue".
Step 6
Select "Set up the pixel now".
Step 7
Select "Add code using a partner integration".
Step 8
Select “Shopify”.
Step 9
You will see this window. You are asked to connect your Shopify store to your Facebook account. Keep this window open because you’ll come back to it later.
Step 10
Go to your Shopify store. Click “Online Store” on the left-hand side.
Step 11
Click “Preferences”.
Step 12
Scroll down until you see “Facebook Pixel,” then click “Set up Facebook”.
Step 13
Click the green button, “Add sales channel”.
Step 14
Click the green button, “Connect account”.
Step 15
Select the account that you want to connect to.
Step 16
Select the business manager associated with your pixel, then click “Connect”.
Step 17
Select “Maximum” for preference, then click “Save”.
Step 18
Connect to the pixel you just created.
Step 19
Check the box to agree to Facebook’s terms and conditions.
Step 20
Click “Submit for review”.
Step 21
You are now able to run ads on Facebook and Instagram!
Step 22
Return to the window you left open. Check off “I’ve completed the set up on Shopify,” then hit “Next”.
Step 23
Paste your website URL into the textbox to check if it’s working. Click “Send test traffic”.
Step 24
Wait until you see “Active”. This process may take up to 30 minutes. Once the status indicator is active, click “Next”.
Step 25
Click “Finish”.
Step 26
Once you have your pixel set up, add yourself to the pixel. Click "People," then click "Add people".
Step 27
Select yourself and/or anyone on your account who needs full access to your pixel. Click "Manage pixel," then click "Assign".
Step 28
Click "Done" to finish up.
Step 29
Click "Connected assets," then click "Add Assets".
Step 30
Select the ad account you want to link to this pixel, then click "Add".
Step 31
Click "Done" to finish up.
Step 32
Now let’s verify your domain. In the left-hand side menu, click “Brand safety and suitability,” then click “Domains”.
Step 33
Click “Add,” then “Create a new domain”.
Step 34
Enter the domain of your store. It should be the URL customers see when they visit your website (i.e., “NodeMedia.co”). Do not include “https://” or any slashes (i.e., “/”). Click “Add”.
Step 35
Copy the meta-tag (highlighted). Do not copy the tag displayed in the screenshot below. Your tag will look different. Leave this window open for later.
Step 36
Go back to your Shopify store. Under “Online Store,” click “Themes”.
Step 37
Click “Actions,” then “Edit code”.
Step 38
Click “theme/liquid”.
Step 39
Place your cursor after the “<head>” tag (Picture 1), then hit Enter on your keyboard to create a new line (Picture 2). Paste in your meta-tag code (Picture 3).
Step 40
Click “Save” in the top-right corner.
Step 41
Go back to the domain section in your Meta Business Suite and click “Verify domain”. It may take up to 30 minutes for your domain to be verified.
Step 42
You’ve successfully verified your website’s domain. Click “Done”.
Step 43
Now let’s verify your Shopify domain. Go to your Shopify account. Click “Settings” in the bottom left corner.
Step 44
Click “Domains”.
Step 45
You should see both your main domain (i.e., “NodeMedia.co”) and your Shopify domain (i.e., “6ae81j.myshopify.com”). Copy the URL of your Shopify domain.
Step 46
Go back to the Domains page in Meta Business Suite. Click “Add,” then “Create a new domain”.
Step 47
Enter the Shopify domain you copied, then click “Add”.
Step 48
You are presented with code again. Simply repeat what you did in steps 35-42 in your Shopify account.
Step 49
Once you’re done verifying both domains, you will add events tracking. Select the 3-line menu on the left-hand side. Select “Events Manager”.
Step 50
On the right-hand side, select “Manage Prioritized events”.
Step 51
Let’s start with the first domain listed, the Shopify domain. Click the down arrow.
Step 52
Click “Manage Events”.
Step 53
Click “Edit”.
Step 54
Click the dropdown menu under “Pixel/Custom Conversion”, then select the pixel you just created.
Step 55
Click the dropdown menu under “Event Name”, then scroll and select “Purchase” in the menu.
Step 56
Click “Add Event”.
Step 57
Repeat the same process for “Initiate checkout” and “Add to Cart,” selecting the same pixel each time. Make sure the events are in this exact order from highest priority to lowest priority: Purchase, Initiate checkout, and Add to cart.
Step 58
Click “Apply” in the bottom right corner.
Step 59
Check “Yes, I confirm these changes,” then click “Apply”.
Step 60
Repeat steps 51 to 59 for your other domain, adding the same events and pixel.
Step 61
Let’s test your events. Click the back arrow in the top left of the page.
Step 62
Select your shop’s pixel, then click “Test events”.
Step 63
Enter your store’s URL (the one that your customers see-- not the Shopify one), then click “Open website”.
Step 64
Your website will be launched. Trigger the events you’re tracking (i.e., add to cart, initiate checkout, and purchase). If you successfully set up your pixel, you will see them show up in this page (highlighted).
Congratulations! You're all set up to start running ads to your Shopify store!
Read other Case Studies