Shopify integration : Helpdesk

Shopify integration

<script>
(function(){
    var script = document.createElement("iframe");
    script.width = 1;
    script.height = 1;
    script.frameBorder = 0;
    script.nid = "TO_BE_PROVIDED";
    script.oid = "TO_BE_PROVIDED";
    script.transaction_id = ""; //Optional
    script.amount = {{ total_price | money_without_currency }};

    script.order = {
          oid: "{{ order_number }}",
          amt: "{{ total_price | money_without_currency }}",
          bs: "{{ order.shipping_address.province }}",
          bc: "{{ order.shipping_address.country }}",
          cc: "{{ discount.code }}",
          items: []
    };

    {% for line_item in order.line_items %}
        var item = {};
        item['ps'] = '{{ line_item.sku }}';
        item['p'] = {{ line_item.price | money_without_currency }};
        item['qty'] = {{ line_item.quantity }};
        script.order.items.push(item);
    {% endfor %}

    script.src = "https://www.servecvr.com/?nid=" + script.nid + "&oid=" + script.oid + "&transaction_id=" + script.transaction_id + "";

    if (script.amount > 0) {
        script.src += "&amount=" + script.amount;
    }

    if (script.order) {
        script.src += "&order=" + encodeURIComponent(JSON.stringify(script.order));
    }

    document.getElementsByTagName("body")[0].appendChild(script);
})();
</script>
<noscript><img src="https://www.servecvr.com/?nid=TO_BE_PROVIDED&oid=TO_BE_PROVIDED&amount={{ total_price | money_without_currency }}" height="1" width="1" style="display:none;"/></noscript>


For information on where to actually place this code, please go here: https://help.shopify.com/manual/orders/status-tracking/add-conversion-tracking-to-thank-you-page

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.