Google Analytics double listing with and without f

2019-06-27 19:38发布

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?

2条回答
爷的心禁止访问
2楼-- · 2019-06-27 20:01

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:

If a URL does not have query parameters at the end of the URL AND is a standalone URL AND does not have a trailing slash at the end of the URL, then add a trailing slash at the end of the URL

Here is the regex for the advanced rule to test:

^(/[a-z0–9/_\-]*[^/])$

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!

查看更多
Luminary・发光体
3楼-- · 2019-06-27 20:14

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:

_gaq.push(['_trackPageview']);
查看更多
登录 后发表回答