Skip to content

Ignoring gclid and utm tags #382

Answered by vinhkhangphung
mthorsdal asked this question in Q&A
Discussion options

You must be logged in to vote

I think you should take a look at DefaultHasher class and implement a custom Hasher to serve your purpose. The issue lies in the fact that the DefaultHasher by the package use the whole query string as part of the hash. You should do some stuff to remove out all unnecessary query string (gclid= or utm_source=). Also, remember to change the Hasher in the config file. I will try it out myself if I had the time.

DefaultHasher

protected function getNormalizedRequestUri(Request $request): string
{
    if ($queryString = $request->getQueryString()) {
        $queryString = '?'.$queryString;
    }

    return $request->getBaseUrl().$request->getPathInfo().$queryString;
}

Register hasher in conf…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@mthorsdal
Comment options

Comment options

You must be logged in to vote
1 reply
@mthorsdal
Comment options

Comment options

You must be logged in to vote
1 reply
@RChutchev
Comment options

Answer selected by mthorsdal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants