Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viatsko/gatsby-plugin-yandex-metrika
Yandex Metrika plugin for GatsbyJS
https://github.com/viatsko/gatsby-plugin-yandex-metrika
gatsby gatsby-plugin yandex-metrika yandex-metrika-tracking
Last synced: about 2 months ago
JSON representation
Yandex Metrika plugin for GatsbyJS
- Host: GitHub
- URL: https://github.com/viatsko/gatsby-plugin-yandex-metrika
- Owner: viatsko
- License: mit
- Created: 2017-08-20T14:28:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T22:03:27.000Z (about 2 years ago)
- Last Synced: 2023-02-28T01:01:21.135Z (almost 2 years ago)
- Topics: gatsby, gatsby-plugin, yandex-metrika, yandex-metrika-tracking
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gatsby-plugin-yandex-metrika
- Size: 525 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-yandex-metrika
Easily add Yandex Metrika to your Gatsby site.
## Install
`npm install --save gatsby-plugin-yandex-metrika`## How to use
```javascript
// 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.
```javascript
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-yandex-metrika`,
options: {
trackingId: 12345,
webvisor: true,
trackHash: true,
afterBody: true,
defer: false,
useCDN: true,
},
},
]
```