@funnelsgrove/analytics 0.1.16 → 0.1.17

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/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './services/google-tag.service.js';
5
5
  export * from './services/meta-pixel.service.js';
6
6
  export * from './services/purchase-attributes.service.js';
7
7
  export * from './services/public-analytics-sdk.service.js';
8
+ export * from './services/experiment-result-metrics.service.js';
package/dist/index.js CHANGED
@@ -5,3 +5,4 @@ export * from './services/google-tag.service.js';
5
5
  export * from './services/meta-pixel.service.js';
6
6
  export * from './services/purchase-attributes.service.js';
7
7
  export * from './services/public-analytics-sdk.service.js';
8
+ export * from './services/experiment-result-metrics.service.js';
@@ -0,0 +1,7 @@
1
+ export type ExperimentResultMetricId = 'users' | 'ctr' | 'checkout' | 'subscription_rate' | 'subscribers' | 'arpu' | 'arppu';
2
+ export type ExperimentResultMetricDefinition = {
3
+ id: ExperimentResultMetricId;
4
+ label: string;
5
+ primary?: boolean;
6
+ };
7
+ export declare const getExperimentResultMetricDefinitions: (experimentType: string | null | undefined) => ExperimentResultMetricDefinition[];
@@ -0,0 +1,15 @@
1
+ const PAYWALL_METRICS = [
2
+ { id: 'users', label: 'Users' },
3
+ { id: 'checkout', label: 'Initiate checkout' },
4
+ { id: 'subscription_rate', label: 'Paywall to Subscription', primary: true },
5
+ { id: 'subscribers', label: 'Subscribers (payments count)' },
6
+ { id: 'arpu', label: 'ARPU' },
7
+ { id: 'arppu', label: 'ARPPU' },
8
+ ];
9
+ const STEP_METRICS = [
10
+ { id: 'ctr', label: 'CTR', primary: true },
11
+ { id: 'subscribers', label: 'Subscribers (payments count)' },
12
+ { id: 'arpu', label: 'ARPU' },
13
+ { id: 'arppu', label: 'ARPPU' },
14
+ ];
15
+ export const getExperimentResultMetricDefinitions = (experimentType) => ((experimentType === null || experimentType === void 0 ? void 0 : experimentType.trim().toLowerCase()) === 'step' ? STEP_METRICS : PAYWALL_METRICS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/analytics",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -11,6 +11,11 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js",
13
13
  "default": "./dist/index.js"
14
+ },
15
+ "./experiment-result-metrics": {
16
+ "types": "./dist/services/experiment-result-metrics.service.d.ts",
17
+ "import": "./dist/services/experiment-result-metrics.service.js",
18
+ "default": "./dist/services/experiment-result-metrics.service.js"
14
19
  }
15
20
  },
16
21
  "files": [