· 4 years ago · Apr 12, 2021, 11:36 AM
1{% assign discount_code = "" %}
2{% if checkout.discounts %}
3{% for discount in checkout.discounts %}
4{% assign discount_code = discount.code %}
5{% break %}
6{% endfor %}
7{% endif %}
8{% assign discount_code = "" %}
9{% if checkout.discounts %}
10{% for discount in checkout.discounts %}
11{% assign discount_code = discount.code %}
12{% break %}
13{% endfor %}
14{% endif %}
15
16{% if first_time_accessed %}
17<script> window.addEventListener('load', function(){ window.dataLayer = window.dataLayer || []; {% if customer %} window.dataLayer.push({ visitorType: "Logged In", visitorId: "{{ customer.id | remove: "'" }}", CustomerId: "{{ customer.id | remove: "'" }}", CustomerEmail: "{{ customer.email }}", CustomerFirstName: "{{ customer.first_name }}", CustomerPhone: "{{ customer.default_address.phone }}", CustomerLastName: "{{ customer.last_name }}", CustomerOrdersCount: {{ customer.orders_count }}, CustomerTotalSpent: {{ customer.total_spent | divided_by: 100 }}, }); {% else %} window.dataLayer.push({ visitorType: "Guest" }); {% endif %} window.dataLayer.push({ 'pageType': 'purchase', 'event': 'transactionComplete', 'ecommerce': { currencyCode: "{{ shop.currency }}", 'purchase': { 'actionField': { 'id': '{{order.order_number}}', 'revenue': {{total_price | times: 0.01}}, 'tax': {{tax_price | times: 0.01}}, 'shipping': {{shipping_price | times: 0.01}}, 'affiliation': '{{ shop.name }}', 'discountAmount': {{ checkout.discounts_amount | money_without_currency }}, {% if order.discounts %} 'coupon': '{{ order.discounts[0].code }}', {% endif %} }, 'products': [ {% for line_item in line_items %} { 'name': '{{line_item.product.title | remove: "'"}}', 'id': '{{line_item.sku}}', 'productId': '{{line_item.product_id}}', 'price': {{line_item.price | times: 0.01}}, 'brand': '{{line_item.vendor | remove: "'"}}', 'category': '{{line_item.product.type | remove: "'"}}', 'variant': '{{line_item.variant.title | remove: "'"}}', 'shopifyId': '{{line_item.product_id}}_{{line_item.variant_id}}', 'quantity': {{ line_item.quantity }} }, {% endfor %} ] } } }); }, false); </script> <noscript> <iframe src='https://www.googletagmanager.com/ns.html?id=GTM-57HLJ98' height='0' width='0' style='display:none;visibility:hidden'></iframe> </noscript><!-- End Google Tag Manager --><!-- Google Tag Manager --> <script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({"gtm.start": new Date().getTime(),event:"gtm.js"});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!="dataLayer"?"&l="+l:"";j.async=true;j.src= "https://www.googletagmanager.com/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f); })(window,document,"script","dataLayer","GTM-57HLJ98"); </script> <!-- End Google Tag Manager --> <script> window.dataLayer = window.dataLayer || []; </script>
18
19
20<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"25053029"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
21
22<!-- Event snippet for TMC - Ads conversion page -->
23<script>
24 window.dataLayer = window.dataLayer || [];
25 function gtag(){dataLayer.push(arguments);}
26 gtag('js', new Date());
27 gtag('config', 'AW-625277424');
28
29 gtag('event', 'conversion', {
30 'send_to': 'AW-625277424/iE3GCLCHoNMBEPDzk6oC',
31 'value': {{ total_price | money_without_currency | remove: "," }},
32 'currency': 'INR',
33 'transaction_id': '{{ order.order_number }}'
34 });
35</script>
36
37<!-- vwo -->
38<!-- Start Visual Website Optimizer Asynchronous Code -->
39<script type='text/javascript'>
40 var _vwo_code=(function(){
41 var account_id=350356,
42 settings_tolerance=2000,
43 library_tolerance=2500,
44 use_existing_jquery=false,
45 /* DO NOT EDIT BELOW THIS LINE */
46 f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
47 </script>
48 <script type="text/javascript">
49 window.VWO = window.VWO || [];
50 window.VWO.push(['track.revenueConversion',"REPLACE_THIS_WITH_ACTUAL_REVENUE"]);
51 </script>
52 <!-- End Visual Website Optimizer Asynchronous Code -->
53
54 <!-- end of vwo -->
55
56
57 <!-- Google Code for Purchase Conversion Page -->
58 <script type="text/javascript">
59 /* <![CDATA[ */
60 var google_conversion_id = 926103635;
61 var google_conversion_language = "en";
62 var google_conversion_format = "3";
63 var google_conversion_color = "ffffff";
64 var google_conversion_label = "7N54COf3_mQQ0_DMuQM";
65 if ({{ order.order_number }}) {var google_conversion_order_id = "{{ order.order_number }}";}
66 if ({{ total_price }}) { var google_conversion_value = {{ total_price | money_without_currency | remove: "," }}; }
67 var google_conversion_currency = "INR";
68 var google_remarketing_only = false;
69 /* ]]> */
70 </script>
71 <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
72 </script>
73 <noscript>
74 <div style="display:inline;">
75 <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/926103635/?value={{total_price | money_without_currency | remove: "," }}&currency_code=INR&oid={{order.order_number}}&label=7N54COf3_mQQ0_DMuQM&guid=ON&script=0"/>
76 </div>
77 </noscript>
78
79 <!-- google dynamic remarketing tag for order confirmation page -->
80 <script type="text/javascript">
81 var id = new Array();
82 {% for line_item in order.line_items %}
83 id.push('{{line_item.product.id}}_{{line_item.variant.id}}');
84 {% endfor %}
85 var google_tag_params = {
86 ecomm_prodid: id,
87 ecomm_pagetype: 'purchase',
88 ecomm_totalvalue: parseFloat('{{ subtotal_price | money_without_currency | remove: ","}}')
89 };
90 </script>
91
92 <script>
93 gtag('event', 'page_view', {
94 'send_to': 'AW-926103635',
95 'ecomm_pagetype': 'purchase',
96 'ecomm_prodid': id,
97 'ecomm_totalvalue': parseFloat('{{ subtotal_price | money_without_currency | remove: ","}}')
98 });
99 </script>
100 <!-- Google Code for Remarketing Tag -->
101 <script type="text/javascript">
102 /* <![CDATA[ */
103 var google_conversion_id = 926103635;
104 var google_custom_params = window.google_tag_params;
105 var google_remarketing_only = true;
106 /* ]]> */
107 </script>
108 <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
109 </script>
110 <noscript>
111 <div style="display:inline;">
112 <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/926103635/?value=0&guid=ON&script=0"/>
113 </div>
114 </noscript>
115
116 {% assign ordervalue = order.total_price | money_without_currency | replace:",","" %}
117 {% assign ordervalue_float = ordervalue | plus:0 %}
118 {% assign ordervalue_string = '' %}
119 {% assign ordervalue_string1 = '' %}
120
121 {% if ordervalue_float < 501 %}
122 {% assign ordervalue_string = 'aff_l?offer_id=10034&adv_sub=' %}
123 {% assign ordervalue_string1 = 'aff_l?offer_id=6736&adv_sub=' %}
124 {% else %}
125 {% if ordervalue_float > 500 and ordervalue_float < 1201 %}
126 {% assign ordervalue_string = 'aff_goal?a=l&goal_id=52&adv_sub=' %}
127 {% assign ordervalue_string1 = 'aff_goal?a=l&goal_id=574&adv_sub=' %}
128 {% else %}
129 {% assign ordervalue_string = 'aff_goal?a=l&goal_id=54&adv_sub=' %}
130 {% assign ordervalue_string1 = 'aff_goal?a=l&goal_id=576&adv_sub=' %}
131 {% endif %}
132 {% endif %}
133
134 <script type="text/javascript">
135 window._vis_opt_queue = window._vis_opt_queue || [];
136 {% assign _vis_opt_revenue = total_price | money_without_currency %}
137 window._vis_opt_queue.push(function() {
138 _vis_opt_revenue_conversion('{{ _vis_opt_revenue }}');
139 });
140 </script>
141 <!-- Recommendify's conversion tracking -->
142 <img src="https://www.recommendifyapp.com/conversion/trackingpixel.png?order={{ order_number }}{% for line_item in line_items %}&item{{ forloop.index }}={{ line_item.product.id }}{% endfor %}" width="1" height="1" />
143 <!-- Recommendify's conversion tracking end -->
144 <!-- Start Fanreel -->
145 <script id="crl8-snippet">
146 var CRL8_SITENAME = 'themancompany-dagkfm';
147 !function(){var e=window.crl8=window.crl8||{};e.pixel=e.pixel||function(){e.pixel.q.push(arguments)},e.pixel.q=e.pixel.q||[];var i=window.document,t=i.createElement("script"),n=e.debug||-1!==i.location.search.indexOf("crl8-debug=true")?"js":"min.js";t.src=i.location.protocol+"//cdn.curalate.com/sites/"+CRL8_SITENAME+"/site/latest/site."+n;var c=i.getElementsByTagName("script")[0];c.parentNode.insertBefore(t,c.nextSibling)}();
148 crl8.pixel('addTransactionInfo', {
149 'transactionId': '{{ checkout.id }}',
150 'userId': '{{ checkout.email }}',
151 'cartValue': '{{ checkout.total_price | money_without_currency }}',
152 'taxValue': '{{ checkout.tax_price | money_without_currency }}',
153 'shippingValue': '{{ checkout.shipping_price | money_without_currency }}',
154 'shippingCity': '{{ checkout.shipping_address }}',
155 'currency': '{{ shop.currency }}'
156 });
157 {% for item in checkout.line_items %}
158 crl8.pixel('addProduct', {
159 'productId': '{{ item.product_id }}',
160 'productName': '{{ item.title }}',
161 'price': '{{ item.price | money_without_currency }}',
162 'displayPrice': '{{ item.line_price | money_without_currency }}',
163 'quantity': '1',
164 'sku': '{{ item.sku }}'
165 });
166 {% endfor %}
167 crl8.pixel('send');
168 </script>
169 <!-- end Fanreel -->
170 <!--transaction tracking pixel -->
171 <iframe src="https://inls.in/p.ashx?o=122&e=91&t={{order_number}}&ect={{checkout.total_price | money_without_currency }}&p={{checkout.total_price | money_without_currency }}" height="1" width="1" frameborder="0"></iframe>
172 <!-- end transaction tracking pixel -->
173 <!-- google review -->
174 {% if customer.default_address.country | json == 'India' %}
175{% comment %}
176Delivery may take up to 7 days in this case so we're doing date + 7 days and assigning it.
177{% endcomment %}
178{% assign seconds = 7 | times: 24 | times: 60 | times: 60 %}
179<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
180<script>
181 window.renderOptIn = function() {
182 window.gapi.load('surveyoptin', function() {
183 window.gapi.surveyoptin.render(
184 {
185 // REQUIRED
186 "merchant_id": 111096629,
187 "order_id": "{{ order.name }}",
188 "email": "{{ customer.email }}",
189 "delivery_country": "IN",
190 "estimated_delivery_date": "{{ order.created_at | date: "%s" | plus: seconds | date:'%F' }}",
191 // OPTIONAL
192 "opt_in_style": "CENTRE_DIALOG"
193 });
194 });
195 }
196</script>
197{% endif %}
198<!-- end google review -->
199<script language="javascript" type="text/javascript">
200 function getCookie(cValue) {
201 var name = cValue + "=";
202 var ca = document.cookie.split(';');
203 for(var i=0; i<ca.length; i++) {
204 var c = ca[i];
205 while (c.charAt(0)==' ') c = c.substring(1);
206 if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
207 }
208 return "";
209 }
210</script>
211<!-- Conversion Tag
212This tag must be fired on the conversion page only.
213You must add the product id list (separated by comma) variable to the pId and those IDs MUST be the same mapped on the feed file. Nonetheless, you also have to fulfill the "revenue" variable with the total cost and "orderId" with the ID generated by the sale.
214-->
215<script type="text/javascript" src="//event.getblue.io/js/blue-tag.min.js" async="true"></script>
216<script type="text/javascript">
217window.blue_q = window.blue_q || [];
218window.blue_q.push(
219 {event: "setCampaignId", value: "5B9AF1F7-B388-F67F-A3AB55FA97B63033"}
220 ,{event: "setProductId", value: "{% for line_item in order.line_items %}{{line_item.product.id}},{% endfor %}"}
221 ,{event: "setTransactionTotal", value: "{{order.total_price | money_without_currency }}"}
222 ,{event: "setTransactionId", value: "{{ order_number }}"}
223 ,{event: "setPageType", value: "conversion"}
224 );
225</script>
226
227<!-- Event snippet for TMC - Ads conversion page -->
228<script>
229gtag('event', 'conversion', {
230 'send_to': 'AW-778363241/pKyECNj8yI8BEOnCk_MC',
231 'value': {{ total_price | money_without_currency | remove: "," }},
232 'currency': 'INR',
233 'transaction_id': '{{ order.order_number }}'
234});
235</script>
236
237<!-- Offer Conversion: The Man Company CPS -->
238{%- for transaction in order.transactions -%}
239{%- assign gateway_name = transaction.gateway -%}
240{%- endfor -%}
241<div class="hide gateway_name">{{gateway_name}}</div>
242<!-- // End Offer Conversion -->
243
244
245<!-- AUTO IN in tel -->
246<script type="text/javascript">
247try{
248 window.onload = function(){
249 var telSelect = document.getElementsByClassName("flag-selector__select")[0];
250 telSelect.value = "IN";
251 telSelect.dispatchEvent(new Event('change'));
252 }
253}
254catch(e){
255}
256</script>
257<!-- End of auto IN in tel -->
258
259
260
261<!-- Facebook pixel -->
262<!--Offer Conversion: -->
263<img src="https://tracking.affonix.com/success.jpg?afsecure=2eb6c658a641d466254f76bcff673d6c&afid={{order_number}}&afprice={{order.total_price | money_without_currency}}&afstatus=1" height="1" width="1" alt="" />
264<!-- End Offer Conversion -->
265<!-- End Facebook pixel -->
266
267<!--
268Event snippet for tmc_global_tag on : Please do not remove.
269Place this snippet on pages with events you’re tracking.
270Creation date: 09/20/2019
271-->
272<script>
273gtag('event', 'purchase', {
274 'allow_custom_scripts': true,
275 'value': '{{order.total_price | money_without_currency}}',
276 'transaction_id': '{{order_number}}',
277 'send_to': 'DC-9649151/sales/tmc_g0+transactions'
278});
279</script>
280<noscript>
281<img src="https://ad.doubleclick.net/ddm/activity/src=9649151;type=sales;cat=tmc_g0;qty=1;cost={{order.total_price | money_without_currency}};dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;ord={{order_number}}?" width="1" height="1" alt=""/>
282</noscript>
283<!-- End of event snippet: Please do not remove -->
284<!-- Added on 11-Nov-2019 start -->
285<script data-obct type="text/javascript">
286/** DO NOT MODIFY THIS CODE**/
287!function(_window, _document) {
288 var OB_ADV_ID='00bacd09110773ae2370c3c2e682a7207c';
289 if (_window.obApi) {var toArray = function(object) {return Object.prototype.toString.call(object) === '[object Array]' ? object : [object];};_window.obApi.marketerId = toArray(_window.obApi.marketerId).concat(toArray(OB_ADV_ID));return;}
290 var api = _window.obApi = function() {api.dispatch ? api.dispatch.apply(api, arguments) : api.queue.push(arguments);};api.version = '1.1';api.loaded = true;api.marketerId = OB_ADV_ID;api.queue = [];var tag = _document.createElement('script');tag.async = true;tag.src = '//amplify.outbrain.com/cp/obtp.js';tag.type = 'text/javascript';var script = _document.getElementsByTagName('script')[0];script.parentNode.insertBefore(tag, script);}(window, document);
291obApi('track', 'PAGE_VIEW');
292</script>
293<!-- Added on 11-Nov-2019 end -->
294
295
296
297
298<script src="//themancompany.refersion.com/tracker/v3/pub_e48f4c17b63496401440.js"></script>
299<script>
300_refersion(function(){
301 _rfsn._setSource('SHOPIFY-js');
302});
303_refersion(function(){
304 _rfsn._addTrans({
305 'order_id': '{{ order.order_number }}',
306 'shipping': Shopify.checkout.shipping_rate == null ? '' : Shopify.checkout.shipping_rate.price,
307 'tax': Shopify.checkout.total_tax == null ? 0 : Shopify.checkout.total_tax,
308 'discount': Shopify.checkout.discount == null ? 0 : Shopify.checkout.discount.amount,
309 'discount_code': Shopify.checkout.discount == null ? '' : Shopify.checkout.discount.code,
310 'currency_code': typeof Shopify.checkout.currency !== typeof undefined ? Shopify.checkout.currency : 'USD' // USD IS THE DFAULT, OTHERWISE PLEASE CHANGE
311 });
312 _rfsn._addCustomer({
313 'first_name': '{{ order.customer.first_name }}',
314 'last_name': '{{ order.customer.last_name }}',
315 'email': typeof Shopify.checkout.email !== typeof undefined ? Shopify.checkout.email : '{{ order.email }}',
316 'ip_address': ''
317 });
318 for (var key in Shopify.checkout.line_items) {
319 if (Shopify.checkout.line_items.hasOwnProperty(key)) {
320 _rfsn._addItem({
321 'sku': Shopify.checkout.line_items[key].sku,
322 'quantity': Number(Shopify.checkout.line_items[key].quantity),
323 'price': Number(Shopify.checkout.line_items[key].price)
324 });
325 }
326 }
327 _rfsn._sendConversion();
328});
329</script>
330
331<script src="//themancompany.refersion.com/tracker/v3/pub_e48f4c17b63496401440.js"></script>
332<script src="//cdn.refersion.com/refersion_md5.js"></script>
333<script type="text/javascript">
334function runOnLoad(){_refersion(function(){_rfsn._addCart(refersion_MD5('{{order_number}}'+'{{customer.first_name}}'+'{{customer.last_name}}'))})}
335if(window.addEventListener)
336window.addEventListener("load",runOnLoad,!1);else if(window.attachEvent)
337window.attachEvent("onload",runOnLoad);else window.onload=runOnLoad
338</script>
339
340
341
342
343<!-- 31-01-20 start -->
344<!--
345 Event snippet for tmc_global_tag on : Please do not remove.
346 Place this snippet on pages with events you’re tracking.
347 Creation date: 01/20/2020
348-->
349
350{% assign handles = "" %}
351{% for line_item in order.line_items %}
352 {% assign handle = line_item.product.handle | append: '"' | prepend: '"' %}
353 {% if forloop.last %}
354 {% assign handles = handles | append: handle %}
355 {% else %}
356 {% assign handles = handles | append: handle | append: " " %}
357 {% endif %}
358{% endfor %}
359
360{% assign handles = handles | replace: ' ', ',' %}
361
362<script>
363 var handles = [{{handles }}]
364
365 gtag('event', 'purchase', {
366 'allow_custom_scripts': true,
367 'value': '{{order.total_price | money_without_currency}}',
368 'transaction_id': '{{order.order_number}}',
369 'u1': [],
370 'u2': [{{handles}}],
371 'send_to': 'DC-9649151/sales/tmc_g0+transactions'
372 });
373</script>
374<noscript>
375<img src="https://ad.doubleclick.net/ddm/activity/src=9649151;type=sales;cat=tmc_g0;qty=1;cost={{order.total_price | money_without_currency}};u1=[];u2=[{{handles}}];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;ord={{order.order_number}}?" width="1" height="1" alt=""/>
376</noscript>
377<!-- End of event snippet: Please do not remove -->
378
379
380
381<!-- chamko -->
382<!-- Added on 12-03-2020 start -->
383<img src="https://track.chamko.me/conversion.gif?cid={{ customer.id | remove: "'" }}&payout={{order.total_price | money_without_currency}}&txid={{order.order_number}}" width="1" height="1"/>
384<!-- Added on 12-03-2020 end -->
385
386<!----Conversion Pixel for Themancompany CPS starts ------->
387<iframe src="https://gopaisa.go2pixel.org/c/?offer_id=71&orderAmount={{order.total_price | money_without_currency}}&customerGroup=&orderID={{order.order_number}}" height="0" width="0"></iframe>
388 <!----Conversion Pixel for Themancompany CPS ends ------->
389
390<!--Hashtag orange Pixel start-->
391<img src="https://sense.offserve.org/conv?offer_id=4286&adv_sub1={{order.order_number}}&amount={{order.total_price | money_without_currency}}" height="1" width="1"/>
392<!--Hashtag orange Pixel end-->
393
394
395<!-- // Offer Conversion: The Man Company CPS -->
396<iframe src="https://refp.cubetip.com/aff_l?offer_id=209&adv_sub={{order.order_number}}&amount={{order.total_price | money_without_currency}}&adv_sub2=" scrolling="no" frameborder="0" width="1" height="1"></iframe>
397<!-- // End Offer Conversion -->
398
399<!-- CPS Campaign start -->
400{% assign commission_price = order.total_price | | times: 25 | divided_by: 10000.0 %}
401{% for item in order.line_items %}
402{% assign product_titles = product_titles | append: item.title | append: ','%}
403{% endfor %}
404<iframe src="https://tracking.xapads.com/success.php?offer_id=4793&afgoal=sale&sum={{commission_price}}&afstatus=1&custom_field1={{order.order_number}}&custom_field2={{order.total_price | money_without_currency}}&custom_field3=&custom_field4={{shop.currency}}&custom_field5={{product_titles}}&custom_field6={{shop.address.country}}&custom_field7=" height="1" width="1" />
405<!-- CPS Campaign end -->
406
407<!-- Offer Conversion: Themancompany.com -IN -->
408<img src="https://affnetmed.go2cloud.org/aff_l?offer_id=306&adv_sub={{order.order_number}}&amount={{order.total_price | money_without_currency}}" width="1" height="1" /></iframe>
409<!-- // End Offer Conversion -->
410
411
412
413<!-- Offer Conversion: Man Company -->
414<img src="http://pokktweb.go2cloud.org/aff_l?offer_id=322&adv_sub={{order.order_number}}&amount={{order.total_price | money_without_currency}}" width="1" height="1" />
415<!-- // End Offer Conversion -->
416
417<!-- Global site tag (gtag.js) - Google Ads: 482284913 START -->
418<script async src="https://www.googletagmanager.com/gtag/js?id=AW-482284913"></script>
419<script>
420 window.dataLayer = window.dataLayer || [];
421 function gtag(){dataLayer.push(arguments);}
422 gtag('js', new Date());
423
424 gtag('config', 'AW-482284913');
425</script>
426<!-- Global site tag (gtag.js) - Google Ads: 482284913 END -->
427
428<!-- Event snippet for Purchase conversion page START -->
429<script>
430 gtag('event', 'conversion', {
431 'send_to': 'AW-482284913/T7brCKexmuYBEPGq_OUB',
432 'value': 1.0,
433 'currency': 'INR',
434 'transaction_id': ''
435 });
436</script>
437<!-- Event snippet for Purchase conversion page END -->
438
439<!-- Affoy Pixel 09-Dec-2020 -->
440<script>
441getCookie = function() {
442 var name = 'utm_source' + "=";
443 var ca = document.cookie.split(';');
444 var html = `<iframe src="https://trk.affoy.com/pixel?adid=5ed64397b6920d64f079ce1e&txn_id={{order.order_number}}&sale_amount={{order.total_price | money_without_currency }}" scrolling="no" frameborder="0" width="1" height="1"></iframe>`;
445 for (var i = 0; i < ca.length; i++) {
446 var c = ca[i];
447 if (c.includes(name)) {
448 document.body.innerHTML += html;
449 }
450 }
451 return "";
452};
453//getCookie();
454</script>
455<!-- End of Affoy Pixel 09-Dec-2020 -->
456
457<!-- GA API integration (16/12/2020)-->
458<!-- Global site tag (gtag.js) - Google Analytics -->
459<script async src="https://www.googletagmanager.com/gtag/js?id=UA-66061979-1"></script>
460
461<!-- Google Analytics Ecommerce with custom dimensions for Admitad -->
462<script>
463window.dataLayer = window.dataLayer || [];
464
465function gtag() {
466 dataLayer.push(arguments);
467}
468gtag('js', new Date());
469
470gtag('config', 'UA-66061979-1'); // instead of UA-66061979-1 here and in the next string, specify the tracking id of your GA
471gtag('config', 'UA-66061979-1', {
472 'custom_map': {
473 'dimensionX': '2',
474 'dimensionX': '6',
475 'dimensionX': '3',
476 'dimensionX': '4',
477 'dimensionX': '7',
478 'dimensionX': '8'
479 } // for dimensionX, instead of Х insert indexes of the parameters you created in step 3
480
481});
482
483ga_items = [];
484
485var list_position = 1;
486
487// this fragment should be repeated for each item in the chart
488ga_items.push({
489 "id": "{{ item.product_id }}",
490 "name": "{{ item.product_title }}",
491 "quantity": "{{ item.quantity }}",
492 "price": "{{ item.price }}",
493 "category": "{{ item.product_type }}",
494 "list_position": list_position,
495 "variant": "{{ item.variant }}",
496 "brand": "{{ item.brand }}",
497});
498list_position = list_position + 1;
499// end of the repeated fragment
500
501function getTimeStamp() {
502 var now = new Date();
503 var tzo = -now.getTimezoneOffset();
504 var dif = tzo >= 0 ? '+' : '-';
505 var pad = function(num) {
506 var norm = Math.abs(Math.floor(num));
507 return (norm < 10 ? '0' : '') + norm;
508 };
509 return now.getFullYear() + '-' + pad(now.getMonth() + 1) + '-' + pad(now.getDate()) + 'T' + pad(now.getHours()) + ':' + pad(now.getMinutes()) + ':' + pad(now.getSeconds()) + '.' + pad(now.getMilliseconds()) + dif + pad(tzo / 60) + ':' + pad(tzo % 60);
510}
511
512function clientid() {
513 var match = document.cookie.match('(?:^|;)\\s*_ga=([^;]*)');
514 var raw = (match) ? decodeURIComponent(match[1]) : null;
515 if (raw) {
516 match = raw.match(/(\d+.\d+)$/);
517 }
518 var gacid = (match) ? match[1] : null;
519 if (gacid) {
520 return gacid;
521 }
522}
523
524function getSessionId() {
525 return new Date().getTime() +
526 '.' + Math.random().toString(36).substring(5);
527}
528
529function uuidv4() {
530 return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) {return (c ^ (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)});
531 }
532
533gtag('event', 'purchase', {
534 "transaction_id": "{{ order_number }}",
535 "affiliation": "",
536 "currency": "{{ shop.currency }}",
537 "shipping": "{{ shipping_price }}",
538 "items": ga_items,
539 "action_code": "{{ action_code }}", // transmit values specified during the integration
540 "tariff_code": "{{ tariff_code }}", // transmit values specified during the integration
541 "suid": uuidv4(),
542 "client_id": clientid(),
543 "user_id": "{{customer.id}}", // if the ID is unknown transmit an empty string. See more on the User ID set-up
544 "session_id": getSessionId(),
545 "hit_id": getTimeStamp(),
546});
547</script>
548<!-- End of GA API integration (16/12/2020)-->
549
550
551<!-- Conditional Pixel 05-Mar-2021 -->
552<script>
553 readcookie = function(e){
554 for (var t = e + "=", n = document.cookie.split(";"), i = 0; i < n.length; i++) {
555 for (var o = n[i]; " " === o.charAt(0);)
556 o = o.substring(1);
557 if (0 === o.indexOf(t))
558 return o.substring(t.length, o.length)
559 }
560 return ""
561 }
562 setPixel = function() {
563 var name = 'lastClickPixelName' + "=";
564 var ca = document.cookie.split(';');
565 var htmlContent = '';
566 var totalPrice = {{order.total_price | money_without_currency}};
567 var orderNumber = {{order.order_number}};
568 var id = readcookie('admitad_uid');
569 for (var i = 0; i < ca.length; i++) {
570 var c = ca[i];
571 if (c.includes(name)) {
572 var value = c.split('=')[1].toLowerCase();
573 switch (value) {
574 case 'admitad':
575 htmlContent = `<iframe src="https://ad.admitad.com/r?campaign_code=85e739f524&action_code=1&uid=${id}&order_id=${orderNumber}&tariff_code=1&price=${totalPrice}&payment_type=sale¤cy_code=INR" width="1" height="1" alt=""></iframe>`;
576 break;
577 case 'opicle':
578 htmlContent = `<iframe src='https://krapto.com/p.ashx?o=1102&e=507&udid=${orderNumber}&ect=${totalPrice}&p=${totalPrice}' height='1' width='1' frameborder='0'></iframe>`;
579 break;
580 case 'affrise':
581 var scriptOne = document.createElement('script');
582 var scriptTwo = document.createElement('script');
583 scriptOne.type = 'text/javascript';
584 scriptOne.src = 'https://webtrafficsource.com/js/v1/rtg.js';
585 scriptTwo.type = 'text/javascript';
586 scriptTwo.innerHTML = `window.wwData = window.wwData || [];
587 window.wwData.push(
588 { event: "ACCOUNT", account: "5f193e6cd915b84cd6066eaa" },
589 { event: "TX_ID", id: "${orderNumber}" },
590 { event: "CLICK_ID", id: "{click_id}" },
591 { event: "TOTAL", value: "${totalPrice}" }
592 );`;
593 document.body.appendChild(scriptOne);
594 document.body.appendChild(scriptTwo);
595 break;
596 case 'pokket':
597 htmlContent = `<iframe src="https://pokktweb.go2cloud.org/aff_l?offer_id=322&adv_sub=${orderNumber}&aff_sub=SUB_ID&amount=${totalPrice}" scrolling="no" frameborder="0" width="1" height="1"></iframe>`;
598 break;
599 case 'vcommission':
600 htmlContent = `<iframe src="https://tracking.vcommission.com/SLH3N?adv_sub=${orderNumber}&adv_sub2=Modeofpayment&amount=${totalPrice}" scrolling="no" frameborder="0" width="1" height="1"></iframe>`;
601 break;
602 case 'affnads':
603 htmlContent = `<iframe src="https://affnads.affsure.com/trackcn/?offer_id=1056" &adv_sub=SUB_ID&amount=${totalPrice} scrolling="no" frameborder="0" height="1" width="1" /></iframe />`;
604 break;
605 }
606 }
607 };
608 if(htmlContent){
609 var div = document.createElement('div');
610 div.innerHTML = htmlContent;
611 document.body.appendChild(div);
612 }
613 }
614 setPixel();
615</script>
616<!-- End Conditional Pixel 05-Mar-2021 -->
617{% endif %}