This is the analysis tool used by teambition, aiming to simplify the use of multiple analysis services.
JavaScript CoffeeScript HTML
Latest commit 7d78c1c Jan 23, 2017 @nekolab nekolab Bump to version v1.0.2 🐈
Export `Gta` object to window instead of export functions to window.

Analysis Tool for Teambition


First, use Bower to install GTA:

bower install gta

or with NPM:

npm i --save teambition-gta

Then, include the following script in your HTML and you are ready to go:

<script id="gta-main"

Set User ID

// Currently only and Fullstory support userId
gta.setUser(id, user)

Register Property

gta.registerProperty(key, value)

All registered properties would be mixed with every events util unregister.

Register Plugin


A plugin cloudn't be unregistered now.

Set Current Page

// Set the current page, default value of the 'page' field while invoking
gta.setCurrentPage('Home Page')

Page View

Call the pageview function to record a new page view:

// Use single object
    'page': '/my-overridden-page?id=1',
    'title': 'my overridden page'

// Use multiple string
gta.pageview('/api/hello', '?world');


Tips: 'page' equals to 'category' in old rules, 'type' equals to 'label' in old rules.

  1. data-gta property in DOM element use similar key-value format ({"key": "value"}) like JSON, and quota could be omitted.
  2. Colon, comma and quota cannot be used in key and value.

You can set current page page, it will be automatically added to the gtaOptions:

// It is usually called when the route change
gta.setCurrentPage('Tasks Page')

You can call the event function to track an event:

gta.event({action: 'add content', page: 'Project Page', type: 'task', control: 'tasks layout', method: 'double-click'})

Or, easily add data-gta='event' to a DOM element as:

<button data-gta="{action: 'add content', page: 'Project Page', type: 'task', control: 'tasks layout', method: 'double-click'}">click</button>

To automatically log gtaOptions, you can use the 'debug' mode:

gta.debug = true
window._gta_debug = true

Warning! old rules not supported since v0.8.0

API Documentations

Change Log


  1. Now library can be exported to window.Gta


  1. Fix GTA crash when provider Baidu crash.


  1. New architecture
  2. New APIs: (un)register(Property|Plugin)