diff --git a/gatsby-config.js b/gatsby-config.js index 2ba3930..5f15076 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -39,6 +39,23 @@ module.exports = { }, }, }, + { + resolve: `gatsby-plugin-yandex-metrika`, + options: { + // The ID of yandex metrika. + trackingId: 67663189, + // 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, + }, + }, "gatsby-plugin-sitemap", { resolve: "gatsby-plugin-robots-txt", diff --git a/package-lock.json b/package-lock.json index 610e286..1e13d20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9355,6 +9355,11 @@ "babel-plugin-remove-graphql-queries": "^2.9.7" } }, + "gatsby-plugin-yandex-metrika": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/gatsby-plugin-yandex-metrika/-/gatsby-plugin-yandex-metrika-2.5.0.tgz", + "integrity": "sha512-2dJr9qpAwrKJTNGtr5FJDMIkQd3Kd5l4iNOMGZodvfe5uv7lgy9WH7uoFDeeFSvsg7cg+SKAKETPN1hEUry+zg==" + }, "gatsby-react-router-scroll": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/gatsby-react-router-scroll/-/gatsby-react-router-scroll-3.0.7.tgz", diff --git a/package.json b/package.json index 9b4f7a1..4e3e047 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "gatsby-plugin-sass": "^2.3.7", "gatsby-plugin-sharp": "^2.6.17", "gatsby-plugin-sitemap": "^2.4.11", + "gatsby-plugin-yandex-metrika": "^2.5.0", "gatsby-remark-autolink-headers": "^2.3.10", "gatsby-remark-copy-linked-files": "^2.3.11", "gatsby-remark-images": "^3.3.17",