googleanalytics / autotrack

Automatic and enhanced Google Analytics tracking for common user interactions on the web.
Other
4.93k stars 563 forks source link

CleanUrlTracker effecting Sitesearch Tracking #176

Closed EluruPrakash closed 7 years ago

EluruPrakash commented 7 years ago

Hi Philpwalton,in the cleanUrlTracker Plugin we are using stripQuery true as our client needs that ,but because of that Google analytics built-in feature Site search tracking is not happening ,Is there a solution for this ,can you please provide your suggestions on this.

philipwalton commented 7 years ago

Thanks for reporting, in my previous tests, I found that site search worked with the cleanUrlTracker plugin, but after seeing your report and trying again, I'm also not able to get it work.

I'm not sure if something changed in Google Analytics, but I'll look into it. In the meantime, if site search is critical, you may want to stop using the cleanUrlTracker plugin until this is resolved.

EluruPrakash commented 7 years ago

ok Philip,Thanks for your immediate response.Please let us know once you find a solution for this issue.

philipwalton commented 7 years ago

To give you an update on this, it looks like the way cleanUrlTracker works doesn't play well with site search, and my feature request to fix it on the Google Analytics back end probably won't be implemented for a while.

As a workaround for the time being, I could add a configuration param that would let you specify whether/what site search params you're using, and if present the plugin could strip all params but the site search params. You could then set your site search settings to strip those params as well, resulting in no URL params in the page reports.

For example:

ga('require', 'cleanUrlTracker', {
  stripQuery: true,
  siteSearchQueryParams: ['q'],
});
screen shot 2017-05-30 at 3 53 56 pm

Does that sound like it would work?

philipwalton commented 7 years ago

This feature is now in version 2.4.0.