Daisycon has developed a Shopify app to implement the tracking pixel in a Shopify webshop. This is the easiest solution for advertisers to implement tracking in their Shopify webshop.
The Daisycon Shopify App can be found here: apps.shopify.com/daisycon
Alternative implementation methods
Besides the Daisycon Shopify App, it's also possible to implement a script in the additional script text box in the order processing section (Settings -> Checkout -> Order processing). We have two different scripts.
This first script implements the Daisycon Product level conversion pixel. This script measures each unique product of the transaction and calculates the amount based on the full product price, which is often incl. VAT. The other script is a standard conversion pixel, that measures the sub-total amount of a transaction, excluding VAT.
Daisycon advices to use the Daisycon Shopify App and can only give limited support with below scripts!
Manual script - Product leven conversion pixel
1. Ask your Channel Manager for your Daisycon Campaign ID and its Matching Domain.
2. Replace the values in bold below with values that correspond with your campaign.
- dsc_campaign_id: Daisycon campaign-id
- matching domain: at19.net / ds1.nl / dt51.net / lt45.net, ndt5.net, fr135.net or jf79.net
<!-- START PIXEL CODE //-->
{% if first_time_accessed %}
{% comment %}
Please enter the below variables based on your campaign settings:
dsc_campaign_id = the id of your campaign in the Daisycon system.
dsc_matching_domain = the matching domain for your Daisycon advertiser account.
{% endcomment %}
{% assign dsc_campaign_id = XXXXX%}
{% assign dsc_matching_domain = "MATCHING-DOMAIN" %}
{% assign total_value= checkout.total_price | minus: checkout.shipping_price | plus: checkout.discounts_amount %}
{% assign discount = checkout.discounts_amount | times: 1.00 | divided_by: total_value | times: 1.00 %}
{% assign discount_ratio = 1.00 | minus: discount %}
<img src='https://www.{{dsc_matching_domain}}/t/?ci={{dsc_campaign_id}}&ti={{order_number}}&np={{line_items.size}}&c={{checkout.billing_address.country_code}}&z={{checkout.billing_address.zip}}&pr={% for discount_application in checkout.discount_applications %}{{ discount_application.title | url_encode }}{% endfor %}&cur={{checkout.currency}}{% for line_item in line_items %}&p[]={a:{{ line_item.original_line_price | times: 1.00 | divided_by: 100 | times: discount_ratio | round: 2}}}{r:{{line_item.original_line_price | times: 1.00 | divided_by: 100 | times: discount_ratio | round: 2}}}{qty:{{line_item.quantity}}}{cc:{{line_item.product.type | url_encode}}}{pn: {{line_item.title | truncate: 50 | url_encode}}}{iv:{{line_item.sku | truncate: 50 | url_encode}}}{% endfor %}&src=shopify-2.1s' style='border: 0px; height: 1px; width: 1px;' alt='Daisycon Affiliate Marketing' />
<script type="text/javascript">
(function(d){var a,b,c;if(/comp|inter|loaded/.test(d.readyState)){return _a();}d.addEventListener('DOMContentLoaded', _a);function _a(){setTimeout(function(){a=d.getElementsByTagName('img');for(b=0;b<a.length;b++){try{if(/[s|c]i=/i.exec(a[b].src)&&(!a[b].offsetHeight||a[b].offsetHeight<1)){c=d.createElement('img');c.height=c.width=1;c.id='news';c.className='net';c.src='//'+Math.round(+new Date()/83000)+'.'+c.id+'tat.'+c.className+'/ab/'+a[b].src.substring(a[b].src.indexOf('?'),a[b].src.length)+'&v3';d.body.appendChild(c);}}catch(e){}}},100)}})(document);
</script>
{% endif %}
<!-- END PIXEL CODE //-->
3. Copy the code, including the values added in step 2, to the Additional scripts text box in the Order processing section (Settings -> Checkout -> Order processing). Don't forget to save!
4. Ask your Channel Manager for a test link and click this link to make a test purchase.
5. If a transaction with the correct values appears in your Daisycon campaign dashboard, the tracking has been implemented successfully.
Using the shopping cart amount without taxes to calculate the commission
The code given above will calculate the commission based on the total value of the shopping cart of the order after aplied discounts, if you want to send use the total value of the shopping cart after discount without the taxes amount you will have to implement the following code instead of the code given previously in this article. This script will not have the product level conversion pixel, but a standard conversion pixel.
<!-- START PIXEL CODE //-->
{% if first_time_accessed %}
{% comment %}
Please enter the below variables based on your campaign settings:
dsc_campaign_id = the id of your campaign in the Daisycon system.
dsc_store_currency = the currency of your Shopify store.
dsc_custom_descriprion = custom description for your Daisycon transactions. Leaving this empty will use the store name as default.
{% endcomment %}
{% assign dsc_campaign_id = XXXXX %}
{% assign dsc_matching_domain = "MATCHING-DOMAIN" %}
{% assign dsc_store_currency = "EUR" %}
{% assign dsc_custom_description = "Description" %}
{% assign prefix_order_value = checkout.total_price | minus: checkout.shipping_price | minus: checkout.tax_price | money_without_currency %}
{% if prefix_order_value contains "." or prefix_order_value contains "," %}
{% assign remove_cents = prefix_order_value | size | minus: 3 %}
{% assign fix_order_value_pt1 = prefix_order_value | slice: 0, remove_cents %}
{% assign fix_order_value_pt2 = prefix_order_value | slice: -3, 3 %}
{% assign fixed_order_value_pt1 = fix_order_value_pt1 | remove: "," | remove: "." %}
{% assign fixed_order_value_pt2 = fix_order_value_pt2 | replace: ",", "." %}
{% assign fixed_order_value = fixed_order_value_pt1 | append: fixed_order_value_pt2 %}
{% else %}
{% assign fixed_order_value = prefix_order_value %}
{% endif %}
{% if dsc_custom_description == blank %}
{% assign dsc_description = shop.name %}
{% else %}
{% assign dsc_description = dsc_custom_description %}
{% endif %}
<img src='https://www.{{dsc_matching_domain}}/t/?ci={{dsc_campaign_id}}&ti={{order_number}}&a={{fixed_order_value}}&r={{fixed_order_value}}&pn={{dsc_description}}&iv={{dsc_description}}&z={{checkout.billing_address.zip}}&pr={% for discount_application in checkout.discount_applications %}{{ discount_application.title | url_encode }}{% endfor %}&cur={{dsc_store_currency}}' style='border: 0px; height: 1px; width: 1px;' alt='Daisycon Affiliate Marketing' />
<script type="text/javascript">
(function(d){var a,b,c;if(/comp|inter|loaded/.test(d.readyState)){return _a();}d.addEventListener('DOMContentLoaded', _a);function _a(){setTimeout(function(){a=d.getElementsByTagName('img');for(b=0;b<a.length;b++){try{if(/[s|c]i=/i.exec(a[b].src)&&(!a[b].offsetHeight||a[b].offsetHeight<1)){c=d.createElement('img');c.height=c.width=1;c.id='news';c.className='net';c.src='//'+Math.round(+new Date()/83000)+'.'+c.id+'tat.'+c.className+'/ab/'+a[b].src.substring(a[b].src.indexOf('?'),a[b].src.length)+'&v3';d.body.appendChild(c);}}catch(e){}}},100)}})(document);
</script>
{% endif %}
<!-- END PIXEL CODE //-->
-
Questions and more information
Click here for more information about how to add conversion tracking to your order status page.
Do you have any questions regarding the implementation of the conversion pixel? Don't hesitate to reach out to your Channel Manager.
Test conversion pixel
After a developer has implemented the conversion pixel or if you have activated one of our standard solutions, the functioning of the conversion pixel needs to be tested. To do this, follow the steps from the following FAQ article: How to test the conversion pixel (tracking implementation)?