🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gitbook-plugin-ga

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-ga

Track page views of your book into Google Analytics

2.0.0
latest
Source
npm
Version published
Weekly downloads
1.6K
-8.07%
Maintainers
2
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 18 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts