We’re an affiliate network who gives our merchant partners on Shopify some code to paste into their Additional Scripts field to track purchases. This code works completely fine for all except one shop where the {{ order_number }} field always displays as blank. The Additional Scripts code is:
<div data-ourcompany="[https://ourcompany.com/conversion/campaign:1011l3930/conversionref:**{{**](https://prf.hn/conversion/campaign:1011l3930/conversionref:%7B%7B) **order_number }}**/customertype:{% if customer.orders_count < 2 %}new{% else %}existing{% endif %}/voucher:{% for discount in order.discounts %}{{ discount.code }}{% endfor %}/currency:{{ currency }}/country:{{ checkout.shipping_address.country_code }}/shopify_order_id:{{ order_id }}/{% assign sub_total = 0 %}{% for line_item in line_items %}{% assign sub_total = line_item.line_price | plus: sub_total %}{% endfor %}{% assign sub_total = sub_total | append: '.00' %}{% for line_item in line_items %}[category:{{ line_item.product.type }}/shopify_variant_id:{{ line_item.variant_id }}/sku:{{ line_item.sku }}/value:{% if order.discounts_amount > 0 %}{% assign discount = order.discounts_amount | divided_by: sub_total %}{% assign discount_percentage = 1 | minus: discount %}{% assign afterDiscountPrice = line_item.price | times: discount_percentage %}{{ afterDiscountPrice | money_without_currency | remove: ',' }}{% else %}{{ line_item.price | money_without_currency | remove: ',' }}{% endif %}/quantity:{{ line_item.quantity }}]{% endfor %}" style="display:none"></div>
The result we’re seeing on order confirmation pages for this one shop (slightly fuzzed for privacy) is:
<div data-ourcompany="[https://ourcompany.com/conversion/](https://prf.hn/conversion/campaign:1011l3930/conversionref:%7B%7B)campaign:1011l3930/**conversionref:**/customertype:existing/voucher:JUN25/currency:USD/country:CA/shopify_order_id:xxxxxx0446/[category:Earrings/shopify_variant_id:xxxxxx1854/sku:xxxL164IL/value:837.38/quantity:1][category:Earrings/shopify_variant_id:xxxxx2380606/sku:xxxxx57DB/value:1706.25/quantity:1]" style="display:none"></div>
Any idea what could cause an {{ order_number }} to be blank here? Maybe some weird config setting or another app?