Liquid, JavaScript, themes, sales channels
Posting on behalf of @JamesHan1
Hello, I'm using Zipify Upsell and I have some conversion tracking problem...
I explain :
Usually, when the client makes an order :
1) He arrives to the thank you page.
2) Here, a code is triggered (like a Facebook Pixel or a Google Tag) so Facebook or Google Ads knows there's a conversion.
It's usually very simple, there's just some code snippet to install in the Shopify settings.
3) However, with an upsell post purchase, the client will sometimes land to the upsell page between the purchase page and the thank you page.
It's a page to upsell a product just after they have completed their order.
And if they leave this page, they will not land to the thank you page, and the conversion code will not trigger.
4) Shopify had implemented the possibility to add code to this upsell page as well.
But it's just not working even if I follow the official documentation.
Here's the post purchase upsell app I'm using:
https://apps.shopify.com/zipify-oneclickupsell
Here's some additional information about the tracking :
https://support.checkoutpromotions.com/article/48-adding-pixel-tracking-on-post-purchase
https://help.zipify.com/en/articles/5666522-oneclickupsell-pixel-tracking-on-the-post-purchase-page
Here's the sample for the post purchase tracking.
I'm using Google Ads.
<script async src="googletagmanager.com/gtag/js?id=AW-X XXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'AW-XXXXXX');
</script>
<script>
if (!Shopify.wasPostPurchasePageSeen) {
var order = window.Shopify.order;
gtag('event', 'conversion', {
'send_to': 'AW-XXXXXX/YYYYYY',
'value': order.totalPrice,
'currency': order.currency,
'transaction_id': Number(order.id).toString()
});
}
</script>
Shay | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hey @JamesHan1
I am not a trained dev myself, but reviewing your code sample it does appear to differ in certain areas from our sample code provided in our Help Center.
Do you have a copy of the code used on the Order Status Page too? The references for the IF statement in your script would need that also.
Yours:
<script>
if (!Shopify.wasPostPurchasePageSeen) {
var order = window.Shopify.order;
gtag('event', 'conversion',
VS Help Center:
gtag('event', 'purchase'
Your script appears to be referencing a different analytic tag (conversion vs purchase), and I just want to make sure that is correct.
Yours also does not include (or you haven't included here) the additional tracking addendums that are in the Help Center version:
// no new items were added, so we skip conversion tracking
if (addedItems.length === 0) {
return;
}
// track additional purchase
gtag('event', 'purchase', {
affiliation: 'My Shopify Store',
transaction_id: Number(order.id).toString(),
value: order.totalPrice,
currency: order.currency,
items: addedItems.map(function (item) {
return {
id: Number(item.id).toString(),
name: item.title,
category: item.product.type,
price: item.price,
quantity: item.quantity,
variant: Number(item.variant.sku).toString(),
I would also love to know if you have had any carts where the conversion wasn't tracked checked over by our technical team to see if we can assist in isolating what step was missing in the process for the conversion tracking to be successful. This would need to be an abandoned cart or successful cart created within the past 2 weeks for our technical team to review any possible logs.
Shay | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hello thx for the awnser !
So in order :
1)
gtag('event', 'conversion',
gtag('event', 'purchase',
Hey @JamesHan1 - did you happen to figure this out? Running into the same issue with same app and tracking conversions from Tags
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024