A place to discuss charging merchants for your apps and services using the billing API.
We received today an email asking us to replace "order.{anything}" for "checkout.order_id" but I cant find this [Additional Scrips] to update this.
Then when I enter the settings > checkout I see in the first section of the page "Settings (New)" saying "Your Thank You and Order Status page have to be replaced"
Can someone pls help me?
Thanks a lot in advance!
I received the same email. I am using metafields to show a custom order status update and when I made the change, that no longer worked. I ended up just changing it back because I like being able to update customers through their order status page, without needing to purchase anything additional. I'm getting so frustrated with this system that they keep changing on us.
You can access the additional scripts here: https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/first-time-accessed...
I couldn't find it either. Also "anything" is a really stupid parameter name to send out to non-technical customers. Is the parameter actually called "anything" or does it mean that anything can be between the quotes like "ABC", "asdf", "1337" etc??
Hello @jorgeplantz ,
Shopify is evolving and introducing a new set of APIs to improve and scale the platform. In order to resolve this you need to follow the few steps below and you;ll be able to fix it.
Path=> Shopify Dashboard > Settings > Checkout > Additional scripts
Before
<!-- Purchase Conversion Event Start -->
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
{% if first_time_accessed %}
dataLayer.push({
event: "purchase_complete",
ecommerce: {
transaction_id: "{{ order.order_number }}",
value: {{ total_price | times: 0.01 }},
tax: {{ tax_price | times: 0.01 }},
shipping: {{ shipping_price | times: 0.01 }},
currency: "{{ order.currency }}",
}
});
{% endif %}
</script>
<!-- Purchase Conversion Event End -->
After
<!-- Purchase Conversion Event Start -->
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
{% if first_time_accessed %}
dataLayer.push({
event: "purchase_complete",
ecommerce: {
transaction_id: "{{ checkout.order_id }}",
value: {{ total_price | times: 0.01 }},
tax: {{ tax_price | times: 0.01 }},
shipping: {{ shipping_price | times: 0.01 }},
currency: "{{ checkout.currency }}",
}
});
{% endif %}
</script>
<!-- Purchase Conversion Event End -->
If you're not familiar with this, please consider contacting a technical person or hire a developer. Any minor mistake can impact analytics and lower conversion results tracking.
Feel free to reach out the me if you still need any help.
Regards,
Osama Farooqi
Hi Osama,
Many thanks. I received that email, too. I followed the steps you mentioned, but I still see the attached error message. The mentioned incompatible apps that I have are Google Analytics and Microsoft Clarity. I made the changes to the following additional script which is at the setting- checkout—the additional script has the code for Google Analytics and Microsoft Clarity. Please let me know how I can solve it. Thanks.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VKB2PDJ7Y4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VKB2PDJ7Y4');
{% if first_time_accessed %}
gtag("event", "purchase", {
transaction_id: "{{ checkout.order_id }}",
value: {{ total_price | times: 0.01 }},
tax: {{ tax_price | times: 0.01 }},
shipping: {{ shipping_price | times: 0.01 }},
currency: "{{ checkout.currency }}",
items: [
{% for line_item in line_items %}
{
item_id: "{{ line_item.product_id }}",
item_name: "{{ line_item.title | remove: "'" | remove: '"' }}",
currency: "{{ checkout.currency }}",
price: {{ line_item.original_price | times: 0.01 }},
quantity: {{ line_item.quantity }}
},
{% endfor %}
]
});
{% endif %}
</script>
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "lmp0ktcva5");
</script>
i follow the steps when i reach at additional scripts box there is already data present from an app used for providing order cancel option for customer. what should i do please help.
"complete text which is already present is below is pasted"
<!-- start codify - order cancel widget -->
<script>
let order_id = {{ order.id | json }};
if(order_id != null) {
if(!window.Shopify.checkout) {
window.Shopify.checkout = {
line_items: []
};
{% for item in order.line_items %}
window.Shopify.checkout.line_items.push({
variant_id: {{ item.variant_id | json }},
quantity: {{ item.quantity | json }}
});
{% endfor %}
}
window.coc = {
shop: {{ shop.permanent_domain | json }},
order_id: order_id,
cancelled: {{ order.cancelled | json }},
fulfillment: {{ order.fulfillment_status | json }},
order_url: {{ order.order_status_url | json }},
total_price: {{ order.total_price | default: 0 }}
}
} else {
location.reload();
}
</script>
<script src="https://www.codifyordercancel.com/order-cancel.js?v=1234" type="text/javascript"></script>
<!-- end codify - order cancel widget -->
You won't be able to implement liquid fragment:
{% for item in order.line_items %}
window.Shopify.checkout.line_items.push({
variant_id: {{ item.variant_id | json }},
quantity: {{ item.quantity | json }}
});
{% endfor %}
Because the customer events pixel works only with JavaScript, you should rebuild it.
Instead {% for item in order.line_items %} use:
function extractProducts(lineItems) {
return lineItems.map(item => {
//your code... for example:
item_name: item.title,
item_id: item.variant.sku,
item_category: item.variant.product.type,
item_variant_id: item.variant.id,
item_product_id: item.variant.product.id,
});
}
But I'm not sure it is possible to rebuild all of it.
My client also received such an email.
In additional scripts, I have this line in the analytics script.
'transaction_id': '{{ order.order_number }}',
Will changing order.order_number to checkout.order_number or checkout.order_id (as it was in the email) solve the problem and not kill the analytics?
Which version is correct checkout.order_number or checkout.order_id?
Hello @mrycko ,
"checkout.order_id" is the correct one. You also need to update the currency as well.
Before:
currency: "{{ order.currency }}",
After:
currency: "{{ checkout.currency }}",
Feel free to reach out the me if you still need any help.
Regards,
Osama Farooqi
Have you verified that "order.order_number" has to be replaced with "checkout.order_id"? It doesn't make sense as the returned value would be different.
I'd say the whole point is referencing the checkout object instead of order.
Hi @razariusu , if you read the official email, you'll notice this that they mentioned to replace the "order.order_number" with "checkout.order_id". The reason behind this is 'The field(s) "order.(anything)" are populated during order creation. With Checkout Extensibility, this happens independently of the Thank You page loading to improve scale and performance.
However, "checkout.order_id", on the other hand, is a common and unique identifier across checkout and order creation. It is available as soon as checkout is completed and can reliably be used to tie together analytics, downstream systems, and the buyer experience.
Moreover, it'll be sunset soon. So, batter to migrate it to Custom Pixels in Shopify.
Feel free to reach out the me if you still need any help.
Regards,
Osama Farooqi
You have to modify it from the Liquid order object to the Liquid checkout object. That's all. Read the documentation and replace it.
Hello everyone,
In addition to my previous reply, I recommend upgrading Additional Scripts to Checkout Extensibility. Shopify has set a deadline of August 28, 2025, for this transition.
Therefore, please upgrade your scripts to Shopify Checkout Extensibility before this date. If you are not a developer, it is advisable to hire a developer to handle the upgrade for you.
Feel free to reach out the me if you still need any help.
Regards,
Osama Farooqi
Did you try to implement the Custom Pixels instead of the Additional Scripts? Does it work? I heard there is a problem with sending data to the GTM. Please tell me more about it. You can use the Customer events but it's run in the sandbox environment and you can't grab everything. Alternatively, you can create your own app, but I heard there is no possibility to push data directly to the GTM. Please correct me if I'm wrong.
https://shopify.dev/docs/api/web-pixels-api#app-web-pixels