How to Fix the Dreaded Duplicate URL/Trailing Slash in Google Analytics
Trailing Slash: A trailing slash is a slash at the end of the URL i.e. trailing URL for abc.com/contacts is abc.com/contacts/, for us or browser both will take us to the same page, however for the Google Analytics both URLs are different.
The Google Analytics will show both the URL differently in the report.
This issue can be fixed by a developer or you can fix it by applying a filter in a report view.
- Create a custom filter
- Select advanced option
- Use below regex. Follow the steps from the screenshot.
Save your filter once you completed the above setup. The trailing slash issue will get solved, however, we need to test it.
Steps to test:
Go to the Real-Time report.
1) Open one browser window, go to the one version of the URL e.g. abc.com/contacts
2) Open another browser window, go to another version of the URL e.g. abc.com/contacts/
view your top active pages in the real-time report and you should have 2 active pages for abc.com/contacts/
Why fix the trailing URL issue:
- To make clean data
- Save time of the Analysts
Good luck — and if you have any questions feel free to drop a comment below.