Hello,
Our advertising team sent over six snippets to add to our website for Amazon tracking.
These pixels need to fire only on specific pages/products.
What’s the best way to do this? Our website has been optimized so all of our scripts are in a single file (example attached).
Is there a liquid conditional statement that can be run to only fire these pixels on the correct pages?
Thank you!
Litos
2
Hi @BirdhouseUSA ,
You can use handle object to condition it. Refer https://shopify.dev/api/liquid/objects/product#product-handle
For example:
{% if product.handle == 'handle cleaning kit product' %}
{% endif %}
Hope it helps!
1 Like
Thank you Litos! I removed the word “handle” from after the ==’ and it worked like a charm!
{% if product.handle == ‘handle leather-honey-leather-conditioner’ %}
{% endif %}
1 Like
Litos
4
Hi @BirdhouseUSA ,
The handle in the tutorial is just for you to better understand where to enter, so when you get the handle and replace it will work fine.
Hope it is clear to you.
1 Like