Have you noticed multiple index pages showing up in your content reports?
By default, your website’s homepage will be reported by Google Analytics as ‘/’ in the top content and drill down reports. But depending on how your website is coded you may also see a long-form homepage appearing in your reports, typically something such as /index.html, /home.html, /home.php, /home.aspx, /default.aspx or similar.
Why does this happen?
The straight forward slash will include people browsing directly to your website domain, so a visitor browsing to ‘http://www.example.com/’ will be reported as ‘/’ in the content reports. This will likely have the greater number of pageviews, because most people will go directly to your website domain (or link directly to your website domain).
That said, sometimes the full page location (e.g. ‘http://www.example.com/index.html’is found by a visitor, perhaps because your menu or a page links directly to the ‘/index.html’ page.
So what you will find is that both ‘/’ and ‘/index.html’ (or .php, .aspx, etc.) will appear in your content reports. These are duplicate rows for the same page, meaning that your reports are not presenting a true picture of your visitors and their behaviour.
How can you get around this?
Luckily, Google Analytics provides a feature that lets you avoid this duplication in your reports.
Firstly, you need to identify the full pagepath for your website’s homepage. If you’re not sure, try to find it in Google Analytics: just navigate to the ‘Behaviour’ reports, then choose ‘Site Content’ then ‘All Pages’. Using the filter field at the top of the report, click ‘Advanced’ and set a filter definition to:
‘Include’ ‘Page’ ‘Matching RegExp’ ‘^(/(index|default|home)?\.?(html|htm|php|asp|aspx|jsp)?)$’
Then click ‘Apply’ (this will check for the most common default pages). If you don’t find the page, you might be lucky enough that your website has been set up to keep this hidden, but check with your web developer to be sure.Once you’ve found the full page path, you can enter it into your Google Analytics settings by following these easy steps:
Once you’ve found the full page path, you can enter it into your Google Analytics settings by following these easy steps:
- Go to your Admin area
- Choose the view for which you want to set the default page
- Enter the full default page name
And that’s it – you’re done! Moving forward, Google Analytics will aggregate the pages together and stop the duplication showing up in your content reports.
But I have two default pages!
What if you have two – or more – default pages? For example, if you see ‘/’, ‘/index.aspx’ and ‘/default.aspx’ all appearing in your content reports? Well, you can also merge these into one using a search and replace filter.Just navigate to the Admin area in Google Analytics, find your view and click on ‘Filters’. Create a new custom filter, giving it a meaningful name, and select ‘Search and Replace’ as the filter type. Select ‘Request URI’ as the filter field and enter
Just navigate to the Admin area in Google Analytics, find your view and click on ‘Filters’. Create a new custom filter, giving it a meaningful name, and select ‘Search and Replace’ as the filter type. Select ‘Request URI’ as the filter field and enter ^(/|/default.aspx)$ in the search string (this will look for ‘/’ and ‘/default.aspx’).
Then enter ‘/index.aspx’ as the replace string. This will map ‘/’ and ‘/default.aspx’ to ‘/index.aspx’. Now save your filter and, moving forward, you will just see ‘/index.aspx’ as your homepage in the content reports.
This is an update to an article first published in 2010How did this work around suit your needs? Let us know in the comments!