How to add digital Tracking Tag to one specific collection?

Solved
Jason_Shaw
New Member
2 0 0

Hello,

 

I've successfully added the following tracking tag to my theme.liquid and it works perfectly.  However, I'd really like to begin targeting specific collections within my store.  How do I add this sort of tag to one specific collection?

 

<script type="text/javascript" src="//tag.mydomain.com/autoscript/anotherdomain_aksdfkhasfdhakdjfvfzst/anotherdomain.js"></script>

Thanks, Jason

Accepted Solution (1)

Accepted Solutions
PaulNewton
Shopify Partner
4207 303 899

This is an accepted solution.

Two options using a property of the collection or alternate templates

 

#1 Use the collection handle or ID

{% if collection.handle == "handle" %}

{% endif %} 

 

#2 Otherwise copy your collection template into an alternate template then in you admin manually assign it to the specific collection

The second way can help lower how often you have to edit code

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com

View solution in original post

Replies 2 (2)
PaulNewton
Shopify Partner
4207 303 899

This is an accepted solution.

Two options using a property of the collection or alternate templates

 

#1 Use the collection handle or ID

{% if collection.handle == "handle" %}

{% endif %} 

 

#2 Otherwise copy your collection template into an alternate template then in you admin manually assign it to the specific collection

The second way can help lower how often you have to edit code

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
Jason_Shaw
New Member
2 0 0

Thank you!  I'll try that.