Using Friendly Urls in internal site links instead of LinkClick
Jun
24
Written by:
Thursday, June 24, 2010 4:56 PM
One of the features of early DotNetNuke was the ability to track clicks of particular links within the site. You could work out how many people clicked on a link on a certain page.
This is one of those features which is actually of limited use these days – a good web analytics package will give you that detail, and a whole lot more. There wasn’t even a link click report you could look at to see the result – though I have written one of these you can use.
However, the ‘LinkClick’ approach still litters the DotNetNuke framework and can get ordinary people into difficulty with their SEO efforts.
The problems with the LinkClick handler
The LinkClick handler is a generic Url which looks like http://example.com/linkclick.aspx?tabid=234&moduleid=355. It can be thought of as a generic redirector, like Microsoft used to use for everything a few years back (it was go.microsoft.com or something like that). There’s several issues with this:
1) it uses a 302 redirect to get you to your content, instead of just a direct link
2) it’s doubtful whether any link value is passed onto the destination page
3) these days with human friendly Urls not containing any ‘tabid’ information, the links are actually quite brittle and easily broken when people move and rename pages.
The LinkClick handler is actually a multi-faceted tool : it is also used to serve up downloadable files (like zip packages and pdf documents) as well as being used to serve up secure files. To be clear I am discussing the use of the LinkClick handler to redirect users to specific DNN pages, not downloadable files.
The SEO drawbacks for using the linkclick handler are both the lack of contextual keywords in the Url, and the use of a 302 redirect, which is not always followed correctly by search engines, as opposed to a straight hyperlink which search engines know exactly what to do with.
Using the LinkClick Handler without realising
Most people don’t even know they are creating ‘LinkClick’ Urls. It usually happens when they use the DotNetNuke ‘Link’ control somewhere in a module. For an example, I’m going to show the announcements module.
An announcement in the announcements module consists of a title, description and link. The title is a plain-text field (although you can be sneaky and enter your own html). The link for the announcement appears as the ‘read more…’ hyperlink.
The ‘read more’ link comes from the ‘link’ field in the Announcement, which looks like this:
This is the generic DNN Link control – and it appears in many different locations. The selection of the ‘Link Type’ option drives what the actual link will look like.
Here’s the list:
- None – no link (obviously!)
- Url – you enter a Url in the full format, ie http://example.com/somewhere.aspx
- Page – you select a page from the current site in the drop down box
- File – you select a file from the current site in the drop down box
- User – you enter the username for a user in your site
If you choose ‘File’ it will create a linkclick based Url – but that’s not what this blog post is about.
If you choose ‘Page’, it will create a normal Url based on your current Friendly Url Settings. In this example, ‘Blog’ is selected, so the returned Url will be http://example.com/blog.aspx
However, if you then check ‘Track number of times this link is clicked’ then the simple hyperlink will be replaced with a linkclick Url, which will track the tabid the destination is for, and the module Id the link is situated on, giving you a hyperlink which will look like http://example.com/linkclick.aspx?link=aa&tabid=xx&mid=yy. When you click on this link, the click is recorded, and then the request is 302 redirected to the eventual page.
So my recommendation is this : Do not tick the ‘Track number of times this link is clicked’ unless you have a very clear and valid reason to do so.
By sticking to this advice, you’ll avoid having ‘LinkClick.aspx’ Urls all through your site content.
Avoid the Link Box and get better contextual Links
While I’m discussing the ‘Announcements’ module, I’ll just add that I don’t recommend using the ‘link’ text at all.
Instead of having a text which reads something like:
‘My very important announcement on the sale of widgets read more…’
I recommend ignoring the ‘link’ field and just baking the link into the Html description, like this:
‘My very important announcement on the sale of widgets’
You can link in the Html either by creating the Html yourself, directly, or by using the FCK Editor/Telerik RadEditor link toolbar button to do it for you.
Link this way does two things:
- It gives exact control over the link anchor text your link has. This helps notify search engines of what the relevant keywords for the linked page are.
- It gives exact control over the format of the link itself, and ensures the format and destination is exactly as you wish. For example, instead of just linking to a blog page, you can link to a particular blog entry.
This is how the announcements on the home page of this site are handled.
Conclusion
My advice is to avoid the linkclick handler all together. Further to this, I advise learning on how to create correct html anchor links (the <a href=’’>link text</a> tag) and craft them yourself, so you know exactly where and how you are linking.
Got any more pointers, disagree or agree? Leave a comment and let me know.
6 comment(s) so far...
Re: Using Friendly Urls in internal site links instead of LinkClick
Agreed, I much prefer to have friendly URL's for links. Users have often expressed interest in this ability to track clicks, but have never actually asked for the reports! Using a separate, dedicated analytics provider is the way to go.
By Sam Erde on
Friday, June 25, 2010 1:19 AM
|
Re: Using Friendly Urls in internal site links instead of LinkClick
Thank you for providing this detail information. This was very helpful.
By chazter on
Friday, June 25, 2010 11:30 PM
|
Re: Using Friendly Urls in internal site links instead of LinkClick
Thanks for the article, however, part of the "user friendly" nature of DNN is the capability to reduce things to an easy interface. For instance, I have websites where the employees who maintain content do not have the time nor inclination to learn HTML. Even basic HTML. These are people who are either teaching fitness classes or camps or other things of that nature. They are not IT inclined, nor do they need to be.
It appears that DotNetNuke evolved into such an easy to use interface that it forms bad SEO url's for a webmaster whose job it is to track and maintain his/her site. Why, oh why is there no happy medium! :-)
Actually, it would be nice to have an option in DNN to "turn off" linkclick tracking functionality. Then I could just tell them, sorry, it's no longer available. Now THAT would be User Interface for DNN UI.
IMHO
By Mark Gordon on
Tuesday, June 29, 2010 1:52 AM
|
Re: Using Friendly Urls in internal site links instead of LinkClick
@Mark Gordon -
You can turn this off. However, you will need to open each ascx file for the module in question and change the attribute on the urlcontrol to ShowTrack="false"
Do a search on dnn:UrlControl
A rather painful way to do it, but I think it would be the only way.
Jon
By Jon Winters on
Tuesday, June 29, 2010 2:33 AM
|
Re: Using Friendly Urls in internal site links instead of LinkClick
@Mark - as Jon says you can do it manually, but not a real solution for most people. With regards to the user-friendliness, the Telerik RadEditor now bundled with DNN does an excellent job of inserting good Urls into html content wherever it is used. It's just the use of the link functionality in places like the announcements module where you can get into trouble. If you have a lot of non-technical users, it's probably worth compiling up a custom version of the announcements module and remove that option.
By Bruce Chapman on
Tuesday, June 29, 2010 8:38 AM
|
Re: Using Friendly Urls in internal site links instead of LinkClick
Excellent post, as usual! Keep up the work on dispelling the common myths and unknowns in the SEO world. :) It still surprises me how many people fail to link keywords...
By Will Strohl on
Wednesday, July 07, 2010 6:35 AM
|