Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gitbook-org/plugin-ga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

26 Commits

Repository files navigation

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.

About

Google Analytics tracking for your book

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%

AltStyle によって変換されたページ (->オリジナル) /