Why website URL structure matters to Google Analytics
Many website content management systems by default show page URLs using "query string data" - i.e. the name of the your website domain followed by a question mark and some data indicating a particular page. For example www.mysite.com/?page_id=57.
Beyond analytics there are a number of advantages of having a "friendlier" URL structure. Some of the key advantages include:
1. A logical hierarchy using words rather than data in your URLs can convey information and help people understand where they are in your site content.
2. Page URLs that use query string data can be harder for people to remember.
3. There are advantages for SEO - see the Google SEO Starter Guide
4. URLs appear in search results - if a relevant word matching a search term appears in your URL it will shown in bold making your entry stand out a little more. This could potentially increase the chances of someone clicking through to your site.
An often forgotten advantage of a well thought out URL hierarchy is the impact on working with Google Analytics.
If you use query string data for all page URLs understanding how people interact with your content can become very difficult.
For example if "page_id=44" performed better than "page_id=66" and there are another 50 popular pages how do you easily compare the performance of different content?
Assuming you've not got a photographic memory and can immediately recall the id for each page you'll either need to cross reference these numbers against a list or actually click through to each page. This makes analysis cumbersome and if you have a lot of content it becomes near impossible to identify trends or draw any deeper insight.
An improvement would be to amend your CMS (content management system) to replace this data with meaningful words. If "page_id=44" becomes "about-us" and "page_id-66" changes to "our-services" it's obviously a lot easier to understand the content reports within your analytics account.
For simple sites - for example a small company website - the above may well be sufficient. For larger sites or sites with different types of content however this still poses a challenge.
Lets consider a small business website that promotes a range of services and has an active blog. Blog content often performs very differently to other types of content on a website.
People often reach a blog as a result of a search, blog articles are frequently built around a particular topic and the article often provides sufficient information to answer the "question" that led people to perform the search. As a result blog articles frequently have a much higher bounce rate than other content on many sites.
Going back to analytics if you have a lot of blog content on your site but are also promoting services you'll need to be able to distinguish your blogs performance from the rest of your site. With a simple "flat" URL structure this can be difficult.
Luckily a simple solution is available. Adding a hierarchy to your URLs makes aggregating different types of content much easier within Analytics. For example preface blog pages with "/blog/", service pages with "/services/" and use product categories for e-commerce sites e.g. "/books/". This hierarchy will enable you to segment content via views, using the filter field, advanced segments and the content drill down reports.
Bear in mind that for complex sites the hierarchy can extend beyond one category. For example for an e-commerce site you may offer a range of books for sale and so may want to extend "/books/" to "/books/sci-fi/", "/books/biography/", "/books/fiction/" etc.
A quick tip where you do implement a URL hierarchy is to consider the opening page for each section. If you have an opening page for "/blog" and then actual blog content (e.g. /blog/articlename) you'll see two entries in the content drilldown reports for "/blog" and "/blog/". To avoid having to aggregate this data change the opening page URL to "/blog/" or alternatively use an Analytics advanced filter to rewrite it.
Inevitably for some complex websites query string data will be required. Where this query string data conveys meaning about the content being viewed you can use Advanced Filters to adjust your URLs in Analytics to make better sense of them. Think carefully about how you use query string data in advance as these filters will need to use logical rules about what page URIs to rewrite.