Skip to content

Tracking

David edited this page Jul 26, 2016 · 3 revisions

Tracking

Tracking of views is done via Google Analytics using the same token as the public website.

  • Traffic is distinguished by hostname.
  • Tracking is only loaded if dev|staging|localhost are not in the hostname

Add tracking

Tracking views is done by adding a trackView() call to the JSX file in ui-server/client that has the component that you want to track:

import { trackView } from '../../common/tracking';

export default class MyView extends React.Component {
  componentDidMount() {
    trackView('MyView');
  }
}

All tracking is prefixed with weaveCloudService, so this example view would show up as weaveCloudServiceMyView in GA.

On Hostname change

The filter that sorts out the service traffic has to be changed. The source code does not need to be changed.

Clone this wiki locally