URL structures and analytics

Chris Scott

It’s well known that good URL structures can help SEO, but how often do we think about the impact of URL structures on analytics? We should.

I was looking back at an analytics review I did a while ago and I noticed how it was more by luck than design that I could get at what I wanted. It would all have been so much easier if the URL structure had been implemented in a more logical way.


Here’s the scenario. Our client, let’s call them Acme Services, is in a business services sector where the experiences of individual people within the business really matter. One of the design objectives of the company’s website is to make it as easy as possible for users to find relevant people so they can follow up with an enquiry.

In fact, some of their people are pretty well known within their industry so some users arrive at the website just by searching on a person’s name. Other common user journeys to people information are via specialist practice pages and via a main navigation link.

Users visit the site for many reasons, not just to look for people, so we wanted to create a Google Analytics Advanced Segment containing “people seekers”, users looking for information about our client’s people. We then wanted to investigate the characteristics of people seekers with a view to improving their user experiences.

A segment is just a subset of visits that meet some criteria. So, how do we define people seekers in Google Analytics?

Setting up the Advanced Segment

Step 1 – identify all the pages where a visit is a signal that a user is in the segment. In our case we had:

  1. The top level People page which includes People search and links to A-Z listings. Helpfully, all of these have acme.com/people/ in the URL structure. So far so good.
  2. Each of the company’s specialist practices has a sub-page listing people. These are all on /services/ URLs. However, these people listings contain “&detail=people” in the URL so again they are easily specified, although something like /services/servicename/people would probably be more SEO friendly and human readable.
  3. Individual person profile pages. Here we hit problems since these have URLs of the form acme.com/boagp/ (if a Mr Paul Boag happened to work for the company). These are important pages that get landed on directly from search engines so we cannot afford to ignore them in our segment definition. But there are far too many people to add each to the definition explicitly. In this case we were saved by some past web designer or developer having the good sense to implement title tags of the form “Paul Boag | People |”.

Step 2 – use Google Analytics’ Advanced Segments editor to create the segment.

Click on the Advanced Segments button and then the + New Custom Segment button.

Give your segment a name.

Giving a segment a name in Google Analytics

Then add the different criteria that define a visit in the segment. Here we are saying that a user simply needs to visit one of the /people/ or &detail=people or | People | pages to qualify so we are using ORs to combine the criteria.

Advanced segment

Notice that we’ve used Page Title and Containing selectors on the third criteria to pick up the person profile pages.

Risky analytics strategy

We got away with using the Page Title Containing construct to define the segment, but suppose we wanted to look at user journeys from a people listing page to a profile page. If both of these have People in the title we have to hope there’s some subtle difference such as a “|” only being used before People in the title tag on the profile pages. Otherwise we might be truly stuck.

Title tags, those little pieces of content that are often unseen, can be all too easily neglected or unmaintained. It therefore seems like a risky analytics strategy that relies too heavily on them.

If only someone had thought about analytics at design time and given profile pages URLs of the form /people/boagp/. We could then simply match using a regular expression like /people/[a-zA-Z0-9]+/.

URL structures aren’t just for SEO. Next time you are thinking about them give a thought for whoever looks after analytics.