nuxtjs-vk-pixel 0.0.3 → 0.0.4

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,7 +1,7 @@
1
1
  {
2
2
  "name": "vk-pixel",
3
3
  "configKey": "vkPixel",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1 +1,2 @@
1
- export declare function useVkPixel(): unknown;
1
+ import type { IVkPixel } from './types.js';
2
+ export declare function useVkPixel(): IVkPixel;
@@ -1,7 +1,7 @@
1
- import type { IVkPixelTmr } from './types.js';
1
+ import type { IVkPixel } from './types.js';
2
2
  declare const _default: import("#app").Plugin<{
3
- vkPixel: IVkPixelTmr;
3
+ vkPixel: IVkPixel;
4
4
  }> & import("#app").ObjectPlugin<{
5
- vkPixel: IVkPixelTmr;
5
+ vkPixel: IVkPixel;
6
6
  }>;
7
7
  export default _default;
@@ -32,14 +32,18 @@ export default defineNuxtPlugin({
32
32
  const vkPixel = {
33
33
  push(payload) {
34
34
  proxy.push({
35
+ type: "pageView",
36
+ url: window.location.href,
37
+ start: (/* @__PURE__ */ new Date()).getTime(),
35
38
  ...payload,
36
39
  id
37
40
  });
38
41
  },
39
42
  pageView(payload) {
40
43
  proxy.pageView({
41
- ...payload,
42
- id
44
+ id,
45
+ url: payload.url ? payload.url : window.location.href,
46
+ referrer: payload.referrer ? payload.referrer : document.referrer
43
47
  });
44
48
  }
45
49
  };
@@ -21,5 +21,6 @@ export interface IVkPixelTmr {
21
21
  push: (payload: IPushPayload) => void;
22
22
  }
23
23
  export interface IVkPixel {
24
- tmr?: IVkPixelTmr;
24
+ pageView: (payload: Partial<IPageViewPayload>) => void;
25
+ push: (payload: Partial<IPushPayload>) => void;
25
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxtjs-vk-pixel",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "NuxtJS VK Pixel module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "name": "Dmitrii Lartsev <https://github.com/chemist-repo/>",
12
12
  "url": "https://github.com/chemist-repo"
13
13
  },
14
- "homepage": "chemist-repo/nuxtjs-vk-pixel",
14
+ "homepage": "https://github.com/chemist-repo/nuxtjs-vk-pixel",
15
15
  "license": "MIT",
16
16
  "exports": {
17
17
  ".": {