ga

README

Google Analytics tracking for GitBook

You can use install it via NPM:

$ npm install gitbook-plugin-ga

And use it for your book with in the book.json:

{
    "plugins": ["ga"]
}

You can set the Google Analytics tracking ID using the plugins configuration in the book.json:

{
    "plugins": ["ga"],
    "pluginsConfig": {
        "ga": {
            "token": "UA-XXXX-Y"
        }
    }
}

You can customize the tracker object by passing additional configuration options. You can either pass in auto, none or an object:

{
    "plugins": ["ga"],
    "pluginsConfig": {
        "ga": {
            "token": "UA-XXXX-Y",
            "configuration": {
                "cookieName": "new_cookie_name",
                "cookieDomain": "mynew.domain.com"
            }
        }
    }
}

For an overview of all available configuration parameters, please refer to the analytics.js field reference.

Configuration

Setting Description Type Allowed values
configuration Configuration mode String
default = auto
-
token
required
Tracking ID String
-

Plugin

Track page views of your book into Google Analytics

https://github.com/GitbookIO/plugin-ga


Latest: 2.0.0

0.0.1, 0.1.0, 0.2.0, 0.2.1, 1.0.0, 1.0.1, 2.0.0,

Requirements

GitBook
0.0.1 *
0.2.1 >=0.4.6
1.0.1 >=2.5.1
2.0.0 >=4.0.0-alpha.0

Maintainers

Open on NPM