Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Respecting User Privacy

Steve McKay edited this page Jun 21, 2013 · 16 revisions

Use of the Chrome Platform Analytics library has privacy implications for users of your application. Information collected using this library may be sent to the Google Analytics servers. In order to use the library you must abide by Google Analytics Policies. Those policies address such issues as:

  1. Notifying users about your tracking practices.
  2. Obtaining consent from your end users, or providing them with the ability to opt-out of tracking.
  3. Not uploading personally identifying information.

In order to facilitate compliance with the Google Analytics policies this library provides built-in support to disable usage tracking. That support is both persistent (automatically remembers state in local storage) and dynamic (the library honors the setting automatically so you don't have to implement this manually). Tracking can be enabled or disabled using config.setTrackingPermitted(boolean).

The library does not provide a user interface. Your application must do this. See the demon applications included in this repository for examples of how you might implement this.

Example:

service.getConfig().addCallback(
    function(config) {
      var permitted = myApp.askUser('Allow anonymous usage tracking?');
      config.setTrackingPermitted(permitted);
      // If "permitted" is false the library will automatically stop
      // sending information to Google Analytics and will persist this
      // behavior automatically.
    });

Note that the underlying storage mechanisms used to persist this setting is only accessible asynchronously. For this reason access to the representative analytics.Config object is asynchronous as well. See the demo applications for an example of how you accommodate this in your code.

Clone this wiki locally