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 eVar1 to prop1 , prop1 can have a truncated value since it has a 100-byte limit (whereas eVar1 has a 255-byte limit).
Dynamic variables in Adobe Experience Platform Launch
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.
- Log in to launch.adobe.com using your AdobeID credentials.
- Click the desired property.
- Go to the Rules tab, then click the desired rule (or create a rule).
- Under Actions, click an existing Adobe Analytics - Set Variables action or click the '+' icon.
- Set the Extension dropdown to Adobe Analytics, and the Action Type to Set Variables.
- Locate the desired dimension item.
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 D= .
Dynamic variables in AppMeasurement and Launch custom code editor
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.