Code Monkey home page Code Monkey logo

gitbook-plugin-yametrika's Introduction

Yandex Metrika tracker

This is a best tracker from Russia! Enjoy it!

Install

$ npm install gitbook-plugin-yametrika

How to use it?

Create your tracker in Ya.Metrika.

Next you can use it for your book with in the book.json:

{
    "plugins": ["yametrika"]
}

You can set the Yandex Metrika tracking ID using the plugins configuration in the book.json:

{
    "plugins": ["yametrika"],
    "pluginsConfig": {
        "yametrika": {
            "number": 1111111
        }
    }
}

You can customize the tracker object by passing additional configuration options.

{
    "plugins": ["yametrika"],
    "pluginsConfig": {
        "yametrika": {
            "number": 11111111,
            "settings": {
                "webvisor": true,
                "clickmap": true,
                "trackLinks": true,
                "accurateTrackBounce": true,
                "trackHash": true,
                "ut": "noindex"
            }
        }
    }
}

When using GitBook 3, the whole configuration settings should be set directly in the "yametrika" property, using the default configuration for the API:

{
    "plugins": ["yametrika"],
    "pluginsConfig": {
        "yametrika": {
            "id": 11111111,
            "webvisor": true,
            "clickmap": true,
            "trackLinks": true,
            "accurateTrackBounce": true,
            "trackHash": true,
            "ut": "noindex"
        }
    }
}

Available for customize options:

  • Webvisor (Вебвизор)
  • Clickmap (Карта кликов)
  • TrackLinks (Внешние ссылки, загрузки файлов и отчёт по кнопке «Поделиться»)
  • AccurateTrackBounce (Точный показатель отказов)
  • TrackHash (Отслеживание хеша в адресной строке)
  • Ut (Запрет на индексацию страниц)
To use the option, you must specify it in the object "settings" with the status "true", if you do not want to use - just do not specify the object "settings"

NOTICE

default track options status:

  • Webvisor (Вебвизор) - false (!new)
  • Clickmap (Карта кликов) - false (!new)
  • TrackLinks (Внешние ссылки, загрузки файлов и отчёт по кнопке «Поделиться») - false (!new)
  • AccurateTrackBounce (Точный показатель отказов) - false (!new)
  • Informer (Информер) - false
  • Ut (Запрет на индексацию страниц) - false
  • Async (Асинхронный код) - true
  • TrackHash (Отслеживание хеша в адресной строке) - false
  • XML (Для xml сайтов) - false
  • Params example - false
  • OneRow (Счетчик в одну строку) - true

TO DO

Include choose the Informer, Async, XML, Params example, OneRow options in book.json.

gitbook-plugin-yametrika's People

Contributors

jpreynat avatar mikaspell avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jpreynat

gitbook-plugin-yametrika's Issues

Uncaught SyntaxError: Unexpected string

Hi @mikaspell,

when load your plugin, browser's console throws out an exception:

Uncaught SyntaxError: Unexpected string      plugin.js:7

I read your code in plugin.js

var yaCounter"+config.number+" = new Ya.Metrika({id: "+config.number+"});

It seems that there is a SyntaxError just after var.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.