Shopify Integration : Helpdesk

Shopify Integration

For setting up a Shopify Integration:

Everflow Offer settings for a Shopify setup:

Edit > 'Tracking & Controls' Tab make sure that Conversion Method is selected as 'Javascript' > Make sure that Unique Session Identifier is Cookie and that the Duration is set to a greater amount than 0 (0 will not track).

On the Shopify side, use the script below with the following adjustments:

NID = Your Everflow Network ID
OID= The Offer ID you're setting up
Your Domain setup.

You can find this by going to the Offer you're setting up  > check Conversion Postback section > This line in the script has the necessary details:  
script.src = "https://YOURDOMAIN.servecvr.com/?nid=##&oid=####

<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://YOURDOMAIN.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://YOURDOMAIN.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

Optional: If you're using Security Tokens, they need to be include in the Shopify Javascript setup, use this format:
[This only happens if you've activated Security Tokens for the Advertiser.  This is under: Advertisers - Manage > Select an Advertiser > Edit > Toggle 'Enforce Verification Token' and Click Generate. [This is not commonly used, and just provides an additional layer of security- for more information about Advertiser Verification tokens, please reference this this the helpdesk article found, here.]

<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.verification_token = ""; //Mandatory if the advertiser requires it in your Everflow setup, left empty otherwise
    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://YOURDOMAIN.servecvr.com?nid=" + script.nid + "&oid=" + script.oid + "&transaction_id=" + script.transaction_id + "";

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

    if (script.verification_token !== "") {
        script.src += "&verification_token=" + script.verification_token;    
    }

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

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

Did you find it helpful? Yes No

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