: Removing query string parameter from Google analytics pageview report My website uses a querystring parameter to track where on the site a user came from to access the current page. For example:
My website uses a querystring parameter to track where on the site a user came from to access the current page. For example:
example.com/my-page?source=header http://example.com/my-page?source=footer example.com/my-page?source=sidebar
As we all know, this causes Google Analytics to treat each of these urls as a separate page in reports. For example, the "All Pages" report.
Is there any way to create a custom report to display the same data as the "All Pages" report, but ignore the source querystring paramter, so that the three url's listed above would be grouped together as a single page?
I am aware that I can filter out query string parameters on the view level, but this is not what I'm looking to do. I don't want to ignore the parameters fully because I use them in other aspects of analysis. I just want the ability to ignore them on certain reports.
Can this be done?
More posts by @Moriarity557
3 Comments
Sorted by latest first Latest Oldest Best
It can be done using the clean URL plugin, or custom code in Google Tag Manager
github.com/googleanalytics/autotrack/blob/master/docs/plugins/clean-url-tracker.md
The only functionality Google Analytics has for this is on the view level: "Exclude URL Query Parameters". I can be found under Admin -> View Settings:
The documentation for it says:
Any query parameters or unique session IDs (e.g., sessionid or vid) that appear in your URLs that you do not want to see in your reports. Enter as a comma-separated list.
This setting is case sensitive. There is a 2048-character limit.
Additionally, the parameters you identify here are excluded before filters are applied, so be sure you identify them here as they appear in the original, unfiltered URIs. It has become a common mistake to apply filters, and then return to these settings to identify query parameters as they appear in your filtered reports, thus ignoring the case-sensitive requirement of this setting.
For example, if the original URI is /Section1?ParameterA=something and you use a filter to change it to /section1?parametera=something for your reports, then when you identify the query parameter here, you need to identify it as ParameterA
So in your case, you would just fill in source into that box. If you had a second parameter to exclude you would add it in after a comma: source,sessionid.
Googlebot is also going to get confused about these tracking parameters and it could lead to SEO problems. You can tell Googlebot about the parameter using the Search Console URL Parameters Tool.
I'd recommend not using tracking parameters on your URLs because of the problems and confusion it causes.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.