Analytics
4.4K members online now
4.4K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Wondering if you can give some advice. The first time a user visits our website they are assigned a session ID. The session ID quickly disappears and is recorded to a cookie. Future visits by the same user reuses the same ID (unless the user’s cookies are turned off).

 

That said, this session ID is wreaking havoc on our analytics and does not give us a proper look at what is going on as the results are diluted across a very large number of session ID’s.

 

I know there is a place in GA to exclude URL parameters, however our parameter does not have a traditional parameter ID.

 

Do you know if there is a way for us to use a wildcard or some other kind of syntax to ignore of filter them out? Below is an example of the parameter.

 

It begins and ends with a ! and is 24 characters long (including the !’s). Example below.

 

www.domain.com/!8hQ3kPbMNDR9s3lK0tNpqQ!/remaining-portion-of-url-here

 

I was playing around with doing !.{22

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author David R
March 2016

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
Thanks again!!!

I got it figured out.

First I have to say that my first problem was expecting the data to change as soon as the filter was applied. That was not the case and the verification tool that they provide didn't work for this particular issue.

Below was the solution that worked for me.

Filter type > Custom > Search and Replace
Request URI
Search String > /!.+!/
Replace > /

Thanks again for your help!

View solution in original post

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Top Contributor
# 2
Top Contributor
Hi :-)
You will need to test it but the following should work
/![A-Za-z0-9]*!/.*

Thanks
Bronwyn
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thank you very much!!!!!!

Do you know if this go in the "Exclude URL Query Parameters" or in as a filter?

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

[ Edited ]
Top Contributor
# 4
Top Contributor

It is a filter for Request URI field, can be used for an exclude filter.
Before you use it, I would suggest creating a new View and applying it to that.
- Golden rule - always leave your initial default View without any filters, it helps prevent data loss,

should a filter not work as expected. this way there is always a full unedited copy of data should it be

required.

As far as i know, Query parameters require name/value pairs eg parameter=myvalue

Also Remove query parameters is applied before any filters get applied to report data.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Thank you for all this help.

I am still a little confused.

I do understand using a new View for a filter.

But, when I test the changing the parameter it doesn't change my data. Here is what I have.

Custom Filter > Exclude > Request URI > /![A-Za-z0-9]*!/.*

Any suggestions?

Thanks,
Dave

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Top Contributor
# 6
Top Contributor

Hi :-)
Just to clarify.. are you wanting to change/rewrite the URLS so that they do not show that parameter in the urls in the reports
eg so www.domain.com/!8hQ3kPbMNDR9s3lK0tNpqQ!/remaining-portion-of-url-here gets reported as www.domain.com/remaining-portion-of-url-here instead
or

are you wanting to exclude the pageviews to any of the pages that have that parameter in the url so these pageviews do not get tracked at all

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Hi!

Yes, we'd like to change/rewrite the URLS so they do not show the parameter in the URLs in the reports.

Yes, www.domain.com/!8hQ3kPbMNDR9s3lK0tNpqQ!/remaining-​portion-of-url-here gets reported as www.domain.com/remaining-portion-of-url-here instead

And because there is no traditional parameter like ID= or q= I'm having a hard time figuring out how to strip it out.

Thanks for all of your help!

Dave

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Top Contributor
# 8
Top Contributor
Ok so the following should work, however you will need to test it.
(make sure you have a View just for testing purposes)

Filter type > Custom > Advanced
Field A -> Extract A > Request URI > ![A-Za-z0-9]*!/(.*)
Field B -> Extract B > Leave blank
Output To -> Constructor > Request URI > /$A1

Field A Required and Override Output field both ticked
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here
Marked as Best Answer.
Solution
Accepted by topic author David R
March 2016

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
Thanks again!!!

I got it figured out.

First I have to say that my first problem was expecting the data to change as soon as the filter was applied. That was not the case and the verification tool that they provide didn't work for this particular issue.

Below was the solution that worked for me.

Filter type > Custom > Search and Replace
Request URI
Search String > /!.+!/
Replace > /

Thanks again for your help!

Re: Session ID in URL is wreaking havoc on analytics - need to filter out or better yet exclude

Top Contributor
# 10
Top Contributor
That works nicely too

Thanks for posting back

Cheers
Bronwyn
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here