Archive for March, 2009


I’ve come across this many times when building sites for clients.  ASP.NET is really great for building dynamic content pages, but not so great when you’re trying to expose those dynamic pages to a crawler or bot used by search engines.  Usually I’ve found myself having to index the crawler or bot to go find specific pages if I wanted something to show up explicitly.  For instance, you might have a product that you really want to showcase and have searchable.  The product’s URL, however might be parameter based, something like http://www.yourstore.com/productdetails.aspx?productid=5.

 Here are 5 common mistakes you should avoid when building sites that need to be Search Engine Optimized (SEO).

1. Overuse of Button Controls

The Button and LinkButton controls are handy for running server-side logic when a link or push button is clicked, but keep in mind that search engines can’t follow these links. These controls cause a postback via Javascript code that search engines are unable to execute.  I’ve seen more than one developer who’s standard method of linking from one page to another was to drag a LinkButton control onto the page and then place a Response.Redirect in the event handler, making the entire site completely uncrawlable by search engines.

It seems obvious, but when linking between pages try to use a plain text link or Hyperlink control whenever possible.

2. Duplicate Page Titles

With any dynamically generated site, it can be difficult to generate unique page titles for each and every page, but it really is important.  If you have a quality site, then the search engines are working hard to drive traffic to your site.  After all, that is their core business – to provide links to the best resources on whatever the searcher is looking for. 

So you need to make it easy for the search engines to figure out exactly what your pages are about, and the page title is an important part of that.  Not only that, but once the search engine does rank your page highly, the title is the primary text that searchers will be seeing and using to determine whether to click on your listing or not!  

On dynamically generated pages, try to to use a keyword-rich page title, such as the full name of the product on a product page, for best results.  If you don’t have any appropriate field, provide the ability for the user to specify their own page titles for each item being displayed.  It’s worth their time and effort.

3. Duplicate Meta Descriptions

Much like the duplicate page title issue, the meta description tag should not be duplicated across your pages either.  Like the page title, this text is used (although to a lesser extent) by the search engines to determine the content of your page and also appears underneath your title in the search engine listing.  Depending on the number of pages of dynamic content on your site, it might not be practical to add multi-sentence descriptions for every single page.  In this case, simply remove the meta description tag altogether.  The major search engines are pretty good at improvising when the description tag is missing by displaying portions of the page body that match the user’s search keywords instead.

In my experience, the SEO benefit of adding a keyword-rich meta description is not enough to warrant spending a great deal of time creating custom descriptions for sites with 100+ pages.

4. State-Dependent Pages

Search engines rely heavily on the idea that every unique page has it’s own unique URL.  That means that if you are basing a page’s content on session variables or viewstate parameters, you are probably going to have problems getting that content indexed.  Once a search engine finds a URL, Google will continue spidering that page, but you can bet that the search engine robot will not navigate through your site again to get there.  So you need to make sure that any content you want indexed by search engines can be accessed by simply opening your browser and typing in the URL of that content.  That means unique URLs for every product in your ecommerce store, ever category in your directory, etc. 

My recommendation is to use viewstate rarely and session variables almost never.

5. Duplicate Content When Rewriting URLs With ASP.NET

When you rewrite a URL, the browser is displaying a keyword-rich URL, but internally the URL of the page being displayed is still the ugly URL with the querystring parameters.  In technical terms, the Request.RawURL value might be something like:

  1. http://www.store.com/products/coffee-cup.aspx

but the Request.Url value would still be something like:

  1. http://www.store.com/products.aspx?productID=15  

All of that is just fine, but a problem can arise if you have a Button or LinkButton control that posts back on that page.  By default, the button control will post back to the Request.URL value. causing the URL to change after postback.  This can be a problem if some users end up linking to your ‘ugly’ URLs, because the search engines will find that link and spider it.  To the search engine the two different URLs signify two different pages and both will be indexed seperately, causing a pretty ugly duplicate content problem.  

Thankfully, starting with .NET 2.0, there is a PostBackUrl property on the button controls.  Set this property to the Request.RawUrl value and your button will postback to the ‘pretty’ URL.

 The original article that I read this from was on this blog

 

Have you ever found yourself lost inside some sort of block statement, wondering when the beginning of the block began or ended?  I just found this awesome feature in Visual Studio that allows me to jump to the beginning or ending of a block. 

To do this, put your cursor before or after the brace (your choice) and then press Ctrl+]. It works with either curly or round braces.

I originally found this nifty little feature from another blog

 

I’ve been doing the consulting thing for a while now.  Today I came across something that kind of blew my mind away.  I was setting up my blog and getting everything working the way I wanted, when I came across a “Tracking Script” section.  On the left hand side it says “Visitor tracking script, The JavaScript code from i.e. Google Analytics.”  Of course, the word Google immediately caught my eye and my curiousity flew through the roof.

 What is Google Analytics?

Well, if you’ve ever hosted a web site before, at one point or another you’re going to wonder how much traffic is going to your site.  If your site is a form of marketing for you, then you’re probably also going to want to know not only how much traffic, but also where is it coming from.  What are the demographics?  My current host for my consulting firm has some traffic information that I can access at all times, which is nice, don’t get me wrong.  However, once I went and signed up for Google Analytics and started researching it, I immediately wanted to replace what I was using.

How much does it cost?

This is going to really get you.  It’s free, as in beer.  If you have a gmail account already, then you’ve got everything you need to go ahead and set up an account for analytics.

Basic Features

It will track traffic at a domain level, and provide you with the following features:

  • Visit Information
  • Page Information
  • Bounce Rate
  • Average Time on Site
  • % New Visits
  • Map Overlay
  • Traffic Sources Information
  • Content Information
  • Email reports
    • Instant and Scheduled Emails
    • PDF
    • CSV
    • XML
    • TSV
  • Export Reports
    • PDF
    • XML

Advanced Features

Analytics has a concept of “Conversions” which tracks how people actually use your site.  You can identify certain pages as being a “Goal”: for instance, a thank you page that a user would hit after they’ve filled out a form, something to that effect.  Once they hit that page, Analytics will mark that visit as a “Conversion Goal”.  This allows you to track your ROI on your site, and is implemented very well.  The interface is clean and intuitive. 

Final Words

I’ll be implementing this on a couple of sites and write a followup of how it goes.  I have a few concerns about performance since it looks as if it will be pinging an external server on every page request, but so far I haven’t had any noticeable differences.

 Stay Tuned!

 

Welcome to JosephBulger.com!  This is hopefully going to be the first of many blogs that I write!  This blog will focus on things that I take interest of mostly: my family, programming, various technologies, etc.

My Family

Needless to say, this is where the majority of my time and effort are spent!  So naturally, I’ll be blogging a great deal about my family.

My wonderful wife, Michelle, takes care of our entire family, which is completely unbelievable.  She’s also running  a blog.

Sarah is just finishing up 4rth grade! 

Joseph is talking/walking/running/anything like crazy and Isaac has nearly mastered the art of walking and is moving onto the science of speaking.

Programming

I’ll be writing a lot of blogs about programming concepts and their applications that I come across in my work.

RockDigital Consulting 

I work full time as a Senior Software Engineer, but I also run a consulting company on the side that I might write about preiodically as well.  Sound like a plug?  You bet it is =P  Sorry, have to get my advertising in when I can!  Anything cool and exciting that happens to my company I’ll most likely blog about so people can see what’s happening there.

Technologies

This could really be about anything, but its most likely going to be cool gadgets, ideas, frameworks I’m looking into or using.