Articles on: Legacy ReConvert | Funnels

How to Implement Pixel tracking on your Post-Purchase Page

How to Implement Pixel tracking on your Post-Purchase Page



1. Context
2. Adding Post-Purchase Page Scripts
3. Order Status Page Script Compatibility
4. Example Script for Post-Purchase Tracking



Context


If you use custom pixel tracking on your store, it’s possible that your pixel(s) are not tracking events on ReConvert’s post-purchase page.

Custom tracking pixels, added to your store’s ‘Additional Scripts’ box, only track events on your order status page (also known as the thank you page).

So, if a customer leaves your store on the post-purchase upsell page before landing on the order confirmation page, it’s possible that no events are tracked on your post-purchase pages.

Therefore, to capture all conversion data accurately when using ReConvert’s post purchase upsell pages, you need to add new post-purchase page scripts that’ll account for customers who leave your store before landing on your order status page.

💡 Important: You only need to change how your store tracks events if you use a custom tracking pixel. For example, if you set up Google Analytics through Online Store > Preferences, then it already captures events correctly on your post-purchase page.

⚠️Caution: Tracking scripts are advanced customizations that aren't supported by ReConvert’s support team. If you aren't comfortable working with scripts, we strongly recommend you hire a Shopify expert.

🔧👩🏽‍💻 For a full technical explanation, we strongly advise you read Shopify’s official document on this topic here.

Adding Post-Purchase Page Scripts


Shopify created a new field for adding additional scripts to your post-purchase page. You can locate this new field in your Shopify admin by navigating to Settings > Checkout > Post-purchase page > Additional scripts section:



This new script field allows you to:

Track conversions when a customer lands on your post-purchase page. This protects visitor drop-off between your checkout page and your order status page.
Track conversions on your post-purchase offer.

The post-purchase page additional script is similar to the order status page additional scripts, but with a few key differences:

The script is added to the post-purchase page, not the order status page.
The field allows only JavaScript. Liquid code isn't accepted.
The only HTML tag allowed is <script>.
The script runs within a sandbox (so it’s used only for its intended purpose.)


Order Status Page Script Compatibility


After you add a post-purchase page script, you also may need to edit your order status page script.

This is to ensure that your order status page script ignores events that are now captured by your new post purchase page script. Learn more here.

To avoid counting conversion events twice, you can use the post_purchase_page_accessed Liquid variable in scripts that run on the order status page.

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.

For example, you can use the following format from Shopify for your scripts on the order status page:




Example Script for Post-Purchase Tracking


Shopify provides the following basic script template to help you build your own post-purchase page script. This example script uses Google Analytics to track the initial conversion, and explains how to track additional purchases.

⚠️Note: This example is for demonstration purposes only. It’s simplified and your functioning script may differ considerably from it.

i) Example script for the order status page:



ii) Example script for the post-purchase page:







💡For References, available APIs and more information, make sure to check out Shopify’s full guide on this topic here.

🙋Still need help? Our support team can’t assist you with editing scripts (you’ll need a coder for that!). However, if you’re stuck, you can post in the Shopify Community or hire a Shopify Expert. We’re confident you’ll find the expertise you need via these channels.

📢 Did you know we have a YouTube channel? Don’t forget to subscribe to the channel to keep in touch with us and our news and updates.
🙏 If you find our app useful, help other merchants find it by leaving us an honest review on the Shopify app store! It means the world to us.
📧 Please let us know if you spot any typos, mistakes or omissions via care@stilyoapps.com

Updated on: 23/05/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!