Why isn't my script returning all variables?

Hello.

Some of variables in my script does not work. Could you check why?

It only gives back the numer of the order.

Here is the script:

x('track', 'Purchase', { transaction_id: '{{order.name}}', value: {{order.totalPriceSet.shopMoney.amount}}, shipping_cost: {{order.totalShippingPriceSet.shopMoney.amount}}, discount_code: '{{order.discountCode}}', contents: [ {% for a in order.lineItems %} { id: '{{a.id}}', name: '{{a.title}}', ean: '{{a.sku}}', price: {{a.originalUnitPriceSet.shopMoney.amount}}, quantity: {{a.quantity}}, in_stock: ‘true’ }, {% endfor %} ] }); And here is the outcome: ![luxuria_0-1632296504099.png|265x170](upload://69XB8urA78t6Jj3zEoQ8g4zPVdu.png) Any help would be really appreciated. Thanks in advance.

Hello , @asd123

May be you can try like this :-

x(‘track’, ‘Purchase’, {
transaction_id: ‘{{order.name}}’,
value: {{order.total_price | money}},
shipping_cost: {{order.shipping_price | money}},

{% for discount_application in order.discount_applications %}
discount_code: ‘{{discount_application.title}}’,

{% endfor %}
contents: [
{% for a in order.lineItems %}
{
id: ‘{{a.id}}’,
name: ‘{{a.title}}’,
ean: ‘{{a.sku}}’,
price: {{a.originalUnitPriceSet.shopMoney.amount}},
quantity: {{a.quantity}},
in_stock: ‘true’
},
{% endfor %}
]
});