I'm building a shop using Craft Commerce where a single product can be assigned to multiple categories. The url structure I'm using for the product detail page is: http://domain.com/category/product-url
In an effort to avoid being penalised for duplicate content I would like to set the canonical URL for my product detail page by always pulling the first category as the canonical URL in the meta. I've tried a few things but keep getting stuck - any tips ?