diff --git a/README.md b/README.md index 15034a7..85064c0 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ or Import and initialise the tracker anywhere in the project import Analytics from 'analytics' - import { matomoPlugin } from '@wepublish/analytics' + import { wepublish } from '@wepublish/analytics' const analytics = Analytics({ app: 'Your app name', - plugins: [matomoPlugin()] + plugins: [wepublish()] }) then call the method on page load e.g. diff --git a/dist/index.d.ts b/dist/index.d.ts index 6d71a9a..4d2b871 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,6 +1,6 @@ -declare const matomoPlugin: () => { +declare const wepublish: () => { name: string; page: () => void; track: (params: any) => void; }; -export { matomoPlugin }; +export { wepublish }; diff --git a/dist/index.js b/dist/index.js index 26cc8e7..6296962 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.matomoPlugin = void 0; +exports.wepublish = void 0; const matomo_tracker_1 = require("@jonkoops/matomo-tracker"); const matomo = new matomo_tracker_1.default({ siteId: 1, @@ -10,9 +10,9 @@ let pageInterval; let pageTimeout; let trackInterval; let trackTimeout; -const matomoPlugin = () => { +const wepublish = () => { return { - name: "wp-matomo-analytics", + name: "wp-analytics", page: () => { if (pageInterval) { clearInterval(pageInterval); @@ -79,4 +79,4 @@ const matomoPlugin = () => { }, }; }; -exports.matomoPlugin = matomoPlugin; +exports.wepublish = wepublish; diff --git a/index.ts b/index.ts index 4910e5c..8f80615 100644 --- a/index.ts +++ b/index.ts @@ -10,9 +10,9 @@ let pageTimeout: number; let trackInterval: number; let trackTimeout: number; -const matomoPlugin = () => { +const wepublish = () => { return { - name: "wp-matomo-analytics", + name: "wp-analytics", page: () => { if (pageInterval) { clearInterval(pageInterval); @@ -94,4 +94,4 @@ const matomoPlugin = () => { }; }; -export { matomoPlugin }; +export { wepublish }; diff --git a/package.json b/package.json index 3242887..0ed521c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wepublish/analytics", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "Analytics plugin for publishers.", "license": "MIT", "repository": "wepublish/analytics",