Google Analytics Helpful Tip – _getVisitorCustomVar()
Google Analytics never ceases to amaze me. I was looking for a way, outside of setting a custom event and trying to increment it for specific visitors, to set a custom variable to pass a value to when a visitor or group of visitors perform an action. Well, low and behold, GA provides a way to tackle this issue with the _getVisitorCustomVar() function.
This function, brings back the the visitor level variable assigned for the specified index. Below is an example of how it would coded:
pageTracker._getVisitorCustomVar(x);
The “x” value can be any integer value you wish to place. It is recommended that you start with one and increment upwards.
Please note:
The _getVisitorCustomVar() function can augment the _setCustomVar() function and allows for additional customization and granular tracking as the _setCustomVar() can handle more arguments (3). Additionally, this function allows for on-page behavioral targeting via the native javascript include file (ga.js).
Written by:
Dorian D. Regester
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

