The canonical tag is a link element placed in the header section of web pages either when a URL may have different query string parameters or where the content on the URL may be duplicated on other internal pages or on other websites. In cases when a URL contains query string parameters (i.e. url.com/page.html, url.com/page.html?view=1, url.com/page.html?view=2), then a canonical tag should be added to the header of the web page to prevent search engines from treating each version of the URL as a unique page with duplicate content. The canonical tag informs search engines that the URL in the canonical tag should be considered the only source for the content to be included in their search results. Example canonical element:
<link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />.