Canonical URLs matter for AI answers because they tell the retrieval layer which single URL should carry the citation credit when the same content is reachable at multiple addresses — without a canonical, the model may cite the wrong copy or split authority across duplicates.
Google's canonicalization documentation defines the mechanism: a <link rel="canonical"> in the HTML head, an og:url matching it, and, ideally, the same URL declared in mainEntityOfPage inside JSON-LD. Google uses those signals, plus internal linking and sitemap membership, to pick the canonical.
For AI answers the failure mode is subtle. A page reachable at both example.com/answer and example.com/answer?utm=x, with no canonical, may end up cited as the tracking-parameter version — an ugly and often broken URL. Syndicated content is worse: without a canonical pointing at the master publisher, the model may attribute the answer to the syndication copy.
Three rules cover most cases. (1) Every page self-canonicals unless it is genuinely a copy — then it canonicals to the master. (2) The canonical URL and og:url match exactly. (3) The @id anchors in JSON-LD sit on the canonical URL, so the entity graph resolves on the right host.
Test the deployed page with curl and confirm the link rel="canonical" tag is present in the raw HTML. If it depends on JavaScript to inject, most AI crawlers will never see it.