Google Analytics reports can sometimes look really cluttered with multiple index pages showing up that actually represent the same page. Your home page is your index page, but it can show up differently in some reports. So, when you open your Top Content report, you might end up seeing something similar to this:
This is just an example; it will probably be a bit different in your particular case. What’s important to note here is that Google Analytics will record whatever the URL of the page is in your browser. The first one (/) represents http://www.example.com/, and the second one (/index.php) represents http://www.example.com/index.php. These two URLs represent the same homepage, but seeing them as two separate URLs is not helpful at all.
Sometimes, web servers can treat slightly different URLs as the same pages. So, if multiple versions of a URL are in fact the same page, the best thing to do is to clean up those URLs in Google Analytics and have a less cluttered Google Analytics experience.
Luckily, there is an easy fix for this issue. You will need to edit your profile information. Navigate to your Admin panel, which can be found on the top of the page. Next, navigate to View Settings. Here, you will need to add index.php in the Default page text box, just like in the image below.
Now Google Analytics will just add “index.php” to any URL that ends in a slash. That’s it, as simple as that!
Solving multiple index pages
Sometimes, you may have a problem that looks like this:
In this case, we cannot use the settings from above because we have multiple possibilities. The best way to fix this issue is to use a filter and create clean looking URLs.
How can you do this? Navigate to Admin → All Filters → Add Filter. Now it’s time to enter all the settings. Add a name to your filter and choose Custom filter. The next thing is to choose Search and Replace as the filter type. Filter Field should be set to Request URl. Now just enter “/index.php$” to the Search String text box and “/” to the replace string text box. The dollar sign means “end with”, so in this case, we are replacing that with just a slash. This practically means that all /index.php strings will now look like /.
In the example above with both “index.php” and “home.php”, I could just create one filter. Once I’m done, for my data going forward, I just get the trailing-slash versions of the URLs.
In conclusion, Google Analytics allows you to easily remove all the clutter and multiple index pages by simply creating a few filters.