cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Cookie based business transaction

zzareyan
Participant
Is there a way to create BT based on some cookie values?
I found in the Evaluation\Filter\Splitting values, but can't properly use my measure.
4 REPLIES 4

miguel_martinez
Advisor

Hello Zaven,

Of course! This is a very common and useful use case for a business transaction. This is what you need to do:

1) Make sure you're capturing the value of the Cookie header on the Servlet or Web Request sensor properties.

2) Create business transaction, give it a name, and create a new measure for the Split Results section. 3) Select the "Web Request - Header value" and fill out the necessary fields (Header Field with the name of the cookie, Evalution: String).

4) Then apply a transformation regex to extract the value you require. A common use case is to split on the JSESSIONID. To do this simply use the following regular expression: JSESSIONID=([\w]*)

5) Make sure you add a 1.0 in the thresholds for ·"Exceeds or equal" in order for the Business Transaction to work.

Let me know how this works out for you 🙂

Best,

Miguel

Hi Miguel,

Thank you for response.
Actually I want to see those transactions which have cookies with some value (for my case it is Google Analytics Opt Out value).

Here's my measure and transaction screenshots.
http://imgur.com/tJYQw2S
http://imgur.com/lXfFY4f

Thanks in advance.
Zaven

miguel_martinez
Advisor
Hello Zaven,

Are you sure you are extracting that field from the request header? View screenshot for example: http://imgur.com/a/WINiH. Make sure you have an entry for request header with the name of the corresponding header field you want to track. You might also need to use a transformation regex to extract the different values that come in (either true, false), so you can split by those values. If you are simply expecting true or false you can use the following:

headerValue=([a-zA-Z]*)

miguel_martinez
Advisor

Hello Zaven,

Are you sure you are extracting that field from the request header? View screenshot for example: http://imgur.com/a/WINiH.

Make sure you have an entry for request header with the name of the corresponding header field you want to track. You might also need to use a transformation regex to extract the different values that come in (either true, false), so you can split by those values. If you are simply expecting true or false you can use the following:

headerValue=([a-zA-Z]*)