Order Track Script

JacquesHermes
Tourist
5 0 2

Hello people. We are currently trying to make our online shop a member of an online shopping web-page platform called skroutz.gr . To do so, we have to add some scripts to our page's codes. One of those, is a tracking script, that will send data (like the order id, product id, revenue etc) to skroutz.gr after an order is completed. We are told that this script should be added to the thank you or checkout page. Since we do not have a Shopify plus submission, we are not allowed to access the checkout.liquid page, so we are trying to add it on settings/checkout/additional scripts but it is not sending them any data. Are we adding the code on the wrong place? Are there any mistakes on the script? Here you can see the code we are trying to add : 

<script>
(function(a,b,c,d,e,f,g){a['SkroutzAnalyticsObject']=e;a[e]= a[e] || function(){
(a[e].q = a[e].q || []).push(arguments);};f=b.createElement(c);f.async=true;
f.src=d;g=b.getElementsByTagName(c)[0];g.parentNode.insertBefore(f,g);
})(window,document,'script','https://analytics.skroutz.gr/analytics.min.js','skroutz_analytics');

skroutz_analytics('session', 'connect', 'XX-11111-2222'); // Connect your Account.
</script>

<script>
skroutz_analytics('ecommerce', 'addOrder', {
'order_id': "{{order.name}}" , // Order ID. Required.
'revenue': total_price ,
// Grand Total. Includes Tax and Shipping. Does not include payment costs.
'shipping': shipping_price , // Total Shipping Cost. Does not include payment costs.
'tax': tax_price ,
// Total Tax.
});
</script>
<script>
skroutz_analytics('ecommerce', 'addItem', {
'order_id': "{{order.name}}" , // Order ID. Required.
product_id: 'product.id' , // Product ID. Required.
name: 'product.title' , // Product Name. Required.
price: 'product_variant.price' ,
// Price per Unit. Required.
quantity: 'product_variant.inventoryQuantity'
// Quantity of Items. Required.
});
</script>

 

0 Likes