Search code examples
google-analyticsgoogle-analytics-filters

Is there a way to remove the ga cookie id parameters after a ? mark in a page URL from Google Analtyics Reporting


We have an instance of cross-domain tracking within Google Analytics with a single sign-on between sites. The sites are on GTM. The single sign-on generates a Google Analytics id such as (?_ga=1.18339449.1954186898.1485354375) which are appended to the end of page URL's.

Our preference is that the id's do not appear within page level reporting as GA treats each page as unique which in turn increases the chances of sampling. We've been unable to use the "Exclude URL Query Parameters" feature found within the view settings to remove the parameters from page level reporting.

I could not find blog or stack overflow posts specifically stating how to remove the id parameters from within Google Analytics reporting.

Is there a suggested alternative to prevent the id parameters from being appended to the sites page URL's?


Solution

  • If you aren't able to use the Exclude URL Query Parameters option to strip the parameter from the URL...that stinks. You might want to let Google know the feature isn't working as expected.

    Another option is to use an Advanced filter with regex to strip the parameter from the Page. You can do this with the following settings:

    Field A: Request URI Pattern: ^(.+)\?_ga

    Output To -> Constructor Request URI Pattern: $A1

    This is a quick and dirty filter that will strip off all query parameters when _ga is the first parameter shown.