nuxt-yandex-metrika 1.2.4 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-yandex-metrika",
3
- "version": "1.2.4",
3
+ "version": "1.2.7",
4
4
  "configKey": "yandexMetrika",
5
5
  "compatibility": {
6
6
  "nuxt": "^3"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, addPlugin, addComponentsDir, addImpor
2
2
  import { defu } from 'defu';
3
3
 
4
4
  const name = "nuxt-yandex-metrika";
5
- const version = "1.2.4";
5
+ const version = "1.2.7";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -20,21 +20,29 @@ const module = defineNuxtModule({
20
20
  delay: 0,
21
21
  cdn: false,
22
22
  verification: null,
23
- options: {
24
- accurateTrackBounce: true,
25
- childIframe: true,
26
- clickmap: true,
27
- defer: false,
28
- ecommerce: false,
29
- trackHash: false,
30
- trackLinks: true,
31
- webvisor: false,
32
- triggerEvent: false,
33
- sendTitle: true
34
- }
23
+ options: {}
35
24
  },
36
25
  setup(options, nuxt) {
37
26
  nuxt.options.runtimeConfig.public.yandexMetrika = defu(
27
+ {
28
+ id: "xxx",
29
+ debug: process.env.NODE_ENV !== "production",
30
+ delay: 0,
31
+ cdn: false,
32
+ verification: null,
33
+ options: {
34
+ accurateTrackBounce: true,
35
+ childIframe: true,
36
+ clickmap: true,
37
+ defer: false,
38
+ ecommerce: false,
39
+ trackHash: false,
40
+ trackLinks: true,
41
+ webvisor: false,
42
+ triggerEvent: false,
43
+ sendTitle: true
44
+ }
45
+ },
38
46
  nuxt.options.runtimeConfig.public.yandexMetrika ?? {},
39
47
  options
40
48
  );
@@ -12,10 +12,6 @@ export default defineNuxtPlugin({
12
12
  {
13
13
  key: "yandex-metrika-ym",
14
14
  innerHTML: `window.ym=window.ym||function(){(window.ym.a=window.ym.a||[]).push(arguments)};window.ym.l=(new Date).getTime();`
15
- },
16
- {
17
- key: "yandex-metrika-init",
18
- innerHTML: `ym("${id}","${Methods.Init}", ${JSON.stringify(options)});`
19
15
  }
20
16
  ]
21
17
  });
@@ -50,6 +46,14 @@ export default defineNuxtPlugin({
50
46
  });
51
47
  }
52
48
  }
49
+ useHead({
50
+ script: [
51
+ {
52
+ key: "yandex-metrika-init",
53
+ innerHTML: `ym("${id}","${Methods.Init}", ${JSON.stringify(options)});`
54
+ }
55
+ ]
56
+ });
53
57
  const yandexMetrika = new YandexMetrika(id);
54
58
  yandexMetrika.debug = debug;
55
59
  yandexMetrika.verification = verification;
package/dist/types.d.mts CHANGED
@@ -17,37 +17,7 @@ import type { } from './module.js'
17
17
  /** @default null */
18
18
  verification: any,
19
19
 
20
- options: {
21
- /** @default true */
22
- accurateTrackBounce: boolean,
23
-
24
- /** @default true */
25
- childIframe: boolean,
26
-
27
- /** @default true */
28
- clickmap: boolean,
29
-
30
- /** @default false */
31
- defer: boolean,
32
-
33
- /** @default false */
34
- ecommerce: boolean,
35
-
36
- /** @default false */
37
- trackHash: boolean,
38
-
39
- /** @default true */
40
- trackLinks: boolean,
41
-
42
- /** @default false */
43
- webvisor: boolean,
44
-
45
- /** @default false */
46
- triggerEvent: boolean,
47
-
48
- /** @default true */
49
- sendTitle: boolean,
50
- },
20
+ options: any,
51
21
  }
52
22
 
53
23
  declare module '@nuxt/schema' {
package/dist/types.d.ts CHANGED
@@ -17,37 +17,7 @@ import type { } from './module'
17
17
  /** @default null */
18
18
  verification: any,
19
19
 
20
- options: {
21
- /** @default true */
22
- accurateTrackBounce: boolean,
23
-
24
- /** @default true */
25
- childIframe: boolean,
26
-
27
- /** @default true */
28
- clickmap: boolean,
29
-
30
- /** @default false */
31
- defer: boolean,
32
-
33
- /** @default false */
34
- ecommerce: boolean,
35
-
36
- /** @default false */
37
- trackHash: boolean,
38
-
39
- /** @default true */
40
- trackLinks: boolean,
41
-
42
- /** @default false */
43
- webvisor: boolean,
44
-
45
- /** @default false */
46
- triggerEvent: boolean,
47
-
48
- /** @default true */
49
- sendTitle: boolean,
50
- },
20
+ options: any,
51
21
  }
52
22
 
53
23
  declare module '@nuxt/schema' {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-yandex-metrika",
3
- "version": "1.2.4",
3
+ "version": "1.2.7",
4
4
  "description": "Add Yandex Metrika to your Nuxt 3 application.",
5
5
  "repository": {
6
6
  "type": "git",