@happyvertical/analytics 0.102.0 → 0.102.1
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/shared/factory.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Factory function for creating analytics provider instances
|
|
3
|
+
*/
|
|
4
|
+
import type { AnalyticsInterface, GetAnalyticsOptions } from './types.js';
|
|
2
5
|
/**
|
|
3
6
|
* Creates an analytics provider instance based on the provided options.
|
|
4
7
|
*
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Google Analytics 4 provider implementation
|
|
3
|
+
*
|
|
4
|
+
* Uses three APIs internally:
|
|
5
|
+
* - Admin API: Property management, data streams, custom definitions
|
|
6
|
+
* - Data API: Reports and analytics queries
|
|
7
|
+
* - Measurement Protocol: Server-side event tracking
|
|
8
|
+
*/
|
|
9
|
+
import type { AnalyticsCapabilities, AnalyticsInterface, ConfigOptions, CreateDataStreamOptions, CreatePropertyOptions, CustomDimension, CustomDimensionOptions, CustomMetric, CustomMetricOptions, DataStream, DimensionMetadata, GA4Options, KeyEvent, KeyEventOptions, ListPropertiesOptions, MetricMetadata, PageviewEvent, Property, RealtimeReportOptions, ReportOptions, ReportResult, SnippetOptions, TrackEvent, TrackingSnippet, UpdatePropertyOptions } from '../types.js';
|
|
2
10
|
/**
|
|
3
11
|
* Google Analytics 4 provider
|
|
4
12
|
*/
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Matomo admin client.
|
|
3
|
+
*
|
|
4
|
+
* Implements `AnalyticsAdminInterface` against Matomo's Reporting API. Matomo
|
|
5
|
+
* exposes everything we need on a single endpoint (`POST {baseUrl}/index.php`)
|
|
6
|
+
* with the action selected via `module=API` + `method=...`.
|
|
7
|
+
*
|
|
8
|
+
* Auth is `token_auth` — passed in the POST body, never the URL, so it does
|
|
9
|
+
* not appear in proxy/access logs.
|
|
10
|
+
*/
|
|
11
|
+
import { type AnalyticsAccessVerificationResult, type AnalyticsAdminInterface, type AnalyticsHealthResult, type AnalyticsSite, type AnalyticsUser, type AnalyticsUserToken, type CreateAnalyticsSiteOptions, type CreateAnalyticsUserOptions, type MintUserTokenOptions, type SetUserAccessOptions, type UpdateAnalyticsSiteOptions, type VerifyTokenSiteAccessOptions, type VerifyUserSiteAccessOptions } from '../types.js';
|
|
2
12
|
export interface MatomoAdminTransportOptions {
|
|
3
13
|
baseUrl: string;
|
|
4
14
|
tokenAuth: string;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Matomo Analytics provider implementation.
|
|
3
|
+
*
|
|
4
|
+
* This first cut implements:
|
|
5
|
+
* - The full `AnalyticsAdminInterface` (sites, users, access, tokens, health)
|
|
6
|
+
* via {@link MatomoAdmin}. This is the API the tenant doctor uses.
|
|
7
|
+
* - The `AnalyticsInterface` property-management surface, by delegating to the
|
|
8
|
+
* admin (a Matomo "site" maps 1:1 to a GA4-style "property").
|
|
9
|
+
* - Capabilities, tracking-snippet generation, and a focused reporting surface
|
|
10
|
+
* for Matomo's VisitsSummary, Actions, Referrers, and Live APIs.
|
|
11
|
+
*
|
|
12
|
+
* GA4-specific concepts that don't translate cleanly (data streams, custom
|
|
13
|
+
* dimensions/metrics, key events, server-side tracking) throw
|
|
14
|
+
* `NotSupportedError`. Matomo has its own analogues (goals, custom dimensions
|
|
15
|
+
* plugin, Tracking HTTP API) — they need a different shape and don't belong on
|
|
16
|
+
* the GA4-shaped methods.
|
|
17
|
+
*/
|
|
18
|
+
import { type AnalyticsCapabilities, type AnalyticsInterface, type ConfigOptions, type CreateDataStreamOptions, type CreatePropertyOptions, type CustomDimension, type CustomDimensionOptions, type CustomMetric, type CustomMetricOptions, type DataStream, type DimensionMetadata, type KeyEvent, type KeyEventOptions, type ListPropertiesOptions, type MatomoOptions, type MetricMetadata, type PageviewEvent, type Property, type RealtimeReportOptions, type ReportOptions, type ReportResult, type SnippetOptions, type TrackEvent, type TrackingSnippet, type UpdatePropertyOptions } from '../types.js';
|
|
2
19
|
import { MatomoAdmin } from './matomo-admin.js';
|
|
3
20
|
export declare class MatomoProvider implements AnalyticsInterface {
|
|
4
21
|
private readonly baseUrl;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Plausible Analytics provider implementation
|
|
3
|
+
*
|
|
4
|
+
* Uses three APIs:
|
|
5
|
+
* - Sites API: Site management
|
|
6
|
+
* - Stats API v2: Reports and analytics queries
|
|
7
|
+
* - Events API: Server-side event tracking
|
|
8
|
+
*/
|
|
9
|
+
import type { AnalyticsCapabilities, AnalyticsInterface, ConfigOptions, CreateDataStreamOptions, CreatePropertyOptions, CustomDimension, CustomDimensionOptions, CustomMetric, CustomMetricOptions, DataStream, DimensionMetadata, KeyEvent, KeyEventOptions, ListPropertiesOptions, MetricMetadata, PageviewEvent, PlausibleOptions, Property, RealtimeReportOptions, ReportOptions, ReportResult, SnippetOptions, TrackEvent, TrackingSnippet, UpdatePropertyOptions } from '../types.js';
|
|
2
10
|
/**
|
|
3
11
|
* Plausible Analytics provider
|
|
4
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/analytics",
|
|
3
|
-
"version": "0.102.
|
|
3
|
+
"version": "0.102.1",
|
|
4
4
|
"description": "Unified analytics interface for Google Analytics 4, Plausible, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"homepage": "https://github.com/happyvertical/sdk/tree/main/packages/analytics#readme",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@happyvertical/utils": "0.102.
|
|
39
|
+
"@happyvertical/utils": "0.102.1",
|
|
40
40
|
"googleapis": "^170.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|