Dynamic variables let you copy values from one variable to another without increasing image request length. They are helpful when capturing the same data in multiple variables.
In previous versions of Analytics, image request length was important to prevent truncated data. Improvements to AppMeasurement allow much longer image request query strings, so dynamic variables are typically not needed.
Dynamic variables support query string parameters or HTTP headers in an image request. See data collection query parameters for a full list of available parameters to reference. See Standard request fields on Wikipedia for a full list of available HTTP request fields to reference.
When Adobe recognizes a dynamic variable prefix, it automatically copies the query string or HTTP header value in your report suite. This action happens before any other processing, including processing rules and VISTA rules.
Be mindful of maximum character limits when copying variables. For example, if copying
prop1 can have a truncated value since it has a 100-byte limit (whereas
eVar1 has a 255-byte limit).
Use Datastream mapping to send data to multiple Analytics variables from a single XDM field.
You can use dynamic variables in any dimension field that accepts a string. Dimension items are typically set while configuring the Analytics extension (global variables) or under rules.
Place the dynamic variable prefix in the text field, followed by the query string parameter or HTTP header that you want to reference. By default, the dynamic variable prefix is
Dynamic variables are text strings assigned to other variables. The default dynamic variable prefix is
D=. Dynamic variables are case-sensitive.
// Copy eVar1 into eVar2. The query string parameter of eVar1 is v1. s.eVar1 = "Example value"; s.eVar2 = "D=v1"; // Take the user agent string found in the image request HTTP header and place it in eVar1. s.eVar1 = "D=User-Agent"; // Copy the page URL and place it in eVar1. The query string parameter of page URL is g. s.eVar1 = "D=g";
Dynamic variables appear as strings when debugging your implementation. Values are copied server-side by Adobe data collection servers.