@caperjs/plugin-google-analytics 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) Relish Interactive
4
+ Copyright (c) 2026 Anthony Sapp
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,27 @@
1
+ import { IApplication, IPlugin, Plugin } from '@caperjs/core';
2
+ type ConfigParams = Gtag.ConfigParams & Gtag.ControlParams & Gtag.EventParams & Gtag.ConfigParams & Gtag.CustomParams;
3
+ export type GoogleAnalyticsPluginOptions = ConfigParams & {
4
+ trackingId?: string | string[];
5
+ dataLayerName?: string;
6
+ debug?: boolean;
7
+ };
8
+ export type GAEvents = Record<string, unknown>;
9
+ export interface IGoogleAnalyticsPlugin<E extends GAEvents = GAEvents> extends IPlugin<GoogleAnalyticsPluginOptions> {
10
+ initialize(options: Partial<GoogleAnalyticsPluginOptions>, app: IApplication): void;
11
+ gtag(...args: any[]): void;
12
+ trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]): void;
13
+ }
14
+ export declare class GoogleAnalyticsPlugin<E extends GAEvents = GAEvents> extends Plugin<GoogleAnalyticsPluginOptions> implements IGoogleAnalyticsPlugin<E> {
15
+ private _options;
16
+ private _dataLayer;
17
+ private _queue;
18
+ initialize(options: Partial<GoogleAnalyticsPluginOptions>, _app: IApplication): Promise<void>;
19
+ private hello;
20
+ private initDataLayer;
21
+ private drainQueue;
22
+ private install;
23
+ gtag(...args: any[]): void;
24
+ trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]): void;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=GoogleAnalyticsPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleAnalyticsPlugin.d.ts","sourceRoot":"","sources":["../src/GoogleAnalyticsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAA2B,MAAM,EAAE,MAAM,eAAe,CAAC;AAGhE,KAAK,YAAY,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;AAEtH,MAAM,MAAM,4BAA4B,GAAG,YAAY,GAAG;IACxD,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,OAAO,CAAC,4BAA4B,CAAC;IAClH,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IACpF,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACrE;AAED,qBAAa,qBAAqB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,CAC9D,SAAQ,MAAM,CAAC,4BAA4B,CAC3C,YAAW,sBAAsB,CAAC,CAAC,CAAC;IAEpC,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,MAAM,CAAa;IAErB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,EAAE,IAAI,EAAE,YAAY;IAiBnF,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,OAAO;IA+BR,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAanB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAGpE"}
@@ -0,0 +1,54 @@
1
+ import { Logger as e, Plugin as t, isDev as n, omitKeys as r } from "@caperjs/core";
2
+ //#region src/version.ts
3
+ var i = "0.1.0", a = class extends t {
4
+ constructor(...e) {
5
+ super(...e), this._queue = [];
6
+ }
7
+ async initialize(t, r) {
8
+ if (this._options = {
9
+ debug: n,
10
+ trackingId: r.env.VITE_GOOGLE_ANALYTICS_TRACKING_ID || r.env.GOOGLE_ANALYTICS_TRACKING_ID,
11
+ ...t
12
+ }, this.hello(), this.install(), !this._options.trackingId) {
13
+ e.warn("[Caper Google Analytics Plugin] Google Analytics tracking ID is not set, please set `VITE_GOOGLE_ANALYTICS_TRACKING_ID` or `GOOGLE_ANALYTICS_TRACKING_ID` environment variable.");
14
+ return;
15
+ }
16
+ }
17
+ hello() {
18
+ let t = `%c Caper Google Analytics Plugin v${i}`;
19
+ console.log(t, "background: rgba(31, 41, 55, 1);color: #74b64c"), this._options.debug && e.log(this._options);
20
+ }
21
+ initDataLayer() {
22
+ let e = window, t = this._options.dataLayerName || "dataLayer";
23
+ e[t] = e[t] || [], this._dataLayer = e[t], this.drainQueue();
24
+ }
25
+ drainQueue() {
26
+ for (; this._queue.length > 0;) {
27
+ let e = this._queue.shift();
28
+ this._dataLayer.push(e);
29
+ }
30
+ }
31
+ install() {
32
+ if (!this._options.trackingId) return;
33
+ let e = "ga-gtag";
34
+ if (document.getElementById(e)) return;
35
+ let { head: t } = document, n = document.createElement("script"), i = `https://www.googletagmanager.com/gtag/js?id=${this._options.trackingId}`;
36
+ this._options.dataLayerName && (i += `&l=${this._options.dataLayerName}`), n.id = e, n.async = !0, n.src = i, t.insertBefore(n, t.firstChild), this.initDataLayer(), this.gtag("js", /* @__PURE__ */ new Date()), Array.isArray(this._options.trackingId) || (this._options.trackingId = [this._options.trackingId]), this._options.trackingId.forEach((e) => {
37
+ this.gtag("config", e, r(["trackingId"], this._options));
38
+ });
39
+ }
40
+ gtag(...t) {
41
+ if (n && e.log(`gtag(${JSON.stringify(t)})`), !this._dataLayer) {
42
+ this._queue.push(t);
43
+ return;
44
+ }
45
+ this._dataLayer.push(t);
46
+ }
47
+ trackEvent(e, t) {
48
+ this.gtag("event", e, t || {});
49
+ }
50
+ };
51
+ //#endregion
52
+ export { a as default };
53
+
54
+ //# sourceMappingURL=caper-plugin-google-analytics.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caper-plugin-google-analytics.mjs","names":[],"sources":["../src/version.ts","../src/GoogleAnalyticsPlugin.ts","../src/index.ts"],"sourcesContent":["export const version = '0.1.0';","import type { IApplication, IPlugin } from '@caperjs/core';\nimport { isDev, Logger, omitKeys, Plugin } from '@caperjs/core';\nimport { version } from './version';\n\ntype ConfigParams = Gtag.ConfigParams & Gtag.ControlParams & Gtag.EventParams & Gtag.ConfigParams & Gtag.CustomParams;\n\nexport type GoogleAnalyticsPluginOptions = ConfigParams & {\n trackingId?: string | string[];\n dataLayerName?: string;\n debug?: boolean;\n};\n\nexport type GAEvents = Record<string, unknown>;\n\nexport interface IGoogleAnalyticsPlugin<E extends GAEvents = GAEvents> extends IPlugin<GoogleAnalyticsPluginOptions> {\n initialize(options: Partial<GoogleAnalyticsPluginOptions>, app: IApplication): void;\n gtag(...args: any[]): void;\n trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]): void;\n}\n\nexport class GoogleAnalyticsPlugin<E extends GAEvents = GAEvents>\n extends Plugin<GoogleAnalyticsPluginOptions>\n implements IGoogleAnalyticsPlugin<E>\n{\n private _options: GoogleAnalyticsPluginOptions;\n private _dataLayer: { push: (args: any) => void };\n private _queue: any[] = [];\n\n async initialize(options: Partial<GoogleAnalyticsPluginOptions>, _app: IApplication) {\n this._options = {\n debug: isDev,\n trackingId: _app.env.VITE_GOOGLE_ANALYTICS_TRACKING_ID || _app.env.GOOGLE_ANALYTICS_TRACKING_ID,\n ...options,\n };\n this.hello();\n this.install();\n\n if (!this._options.trackingId) {\n Logger.warn(\n '[Caper Google Analytics Plugin] Google Analytics tracking ID is not set, please set `VITE_GOOGLE_ANALYTICS_TRACKING_ID` or `GOOGLE_ANALYTICS_TRACKING_ID` environment variable.',\n );\n return;\n }\n }\n\n private hello() {\n const hello = `%c Caper Google Analytics Plugin v${version}`;\n console.log(hello, 'background: rgba(31, 41, 55, 1);color: #74b64c');\n\n if (this._options.debug) {\n Logger.log(this._options);\n }\n }\n\n private initDataLayer() {\n const windowAsAny = window as any;\n const dlName = this._options.dataLayerName || 'dataLayer';\n windowAsAny[dlName] = windowAsAny[dlName] || [];\n this._dataLayer = windowAsAny[dlName];\n\n this.drainQueue();\n }\n\n private drainQueue() {\n while (this._queue.length > 0) {\n const args = this._queue.shift();\n this._dataLayer.push(args);\n }\n }\n\n private install() {\n if (!this._options.trackingId) {\n return;\n }\n\n const scriptId = 'ga-gtag';\n\n if (document.getElementById(scriptId)) return;\n\n const { head } = document;\n const script = document.createElement('script');\n let src = `https://www.googletagmanager.com/gtag/js?id=${this._options.trackingId}`;\n if (this._options.dataLayerName) src += `&l=${this._options.dataLayerName}`;\n script.id = scriptId;\n script.async = true;\n script.src = src;\n head.insertBefore(script, head.firstChild);\n\n this.initDataLayer();\n\n this.gtag('js', new Date());\n\n if (!Array.isArray(this._options.trackingId)) {\n this._options.trackingId = [this._options.trackingId];\n }\n\n this._options.trackingId.forEach((trackingId) => {\n this.gtag('config', trackingId, omitKeys(['trackingId'], this._options));\n });\n }\n\n public gtag(...args: any[]) {\n if (isDev) {\n Logger.log(`gtag(${JSON.stringify(args)})`);\n }\n\n if (!this._dataLayer) {\n this._queue.push(args);\n return;\n }\n\n this._dataLayer.push(args);\n }\n\n public trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]) {\n this.gtag('event', eventName as string, eventData || {});\n }\n}\n","import { GoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';\nexport type { GAEvents, GoogleAnalyticsPluginOptions, IGoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';\n\nexport default GoogleAnalyticsPlugin;\n"],"mappings":";;AAAA,IAAa,IAAU,SEGvB,IDiBA,cACU,EAEV;;6BAG0B,EAAE;;CAE1B,MAAM,WAAW,GAAgD,GAAoB;AASnF,MARA,KAAK,WAAW;GACd,OAAO;GACP,YAAY,EAAK,IAAI,qCAAqC,EAAK,IAAI;GACnE,GAAG;GACJ,EACD,KAAK,OAAO,EACZ,KAAK,SAAS,EAEV,CAAC,KAAK,SAAS,YAAY;AAC7B,KAAO,KACL,kLACD;AACD;;;CAIJ,QAAgB;EACd,IAAM,IAAQ,qCAAqC;AAGnD,EAFA,QAAQ,IAAI,GAAO,iDAAiD,EAEhE,KAAK,SAAS,SAChB,EAAO,IAAI,KAAK,SAAS;;CAI7B,gBAAwB;EACtB,IAAM,IAAc,QACd,IAAS,KAAK,SAAS,iBAAiB;AAI9C,EAHA,EAAY,KAAU,EAAY,MAAW,EAAE,EAC/C,KAAK,aAAa,EAAY,IAE9B,KAAK,YAAY;;CAGnB,aAAqB;AACnB,SAAO,KAAK,OAAO,SAAS,IAAG;GAC7B,IAAM,IAAO,KAAK,OAAO,OAAO;AAChC,QAAK,WAAW,KAAK,EAAK;;;CAI9B,UAAkB;AAChB,MAAI,CAAC,KAAK,SAAS,WACjB;EAGF,IAAM,IAAW;AAEjB,MAAI,SAAS,eAAe,EAAS,CAAE;EAEvC,IAAM,EAAE,YAAS,UACX,IAAS,SAAS,cAAc,SAAS,EAC3C,IAAM,+CAA+C,KAAK,SAAS;AAevE,EAdI,KAAK,SAAS,kBAAe,KAAO,MAAM,KAAK,SAAS,kBAC5D,EAAO,KAAK,GACZ,EAAO,QAAQ,IACf,EAAO,MAAM,GACb,EAAK,aAAa,GAAQ,EAAK,WAAW,EAE1C,KAAK,eAAe,EAEpB,KAAK,KAAK,sBAAM,IAAI,MAAM,CAAC,EAEtB,MAAM,QAAQ,KAAK,SAAS,WAAW,KAC1C,KAAK,SAAS,aAAa,CAAC,KAAK,SAAS,WAAW,GAGvD,KAAK,SAAS,WAAW,SAAS,MAAe;AAC/C,QAAK,KAAK,UAAU,GAAY,EAAS,CAAC,aAAa,EAAE,KAAK,SAAS,CAAC;IACxE;;CAGJ,KAAY,GAAG,GAAa;AAK1B,MAJI,KACF,EAAO,IAAI,QAAQ,KAAK,UAAU,EAAK,CAAC,GAAG,EAGzC,CAAC,KAAK,YAAY;AACpB,QAAK,OAAO,KAAK,EAAK;AACtB;;AAGF,OAAK,WAAW,KAAK,EAAK;;CAG5B,WAAqC,GAAc,GAAkB;AACnE,OAAK,KAAK,SAAS,GAAqB,KAAa,EAAE,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { GoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';
2
+ export type { GAEvents, GoogleAnalyticsPluginOptions, IGoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';
3
+ export default GoogleAnalyticsPlugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,QAAQ,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAE9G,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const version = "0.1.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@caperjs/plugin-google-analytics",
3
+ "version": "0.1.0",
4
+ "description": "Google Analytics",
5
+ "files": [
6
+ "lib",
7
+ "src"
8
+ ],
9
+ "main": "lib/caper-plugin-google-analytics.mjs",
10
+ "types": "lib/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "default": "./lib/caper-plugin-google-analytics.mjs",
14
+ "types": "./lib/index.d.ts"
15
+ }
16
+ },
17
+ "sideEffects": false,
18
+ "keywords": [
19
+ "google",
20
+ "analytics",
21
+ "google-analytics",
22
+ "@caperjs/core",
23
+ "caper"
24
+ ],
25
+ "author": "",
26
+ "license": "MIT",
27
+ "devDependencies": {
28
+ "vite": "^8.0.7",
29
+ "vite-plugin-dts": "^4.5.3",
30
+ "@caperjs/core": "0.1.0"
31
+ },
32
+ "peerDependencies": {
33
+ "@caperjs/core": "0.1.0"
34
+ },
35
+ "dependencies": {
36
+ "@types/gtag.js": "^0.0.20"
37
+ },
38
+ "scripts": {
39
+ "build": "pnpm run version && vite build",
40
+ "test": "echo \"Error: no test specified\" && exit 1",
41
+ "version": "node generateVersion.mjs"
42
+ }
43
+ }
@@ -0,0 +1,118 @@
1
+ import type { IApplication, IPlugin } from '@caperjs/core';
2
+ import { isDev, Logger, omitKeys, Plugin } from '@caperjs/core';
3
+ import { version } from './version';
4
+
5
+ type ConfigParams = Gtag.ConfigParams & Gtag.ControlParams & Gtag.EventParams & Gtag.ConfigParams & Gtag.CustomParams;
6
+
7
+ export type GoogleAnalyticsPluginOptions = ConfigParams & {
8
+ trackingId?: string | string[];
9
+ dataLayerName?: string;
10
+ debug?: boolean;
11
+ };
12
+
13
+ export type GAEvents = Record<string, unknown>;
14
+
15
+ export interface IGoogleAnalyticsPlugin<E extends GAEvents = GAEvents> extends IPlugin<GoogleAnalyticsPluginOptions> {
16
+ initialize(options: Partial<GoogleAnalyticsPluginOptions>, app: IApplication): void;
17
+ gtag(...args: any[]): void;
18
+ trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]): void;
19
+ }
20
+
21
+ export class GoogleAnalyticsPlugin<E extends GAEvents = GAEvents>
22
+ extends Plugin<GoogleAnalyticsPluginOptions>
23
+ implements IGoogleAnalyticsPlugin<E>
24
+ {
25
+ private _options: GoogleAnalyticsPluginOptions;
26
+ private _dataLayer: { push: (args: any) => void };
27
+ private _queue: any[] = [];
28
+
29
+ async initialize(options: Partial<GoogleAnalyticsPluginOptions>, _app: IApplication) {
30
+ this._options = {
31
+ debug: isDev,
32
+ trackingId: _app.env.VITE_GOOGLE_ANALYTICS_TRACKING_ID || _app.env.GOOGLE_ANALYTICS_TRACKING_ID,
33
+ ...options,
34
+ };
35
+ this.hello();
36
+ this.install();
37
+
38
+ if (!this._options.trackingId) {
39
+ Logger.warn(
40
+ '[Caper Google Analytics Plugin] Google Analytics tracking ID is not set, please set `VITE_GOOGLE_ANALYTICS_TRACKING_ID` or `GOOGLE_ANALYTICS_TRACKING_ID` environment variable.',
41
+ );
42
+ return;
43
+ }
44
+ }
45
+
46
+ private hello() {
47
+ const hello = `%c Caper Google Analytics Plugin v${version}`;
48
+ console.log(hello, 'background: rgba(31, 41, 55, 1);color: #74b64c');
49
+
50
+ if (this._options.debug) {
51
+ Logger.log(this._options);
52
+ }
53
+ }
54
+
55
+ private initDataLayer() {
56
+ const windowAsAny = window as any;
57
+ const dlName = this._options.dataLayerName || 'dataLayer';
58
+ windowAsAny[dlName] = windowAsAny[dlName] || [];
59
+ this._dataLayer = windowAsAny[dlName];
60
+
61
+ this.drainQueue();
62
+ }
63
+
64
+ private drainQueue() {
65
+ while (this._queue.length > 0) {
66
+ const args = this._queue.shift();
67
+ this._dataLayer.push(args);
68
+ }
69
+ }
70
+
71
+ private install() {
72
+ if (!this._options.trackingId) {
73
+ return;
74
+ }
75
+
76
+ const scriptId = 'ga-gtag';
77
+
78
+ if (document.getElementById(scriptId)) return;
79
+
80
+ const { head } = document;
81
+ const script = document.createElement('script');
82
+ let src = `https://www.googletagmanager.com/gtag/js?id=${this._options.trackingId}`;
83
+ if (this._options.dataLayerName) src += `&l=${this._options.dataLayerName}`;
84
+ script.id = scriptId;
85
+ script.async = true;
86
+ script.src = src;
87
+ head.insertBefore(script, head.firstChild);
88
+
89
+ this.initDataLayer();
90
+
91
+ this.gtag('js', new Date());
92
+
93
+ if (!Array.isArray(this._options.trackingId)) {
94
+ this._options.trackingId = [this._options.trackingId];
95
+ }
96
+
97
+ this._options.trackingId.forEach((trackingId) => {
98
+ this.gtag('config', trackingId, omitKeys(['trackingId'], this._options));
99
+ });
100
+ }
101
+
102
+ public gtag(...args: any[]) {
103
+ if (isDev) {
104
+ Logger.log(`gtag(${JSON.stringify(args)})`);
105
+ }
106
+
107
+ if (!this._dataLayer) {
108
+ this._queue.push(args);
109
+ return;
110
+ }
111
+
112
+ this._dataLayer.push(args);
113
+ }
114
+
115
+ public trackEvent<K extends keyof E>(eventName: K, eventData?: E[K]) {
116
+ this.gtag('event', eventName as string, eventData || {});
117
+ }
118
+ }
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { GoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';
2
+ export type { GAEvents, GoogleAnalyticsPluginOptions, IGoogleAnalyticsPlugin } from './GoogleAnalyticsPlugin';
3
+
4
+ export default GoogleAnalyticsPlugin;
package/src/version.ts ADDED
@@ -0,0 +1 @@
1
+ export const version = '0.1.0';