Convert Experiences Tracking Cookies Structure
Understand How Convert Uses Cookies to Track Visitor Data and Experiment Behavior
| Owner: | Dionysia Kontotasiou |
THIS ARTICLE WILL HELP YOU:
- Understand _conv_v
- Understand _conv_s
- Understand _conv_r
- Redirect Experiences (_conv_sptest)
- Know about _conv_check_cookies
- Learn about _conv_t
- Learn about _conv_d
- Learn about _conv_g
- Understand Size Limits
- Learn about AWS Persistent Cookies
Currently, we are using several cookies in order to track visitor experiments and support related functionality such as cookie availability checks, QA/preview debugging, and Shopify Web Pixel data handling. These cookies are a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information that Convert application can read whenever the user visits the site. So in that sense, they are necessary to store user-specific information.
Below you will find more details for the cookies Convert may use.
_conv_v
This cookie is the visitor-centric cookie that has a lifetime of max 6 months from the last update time. It is a string of star(*) separated pieces; each piece is a string that contains key and value strings glued together by colon (:). Here is a list of used keys:
-
vi : has value 1 when the customer did not provide an ID for the visitor (option available only on certain plans);
-
sc : sessions count; the number of session for this visitor;
-
cs : current session start timestamp
-
fs : first session start timestamp
-
pv : number of pageviews for this visitor across all sessions
-
ps : previous session start timestamp
- seg: the IDs of project-level segments that this visitor belongs to
-
exp : JSON like the structure of all experiments presented to this visitor together with the goals triggered for each one of them. Replacing dot (.) with colon (:) , hyphen (-) with comma (,) and quoting all the keys and values it becomes a valid JSON. Something like this could be used to transform it into a valid JSON:
data = data.replace(/-/g,","); //getting back the comas
data = data.replace(/\./g,":"); //getting back the column
data = data.replace(/([a-z0-9]+):/g,'"$1":'); //bringing back quotes
This JSON has as keys the experiments IDs and values have objects where the key “v” represents the variation ID and the key “g” represents the goals triggered for that experiment;
example cookie value: vi:1*sc:2*cs:1374079443*fs:1374074823*pv:4*seg:{100246.1}*exp:{10001236.{v.10008683-g.{10001841.1}}-10001237.{v.10008687-g.{10001841.1}}}*ps:1374074823
_conv_s
This cookie is a session centric cookie that has a lifetime of 20 minutes since the last update (last browsing activity). It is stored in the same structure as the one above, having the following keys:
-
si - session ID; starts at 1 and increases with each new session
-
pv - number of pageviews in the current session
- sh - when vi value inside the previously explained cookie (_conv_v) is 1. we'll generate a session hash which is stored here for the period of the session and which is used and needed for performance reasons. This value is being sent to the server where it serves for cache purposes( the cache is expiring in 20 minutes, same as a session)
example cookie value: si:2*sh:1521723696383-0.5867184247347756*pv:3
_conv_r
This cookie holds the referral data for the current visitor. This is overwritten each time a visitor comes from a new referrer. Structure same as above using the following keys:
-
s : source name - domain name of the referrer or the provided value through the corresponding UTM variable
-
m : referral medium or the provided value through the corresponding UTM variable
-
t : referrer search terms automatically picked from search engines or manually fed through the corresponding UTM variable
example cookie value: s:www.google.com*m:organic*t:ab testing
Redirect Experiences (_conv_sptest)
There is another Convert cookie we use _conv_sptest. This is a temporary cookie used for redirect experiments. On the original page that would get redirected to another, this cookie is set with an expiration of a couple seconds. Then, on the page where it's redirecting, that cookie is used to store stats. For more information on how to use it, read this article.
_conv_check_cookies
This is a momentary cookie designed solely for the purpose of checking whether cookies are blocked on the page. It is not used to store experiment bucketing, visitor history, goals, referral data, or long-term visitor information.
_conv_t
This cookie stores a debug token for QA and preview purposes only. It is used when debugging or previewing Convert experiences and is not expected to be present in normal production experiences.
_conv_d
This cookie stores visitor data required for the Web Pixel to work with the Convert Shopify App. It can include data needed by the Shopify Web Pixel to connect checkout events with the visitor’s Convert experience and variation data.
Note: The developer feedback listed _conv_d twice, once for visitor data and once for visitor segments. In the Shopify Web Pixel implementation references, _conv_d is used for data, while visitor segments are stored under _conv_g. I recommend adding _conv_g as a separate entry rather than documenting _conv_d twice.
_conv_g
This cookie stores visitor segments required for the Web Pixel to work with the Convert Shopify App. It allows the Shopify Web Pixel flow to access segment information needed for tracking and attribution in Shopify-related implementations.
Size Limits
According to Microsoft, most browsers will allow cookies of up to 4096 bytes and again, most browsers only allow you to store up to 20 cookies per site. The oldest cookie would be discarded if trying to store more than the limit. You can find a reference here: https://msdn.microsoft.com/en-us/library/ms178194.aspx.
AWS Persistent Cookies
We cannot write persistent cookies on some public domains such as amazonaws.com. In cases such as this, you would have to use a domain that you own in order to run experiments.