As far as I know, canonical URLs are only recognized by search engines - a way to ensure that when a search engine crawls your page, no matter which URL got it there, all of the "link juice" points to one canonical URL. So on a DNN site when example.com/, example.com/Default.aspx, example.com/tabid/36/Default.aspx, example.com/home/tabid/36/Default.aspx are all URLS for the homepage, a search engine can compress them all into one listing in it's index rather than diluting the PageRank across several URLs.
My question is whether canonical URLs are recognized by Google Analytics, or if there is any other trick to keep that same home page from showing up as 5 or 6 different pages (URLs) in Analytics.
A canonical URL is the URL of the best representative page from a group of duplicate pages, according to Google. For example, if you have two URLs for the same page (such as example.com? dress=1234 and example.com/dresses/1234 ), Google chooses one as canonical.
A canonical URL is used when all versions of the page should be accessible to visitors but only one of them should be indexed by search engines. A 301 redirect forwards both visitors and search engines from one URL to another URL. A redirected URL is not accessible for visitors or search engines.
Canonicals vs. While a redirect is a directive (it literally directs you to another page) a canonical tag is only a hint to search engines. That's a key difference that explains when to use one vs. the other. It's worth considering that whenever you use a canonical tag, a search engine may choose to ignore it.
A Canonical URL is an HTML tag in the <head> section of a web page. The best way to show the search engine which page URL has the original content.
Not recognized by default. But it's easy to setup GA to track the canonical urls when they are available.
instead of calling
_gaq.push(['_trackPageview']);
You can use:
var canonical_link; try{ canonical_link = jQuery('link[rel=canonical]').attr('href').split(location.hostname)[1] || undefined; } catch(e){ canonical_link = undefined; } _gaq.push(['_trackPageview', canonical_link]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With