How to add a pixel to only one page on my store?

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 all.

Hello @storetool

This is Amelia at PageFly - Shopify Advanced Page Builder app.

You can try the following steps I have provided to help you solve the problem you are facing:

Step 1: Online Store → Themes → Edit Code

Step 2: Choose file theme.liquid

Step 3: Add code above the tag

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

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

1 Like