We are getting double listings on most of our urls in Google Analytics, such as the following:
/Home/Specials
/Home/Specials/
The website is MS MVC3-based. The first usually shows a short loading period with an almost zero exit rate. Most of the real user data is on the second (the ones with the slash suffix).
What is the resolution for hiding the first?
It's also possible to add a regex filter within GA itself which will add slashes internally, effectively eliminating the issue.
From https://www.getelevar.com/how-to/fix-duplicate-url-google-analytics/
How to fix duplicate URLs in reporting
Step 1: Create a new GA view so you can test and validate if this fix works for you before you apply it to your day-to-day view(s)
Step 2: Create a new advanced filter with this regex (screenshot below), which performs this manipulation of your data:
Here is the regex for the advanced rule to test:
Once this has been completed, save your filter.
Step 3: Verify this new filter works as expected.
To test and verify this is working, follow these steps: you can use the Real Time report in Google Analytics to:
In one browser tab go to a version of your site you’d like to test (e.g. yourdomain.com/new-in) In a 2nd additional browser tab go to the version of the same URL with the trailing slash (e.g. yourdomain.com/new-in/) Go to Google Analytics > Real Time Report > Top Active Pages and you should have 2 active pages from the previous steps!
The issue is caused by the duplicate tracking done by Analytics itself and the jQuery address script (the latter adds the trailing slash). The jQuery code adds tracking on AJAX posts, so it's useful for pages like search results.
To resolve the issue, we simply removed the following line from the core script provided by Analytics: