Shopify Integration(Advanced and older) : Helpdesk

Shopify Integration(Advanced and older)

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).


1)Setup using OrderId-oid

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.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.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.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.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>

2)Setup using Advertiser id - advid

You can also use use advertiser id's (advid) to implement in the shopify code instead of order id's.

NID = Your Everflow Network ID
ADVID= The Advertiser ID you're setting up
Your Domain setup.


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

    script.order = {
          advid: "{{ 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.com?nid=" + script.nid + "&advid=" + script.advid + "&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.com?nid=TO_BE_PROVIDED&advid=TO_BE_PROVIDED&amount={{ total_price | money_without_currency }}" height="1" width="1" style="display:none;"/></noscript>



3)Setup using Coupon codes
Another optional setup is if you would like to use coupon codes to send a conversion to our platform without having to have a user click an everflow tracking link, for more information about how to actually use coupon codes please see this article: https://help.everflow.io/support/solutions/articles/22000225312-coupon-code-clickless-tracking

Keep in mind that you need a way to pass the coupon code into the javascript tag after the user has input it into your shopify page. If you have a way to do that you can use this script:

<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.couponCode = "...";

    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.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));
    }

    if (script.couponCode) {
        script.src += "&coupon_code=" + script.couponCode;
    }

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



Place the Code in Additional Scripts

In order to track conversions this code will need to be placed in the "Additional scripts" section of the Checkout settings. You can find this by going to Settings on the bottom left of the Admin:


Then go to Checkout:


Next scroll about three quarters of the way down the page to the "Order processing" section. There you will see a text box for "Additional scripts":


Paste the code there and it will only appear on the order status page (typically Order Confirmation).


Did you find it helpful? Yes No

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