General principlesSection titled General principles
Dynamic vars are additional information on the session that can be used to segment users.
For example, they can include information on the A/B Test variations displayed to the current user.
Unlike custom vars, dynamic vars can be sent at any time during a session and do not require to send a pageview.
LimitsSection titled Limits
On the server sideSection titled On the server side
It is possible to save up to 40 distinct dynamic variables per pageview. If more are received, only the first 40 distinct keys will be kept.
If you are using the same key twice, the last value associated with the key will be collected.
On the Tracking Tag sideSection titled On the Tracking Tag side
Every dynamic variable being composed of a pair of key (max. 512 characters) and value (max. 255 characters string or integer from 0-4294967296). The key and value are truncated by the Tracking Tag before they are sent.
Defining dynamic varsSection titled Defining dynamic vars
To define and send a dynamic var at once, use the
Allowed values are
string — there are specific capabilities for each in the Contentsquare app:
- For values of type number, you can use operators (more than, less than, etc.).
- For values of type string, auto-completion and regular expressions are available.
Verifying the sending of dynamic varsSection titled Verifying the sending of dynamic vars
Our Contentsquare Tracking Setup Assistant Chrome Extension displays each dynamic var sent.
Inspecting the payloadSection titled Inspecting the payload
If you can’t use our Chrome extension, use the
From the browser console, run this command to create the cookie:
Reload the page.
In the Network tab, search for
dvar, select the request, and check the value of the
Checking the requestsSection titled Checking the requests
To check the actual request that is sent for each dynamic vars package (several dynamic vars pushed at the same time bundled together in a single network request), follow GET requests sent to
//c.contentsquare.net/dvar, with these parameters.
|Parameters for which you can supply a value|
|Dynamic vars (compressed)||String|
|Parameters determined by the technical environment of the configuration|
|A random digit to avoid request caching||Integer|
|Unique user ID||String|
|Page number (each pageview increments of 1)||Integer|