_setCustomVar is incorrect in more than one way.
As you can see in the linked documentation, _setCustomVar is not a direct replacement for _setVar. Instead it is like this: _setCustomVar(index, name, value, opt_scope)
So the ‘admin’ var method of tracking a logged in user would be:
The value doesn’t have to be ‘yes’, you may be able to just do an empty string. A scope of 2 seems appropriate.
Also, the custom var has to be declared before “_trackpageview” is declared.
Additionally filtering of custom variables is not possible, one has to use “advance segments” to separate out the ‘admin’ hits from the normal hits. So the following “manually configure Google Analytics to exclude tracking from pageviews with the ‘admin’ variable.” is not possible anymore.
- The topic ‘_setCustomVar is incorrect in more than one way.’ is closed to new replies.