2.5.0 • Published 5 years ago

gatsby-plugin-yandex-metrika v2.5.0

Weekly downloads
294
License
MIT
Repository
-
Last release
5 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

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago