Here’s a fun feature: dynamic variables.
Remember how in the article on variables we talked about how data is transported into Adobe Analytics?
You basically write data into
eVars, and sometimes into both.
As an example, let’s put this onto a page:
s.pageName="Blog:130423:Dynamic_Variables" s.prop1="blog"; // site section s.prop2="blog:principles"; // site sub section s.eVar1="blog"; // site section
The resulting tracking call will contain the following in the URL:
There is definitely some duplication there. I’m not even a real programmer anymore and I still don’t like duplication. There is also a practical reason to get rid of the duplication: Internet Explorer.
Versions of IE prior to 9 will only request content if the URL is shorter than 2048 characters. So if we put too much data into the tracking call, IE might actually not track anything at all!
So let’s fix the duplication!
Dynamic variables are basically placeholders that are evaluated by the collection servers. They can point to other parameters on the tracking call, to HTTP headers, or to cookies.
Let’s rewrite the example above:
s.pageName="Blog:130423:Dynamic_Variables" s.prop1="blog"; // site section s.prop2='D=c1+":principles"'; // site sub section s.eVar1="D=c1"; // site section
See what we did there?
By using the special notation
D=, we told the collection servers to use the value in
v1, effectively copying
We also told the system to use the value of
c1 for the first part of
The tracking call URL will now look like this:
Right, yes, this is longer. But if you go back to the article on debugging and check the long URL that was sent on our test page, you can see that using dynamic variables did actually make sense.
Using dynamic variables, you can also tell the system to read HTTP headers and cookies, like so:
s.prop15=D=User-Agent; // read the HTTP User-Agent header s.prop21=D=s_vi; // read the value of the s_vi cookie
Be warned about the latter: the cookie has to be accessible to the collection servers, of course, meaning it needs to be set on whatever your tracking server is set to.
If you are using 1st-party cookies, the collection servers can read cookies set on your domain, but if you use 3rd-party cookies, it can only read cookies set against whatever domain it is you’re using for tracking.