Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I m using an affiliate platform voluum
this platform give a visit trackking script to be added to each product page of any website platform
but i dont know how and wher to put it in shopify panel
we were able to add it to product pages of php website properly and it works as well
but here in shopify i m not sure
@suyash1 can you help here as well
like in https://community.shopify.com/c/shopify-design/adding-tracking-script-to-every-page/m-p/972725
script from voluum
<meta http-equiv="delegate-ch" content="sec-ch-ua https://resuestedformotels.com; sec-ch-ua-mobile https://resuestedformotels.com; sec-ch-ua-arch https://resuestedformotels.com; sec-ch-ua-model https://resuestedformotels.com; sec-ch-ua-platform https://resuestedformotels.com; sec-ch-ua-platform-version https://resuestedformotels.com; sec-ch-ua-bitness https://resuestedformotels.com; sec-ch-ua-full-version-list https://resuestedformotels.com; sec-ch-ua-full-version https://resuestedformotels.com"><style>.dtpcnt{opacity: 0;}</style>
<script>
(function(c,a,f,q,b,m,r,g,h,k,d,n,e,p){p="https:"===c.location.protocol?"secure; ":"";c[b]||(c[b]=function(a){c[b].state.callbackQueue.push(a)},c[b].state={callbackQueue:[]},c[b].registerConversion=function(a){c[b].state.callbackQueue.push(a)},function(){(k=/[?&]cpid(=([^&#]*)|&|#|$)/.exec(c.location.href))&&k[2]&&(d=k[2],n=a.cookie.match(new RegExp("(^| )vl-"+d+"=([^;]+)")));var b=a.cookie.match(/(^| )vl-cid=([^;]+)/),l;"savedCid"!==r||!b||d&&"undefined"!==typeof d||(l=b.pop());g=a.createElement("script");
h=a.scripts[0];g.src=m+(-1===m.indexOf("?")?"?":"&")+"oref="+f(a.referrer)+"&ourl="+f(location[q])+"&opt="+f(a.title)+"&vtm="+(new Date).getTime()+(l?"&cid="+l:"")+(n?"&uw=no":"");h.parentNode.insertBefore(g,h);d&&(e=new Date,e.setTime(e.getTime()+864E5),a.cookie="vl-"+d+"=1; "+p+"samesite=Strict; expires="+e.toGMTString()+"; path=/")}())})(window,document,encodeURIComponent,"href","dtpCallback","https://resuestedformotels.com/d/.js","savedCid");
</script>
<noscript><link href="https://resuestedformotels.com/d/.js?noscript=true&ourl=" rel="stylesheet"/></noscript>
@sethkeshav92 - put this code before </head> in you theme.liquid file and check
thanks I just copy pasted this code in a test store I created just to seee where the code should be added and then tried to access store link but visit didnt get recorded
1- dircetly copy pasted - didnt work
2- copied, pasted line by linethinking some error with formatting
can you suggest further
Hello @sethkeshav92,
You need to run the below script on the product page if want to track the visitors on the product page.
Simply paste the code under the condition that it will run only on your product page:-
Here is your code with the condition:-
{% if template.name contains "product" %}
<meta http-equiv="delegate-ch" content="sec-ch-ua https://resuestedformotels.com; sec-ch-ua-mobile https://resuestedformotels.com; sec-ch-ua-arch https://resuestedformotels.com; sec-ch-ua-model https://resuestedformotels.com; sec-ch-ua-platform https://resuestedformotels.com; sec-ch-ua-platform-version https://resuestedformotels.com; sec-ch-ua-bitness https://resuestedformotels.com; sec-ch-ua-full-version-list https://resuestedformotels.com; sec-ch-ua-full-version https://resuestedformotels.com">
<style>.dtpcnt{opacity: 0;}</style>
<script>
(function(c,a,f,q,b,m,r,g,h,k,d,n,e,p){p="https:"===c.location.protocol?"secure; ":"";c[b]||(c[b]=function(a) {c[b].state.callbackQueue.push(a)},c[b].state={callbackQueue:[]},c[b].registerConversion=function(a){c[b].state.callbackQueue.push(a)},function(){(k=/[?&]cpid(=([^&#]*)|&|#|$)/.exec(c.location.href))&&k[2]&&(d=k[2],n=a.cookie.match(new RegExp("(^| )vl-"+d+"=([^;]+)")));var b=a.cookie.match(/(^| )vl-cid=([^;]+)/),l;"savedCid"!==r||!b||d&&"undefined"!==typeof d||(l=b.pop());g=a.createElement("script");
h=a.scripts[0];g.src=m+(-1===m.indexOf("?")?"?":"&")+"oref="+f(a.referrer)+"&ourl="+f(location[q])+"&opt="+f(a.title)+"&vtm="+(new Date).getTime()+(l?"&cid="+l:"")+(n?"&uw=no":"");h.parentNode.insertBefore(g,h);d&&(e=new Date,e.setTime(e.getTime()+864E5),a.cookie="vl-"+d+"=1; "+p+"samesite=Strict; expires="+e.toGMTString()+"; path=/")}())})(window,document,encodeURIComponent,"href","dtpCallback","https://resuestedformotels.com/d/.js","savedCid");
</script>
<noscript><link href="https://resuestedformotels.com/d/.js?noscript=true&ourl=" rel="stylesheet"/></noscript>
{% endif %}
Hope this helps, let us know if you need any further help.
All the best,
CedCommerce
Thank you, I'll check it now and get back with an update
no luck with this
just tried after copy pasting code from line 247 to 261
@sethkeshav92 - add code before </head> , and check if you get any error in console section of browser, many times other javascript conflicts do not allow it to work
yes 2 errors showing up
kindly look into the attached ppt
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025