Post-Purchase Pixel Tracking on Shopify

Oct 22, 2021 2 min read
Shopify announced the Post-Purchase Pixel Tracking Pixels feature.
Post-Purchase Pixel Tracking on Shopify

There was simply no way to track the Upsells or similar activities on the Post-Purchase pages. Shopify recently added the Post-Purchase Pixel Tracking Pixels feature.

You were probably having a lot of problems with post-purchase tracking on your Shopify store. There was simply no way to track the Upsells or similar activities on the Post-Purchase pages. Shopify recently added the Post-Purchase Pixel Tracking Pixels feature. It is just great news, especially for the stores that use up-sells.

Post-Purchase Additional Scripts
Post-Purchase Additional Scripts

This is how Shopify Help Center explains:

If your store has installed an app that adds a post-purchase page to your store's checkout, then any custom pixel tracking that you use on your store might not capture certain tracking events.

These script fields will be mainly used for capturing the upsells that are happening on Shopify. You should be quite careful while using it because it can cause duplications if it is not set up properly.

As the initial order is already captured before the post-order page; the scripts in the post-purchase tracking should have the capability to ignore the events that are already captured.

An example scenario:

  • The visitor purchased product A, order number #1212, revenue $10 /
    This order will probably already be captured with the tracking codes that you have in the Additional Checkout Scripts field.  
  • The visitor saw the upsell on the post-purchase page and added another product to their order. Now their order looks like: Products: Product A, Product B - Order number #1212 -  Revenue $20
    Your scripts should ONLY send the additional product and additional revenue. If you send this order like new order, then you will have many problems with your reports.  

We are aware that it is not easy to achieve this. We will soon update this page and release a complete guide to achieve the best possible result. As a team, we are in a testing phase and we will share the results once we are sure!

Shopify already covered the potential problems with additional functions and scripts. There are new liquid variables to help us process the scripts connected with each other. So the new scripts can run compatible with scripts on the order status page.

Upsell Tracking on Shopify

You need to make sure you are counting all purchases - but also not counting twice. To avoid duplications and other potential problems; you should use tracking scripts on both the post-purchase page and the order status page.

And here is the new liquid variable that comes into play: post_purchase_page_accessed  

If a customer lands on the post-purchase page and then navigates to the order status page, then the post_purchase_page_accessed variable returns true. If a customer doesn't arrive at the post-purchase page, then the variable returns false.

{% unless post_purchase_page_accessed %}
    //insert your tracking script
{% endunless %}

The Shopify team provided this great example (above). It helps us understand how it should work. The script above should run on the final order status page. In this way, the code block will only be triggered unless the user accessed the post-purchase (or upsell) page.

Shopify provided a few example code blocks to be used in these pages. However, we don't want to share them here before we test everything fully and come back with the practices.

You can go ahead check the related page for more details.

Make sure to subscribe Analyzify Hub not to miss the full tutorial once we release it.

Leave your questions & comments, get help from the Analyzify team & community.

Great! Next, complete checkout for full access to Analyzify Hub.
Welcome back! You've successfully signed in.
You've successfully subscribed to Analyzify Hub.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.