Body: <p>Global category content canonical URL pattern seems to set og:url, but not the canonical one. I've tried replacing <code>@web</code> with the address proper without any change. I suspect I've misconfigured something.</p>
  <p>The category group's URL pattern is: <code>product-categories/{slug}</code>,
  and it's canonical URL in content SEO is: <code>@web/products/{category.slug}</code>.
  A custom route loads the template: <code>products/{tag}</code>.
  Which does a: <code>seomatic.helper.loadMetadataForUri(category.uri)</code>.</p>
  <p>However,</p>
  <p>In a category's SEO preview the canonical URL is still <code>product-categories/{slug}</code>.
  While in the header of a <code>product/{category}</code> page the canonical URL link isn't present.</p>
  <p>Adding a link with <code>seomatic.link.create({&quot;rel&quot;: &quot;canonical&quot;,&quot;href&quot;: canonicalUrl,})</code> works like a charm.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T13:25:43.870Z
Comments.Text: What do you have the Canonical URL set to in Content SEO for your Category Group?
Comments.UserDisplayName: andrew.welch
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-10T21:21:07.587Z
Comments.Text: That's that `@web/products/{category.slug}`.
Comments.UserDisplayName: ponies
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-07T12:58:36.163Z
Comments.Text: Old question, I know, but still. Have you tried using `{% do seomatic.meta.canonicalUrl( seomatic.helper.safeCanonicalUrl() ) %}`
Comments.UserDisplayName: InanisAtheos
Tags: <plugin-seomatic>
Title: Set category's canonical URL on a custom route
ThreadText: # Set category's canonical URL on a custom route
  
  (Asked by: username_0 on 2020-08-06)
  
  Global category content canonical URL pattern seems to set og:url, but not the canonical one. I've tried replacing `@web` with the address proper without any change. I suspect I've misconfigured something.
  
  The category group's URL pattern is: `product-categories/{slug}`,
  and it's canonical URL in content SEO is: `@web/products/{category.slug}`.
  A custom route loads the template: `products/{tag}`.
  Which does a: `seomatic.helper.loadMetadataForUri(category.uri)`.
  
  However,
  
  In a category's SEO preview the canonical URL is still `product-categories/{slug}`.
  While in the header of a `product/{category}` page the canonical URL link isn't present.
  
  Adding a link with `seomatic.link.create({"rel": "canonical","href": canonicalUrl,})` works like a charm.
  
  **Tags:** plugin-seomatic
  
  > **Comments:**
  > **username_1**: What do you have the Canonical URL set to in Content SEO for your Category Group?  
  > **username_0**: That's that `@web/products/{category.slug}`.  
  > **username_2**: Old question, I know, but still. Have you tried using `{% do seomatic.meta.canonicalUrl( seomatic.helper.safeCanonicalUrl() ) %}`  
  
  ---
  
  ## 0 answers
  
  