You could check the URL and then run code when it matches some value, like your collection page.
var url = window.location.href;
if(url.indexOf("/collection/testitem") > -1) {
alert("This is the test item");
}
You could check the URL and then run code when it matches some value, like your collection page.
var url = window.location.href;
if(url.indexOf("/collection/testitem") > -1) {
alert("This is the test item");
}