Canonicalizing URLs is a very important aspect of Search Engine Optimization but also of Social Media Marketing. This morning, when checking my feeds, I noticed an example that I thought could help you understand the what and the why of it. What I noticed was this: Smashing Magazine had put out one of their usually very popular “100 … WordPress themes” posts. This time called: 100 Free High Quality WordPress Themes: 2010 Edition. Now, don’t get me wrong, there’s absolutely nothing wrong with that post.
There is something wrong however, with how this post is being treated by several social networks. First of all, there’s Delicious. Check out this search; it’ll show you Delicious has 12 different URLs for the same post. While the proper URL for the post has the most bookmarks, as much as 15% of all the bookmarks are for “wrong” versions of the URL. This means that the post could, in later searches on Delicious, do 15% better if the URL had been canonicalized / standardized properly, in other words, if all this stuff had been redirected to the proper URL.
Those wrong URLs are basically divided in 2 groups: StumbleUpon “framed” URLs and FeedBurner or otherwise “campaign tagged” URLs. Let’s go through these groups one by one, and see if we can solve this.
StumbleUpon framed URLs
I very much dislike the fact that Delicious doesn’t understand these URLs. Delicious should be able to “stab” through a URL like that, and then bookmark the proper URL. But I also actually dislike the way StumbleUpon puts a frame around URLs. Somehow, when Digg did this, it created an outrage, but if StumbleUpon does it, it’s fine. Now their goals might be different, but I still dislike it. The “rough” solution is simple: add a frame breaker to your blog:
The issue is that doing this would prevent people from voting up your site on Stumble, something you might actually want to happen. The second solution is adding a visible delicious button to your site so people can bookmark the post through that button, using the proper version of the URL. It’s not as safe, but it might work for a part of the group that made the wrong bookmarks in the first place.
Google Campaign tagged URLs
These are the URLs that annoy me most. FeedBurner has the quite awesome option to campaign tag your posts, which means that it’ll add variables to your URLs like this:
Those give some awesome insight into where your readers come from, and it’s a feature I’d hate to miss. However there’s one issue with it, and it’s in the very first part of that string: it’s the question mark. The question mark has a real meaning in URLs: it allows you to add parameters to a URL. For that reason Google and other search engines, as well as sites like Delicious, can’t automatically strip these off. There is, however, a very nice solution to this problem: campaign tracking using a hashtag.
This requires you to use the
setAllowAnchor() function within your tracking code. After you’ve added that to your tracking code, you can now use
#utm_source instead of
?utm_source, and suddenly the world looks much cleaner and nicer. Of course there’s a small issue left: FeedBurner still uses the question mark based tracking. This is fixed by redirecting the question mark based campaign tagger URLs to the hash tag based ones.
This may all seem a bit daunting, but I’ve got some good news: if you use my Google Analytics for WordPress plugin, all you have to do is check a box under the advanced settings:
It will then automatically add the needed code and redirect all campaign URLs. Just another step towards a better optimized site, as this should prevent sites like delicious from bookmarking the wrong URL.