Solved

How to add pixel to only a single page?

ayjc123
Visitor
2 0 1

Hi,  I'm trying to add a pixel to only a single page on my shopify store. The purpose of this pixel is to filter out bot traffic coming in from ruining ad costs and I've connected with a third-party app for this. The problem is that I don't know how to add a pixel to a single page (specifically my home page).

I'm doing this via a manual pixel set up on Tiktok ad platform, and I have the pixel code ready. Just don't know the extra coding to only apply it to my home page. Any help is greatly appreciated. 

Thanks.

Accepted Solution (1)

Dan-From-Ryviu
Shopify Partner
7546 1454 1452

This is an accepted solution.

Hi @ayjc123 

You can wrap your code into this code below to theme.liquid file to add code to your homepage only 

{% if template == 'index' %}
add your pixel code here
{% endif %}

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now

View solution in original post

Reply 1 (1)

Dan-From-Ryviu
Shopify Partner
7546 1454 1452

This is an accepted solution.

Hi @ayjc123 

You can wrap your code into this code below to theme.liquid file to add code to your homepage only 

{% if template == 'index' %}
add your pixel code here
{% endif %}

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now