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:
Log into https://business.facebook.com/ with your credentials to access your Meta Business Suite.
In the bottom left corner, click the gear icon to open your Business Settings.
On the left-hand side, under "Data sources," click "Pixels".
Click on "Add".
Give your pixel a name and add your website, then click "Continue".
Select "Set up the pixel now".
Select "Add code using a partner integration".
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.
Go to your Shopify store. Click “Online Store” on the left-hand side.
Scroll down until you see “Facebook Pixel,” then click “Set up Facebook”.
Click the green button, “Add sales channel”.
Click the green button, “Connect account”.
Select the account that you want to connect to.
Select the business manager associated with your pixel, then click “Connect”.
Select “Maximum” for preference, then click “Save”.
Connect to the pixel you just created.
Check the box to agree to Facebook’s terms and conditions.
Click “Submit for review”.
You are now able to run ads on Facebook and Instagram!
Return to the window you left open. Check off “I’ve completed the set up on Shopify,” then hit “Next”.
Paste your website URL into the textbox to check if it’s working. Click “Send test traffic”.
Wait until you see “Active”. This process may take up to 30 minutes. Once the status indicator is active, click “Next”.
Once you have your pixel set up, add yourself to the pixel. Click "People," then click "Add people".
Select yourself and/or anyone on your account who needs full access to your pixel. Click "Manage pixel," then click "Assign".
Click "Done" to finish up.
Click "Connected assets," then click "Add Assets".
Select the ad account you want to link to this pixel, then click "Add".
Click "Done" to finish up.
Now let’s verify your domain. In the left-hand side menu, click “Brand safety and suitability,” then click “Domains”.
Click “Add,” then “Create a new domain”.
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”.
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.
Go back to your Shopify store. Under “Online Store,” click “Themes”.
Click “Actions,” then “Edit code”.
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).
Click “Save” in the top-right corner.
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.
You’ve successfully verified your website’s domain. Click “Done”.
Now let’s verify your Shopify domain. Go to your Shopify account. Click “Settings” in the bottom left corner.
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.
Go back to the Domains page in Meta Business Suite. Click “Add,” then “Create a new domain”.
Enter the Shopify domain you copied, then click “Add”.
You are presented with code again. Simply repeat what you did in steps 35-42 in your Shopify account.
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”.
On the right-hand side, select “Manage Prioritized events”.
Let’s start with the first domain listed, the Shopify domain. Click the down arrow.
Click “Manage Events”.
Click the dropdown menu under “Pixel/Custom Conversion”, then select the pixel you just created.
Click the dropdown menu under “Event Name”, then scroll and select “Purchase” in the menu.
Click “Add Event”.
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.
Click “Apply” in the bottom right corner.
Check “Yes, I confirm these changes,” then click “Apply”.
Repeat steps 51 to 59 for your other domain, adding the same events and pixel.
Let’s test your events. Click the back arrow in the top left of the page.
Select your shop’s pixel, then click “Test events”.
Enter your store’s URL (the one that your customers see-- not the Shopify one), then click “Open website”.
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!