2.5.0 • Published 4 years ago

gatsby-plugin-yandex-metrika v2.5.0

Weekly downloads
294
License
MIT
Repository
-
Last release
4 years ago

gatsby-plugin-yandex-metrika

Easily add Yandex Metrika to your Gatsby site.

Install

npm install --save gatsby-plugin-yandex-metrika

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-yandex-metrika`,
    options: {
      // The ID of yandex metrika.
      trackingId: 12345,
      // Enabled a webvisor. The default value is `false`.
      webvisor: true,
      // Enables tracking a hash in URL. The default value is `false`.
      trackHash: true,
      // Defines where to place the tracking script - `false` means before body (slower loading, more hits)
      // and `true` means after the body (faster loading, less hits). The default value is `false`.
      afterBody: true,
      // Use `defer` attribute of metrika script. If set to `false` - script will be loaded with `async` attribute.
      // Async enables earlier loading of the metrika but it can negatively affect page loading speed. The default value is `false`.
      defer: false,
    },
  },
]

CDN option

Option 'useCDN' allows to count visits from regions, where access to Yandex resources is limited. Using altetnative CDN address may decrease counter's code loading.

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-yandex-metrika`,
    options: {
      trackingId: 12345,
      webvisor: true,
      trackHash: true,
      afterBody: true,
      defer: false,
      useCDN: true,
    },
  },
]
2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago