How to add visit tracking code on each product page

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

.dtpcnt{opacity: 0;}

@sethkeshav92 - put this code before in you theme.liquid file and check

@suyash1

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” %}

.dtpcnt{opacity: 0;}

{% endif %}

Hope this helps, let us know if you need any further help.

All the best,

CedCommerce

1 Like

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 , and check if you get any error in console section of browser, many times other javascript conflicts do not allow it to work

1 Like

yes 2 errors showing up

kindly look into the attached ppt