Further, and I think more importantly, Shopify seems to use ‘canonical tags’ to indicate to search engines the preferred URL for a particular page. Inspect the source of any product page and you’d see the canonical tag implemented to specify the preferred URL for the product page as ‘domain.com/products/product-handle’ and not ‘domain.com/collections/collection-handle/products/product-handle’
The link in the souce code would be something like:
I investigated the canonical_url and stumbled upon a guide from Shopify, here’s a good excerpt:
“In Shopify, the canonical_url object returns the canonical URL for the current page. The canonical URL is the page’s “default” URL with any URL parameters removed. It can be output like this: {{ canonical_url }}. For Shopify products and variants, the canonical URL output is the default product page with no collection or variant selected.”
In other words, it makes no sense to delete the collection reference in product’s URLs parameters since canonical tags tell search engine which URL is the preferred URL. The collection reference is also useful to understand visitor’s page paths.