Config
Provides support for reading and manipulating the configuration of the library. Obtain a instance using the analytics.Service#getConfig.

Inheritance

Constructor

analytics.Config()

Instance Methods

isTrackingPermitted() boolean
Returns true if tracking is enabled.
Returns: boolean  True if tracking is permitted.
setSampleRate(sampleRate)
Sets the user sample rate. This can be used if you need to reduce the number of users reporting analytics information to Google Analytics. Most clients will not need to set this. Value is NOT persisted across sessions.
Arguments:
sampleRate : number
User sample rate. An integer from 1 to 100. If not set defaults to 100.
setTrackingPermitted(permitted)
As a user of this library you must permit users to opt-out of tracking. This method provides support for persistently enabling or disabling tracking for the current user on the current device.

When your code calls setTrackingPermitted(false) this library will dynamically disable tracking. This means you are free to instrument your application with analytics tracking code, then enable/disable the sending of tracking information with this method. You do NOT need to guard calls to tracking in your code.

For further information on how to support opt-out in your application see https://github.com/GoogleChrome/chrome-platform-analytics/wiki/Respecting-User-Privacy

Arguments:
permitted : boolean
True if tracking is permitted.

Package Config

Package Reference