I was doing some research into page duplicate content for dynamic keyword insertion via a GET parameter if definded, if not it will default to a definded value.
Would it be a benefit to set up a quick PHP check in the page head where by if a GET parameter is present it will automatically insert a canonical tag with the GET parameters stripped out?
Will this solve the issue of duplicate content for the page(s)?
It's worth mentioning the dynamic GET parameters will only be present when passed by ad networks such as AdWords.
Your idea is certainly possible, but there is an even better solution: always provide the canonical
URL, even if it’s self-referential.
<!-- on http://example.com/posts/1 -->
<link rel="canonical" href="http://example.com/posts/1">
<!-- on http://example.com/posts/1?tracking=123 -->
<link rel="canonical" href="http://example.com/posts/1">
<!-- on http://example.com/posts//////1?a-URL-you-never-expected -->
<link rel="canonical" href="http://example.com/posts/1">
Benefits: