WordPress.org

Forums

Google Analyticator
_setCustomVar is incorrect in more than one way. (1 post)

  1. vinnyrose
    Member
    Posted 2 years ago #

    https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables

    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:
    _gaq.push(['_setCustomVar',1,'admin','yes',2]);
    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.

    http://wordpress.org/extend/plugins/google-analyticator/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic