@funnelsgrove/analytics 0.19.0 → 0.21.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type MetaPixelEventName = 'AddPaymentInfo' | 'InitiateCheckout' | 'Lead' | 'ViewContent';
|
|
1
|
+
type MetaPixelEventName = 'AddPaymentInfo' | 'CompleteRegistration' | 'InitiateCheckout' | 'Lead' | 'ViewContent';
|
|
2
2
|
export type MetaPixelTrackInput = {
|
|
3
3
|
eventName: MetaPixelEventName;
|
|
4
4
|
eventId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isSystemPreviewHostname } from '@funnelsgrove/runtime';
|
|
2
|
-
import { META_PIXEL_ENABLED, META_PIXEL_ID, STRIPE_ACTIVE_MODE } from './runtime-api.config.js';
|
|
2
|
+
import { META_LEAD_EVENT_NAME, META_PIXEL_ENABLED, META_PIXEL_ID, STRIPE_ACTIVE_MODE } from './runtime-api.config.js';
|
|
3
3
|
import { buildPurchaseAnalyticsAttributes } from './purchase-attributes.service.js';
|
|
4
4
|
const toNumber = (value) => {
|
|
5
5
|
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
@@ -56,7 +56,7 @@ export const mapAnalyticsEventToMetaPixelEvent = (event) => {
|
|
|
56
56
|
case 'email_captured':
|
|
57
57
|
case 'lead':
|
|
58
58
|
return {
|
|
59
|
-
eventName:
|
|
59
|
+
eventName: META_LEAD_EVENT_NAME,
|
|
60
60
|
eventId: event.eventId,
|
|
61
61
|
customData: {},
|
|
62
62
|
};
|
|
@@ -7,6 +7,7 @@ export declare const POSTHOG_API_HOST = "/ingest";
|
|
|
7
7
|
export declare const POSTHOG_PROJECT_API_KEY: string;
|
|
8
8
|
export declare const META_PIXEL_ENABLED: boolean;
|
|
9
9
|
export declare const META_PIXEL_ID: string;
|
|
10
|
+
export declare const META_LEAD_EVENT_NAME: import("@funnelsgrove/runtime").MetaLeadEventName;
|
|
10
11
|
export declare const GOOGLE_ANALYTICS_ID: string;
|
|
11
12
|
export declare const GOOGLE_TAG_MANAGER_ID: string;
|
|
12
13
|
export declare const GOOGLE_TAG_EVENT_TARGET: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2
|
-
import { resolveRuntimeSdkApiBaseUrl, runtimeEnvConfig, } from '@funnelsgrove/runtime/config/env.config';
|
|
2
|
+
import { resolveMetaLeadEventName, resolveRuntimeSdkApiBaseUrl, runtimeEnvConfig, } from '@funnelsgrove/runtime/config/env.config';
|
|
3
3
|
const DEFAULT_API_BASE_URL = 'https://sdk-api.funnelsgrove.com';
|
|
4
4
|
const DEFAULT_FUNNEL_SDK_PUBLISHABLE_KEY = 'pk_test_app_deals_seed_public';
|
|
5
5
|
const trimTrailingSlash = (value) => {
|
|
@@ -41,6 +41,7 @@ export const POSTHOG_API_HOST = '/ingest';
|
|
|
41
41
|
export const POSTHOG_PROJECT_API_KEY = ((_f = runtimeEnvConfig.posthogProjectApiKey) !== null && _f !== void 0 ? _f : '').trim();
|
|
42
42
|
export const META_PIXEL_ENABLED = ((_g = runtimeEnvConfig.metaPixelEnabled) !== null && _g !== void 0 ? _g : '').trim() === 'true';
|
|
43
43
|
export const META_PIXEL_ID = ((_h = runtimeEnvConfig.metaPixelId) !== null && _h !== void 0 ? _h : '').trim();
|
|
44
|
+
export const META_LEAD_EVENT_NAME = resolveMetaLeadEventName(runtimeEnvConfig.metaLeadEventName);
|
|
44
45
|
export const GOOGLE_ANALYTICS_ID = trimEnv(runtimeEnvConfig.googleAnalyticsId);
|
|
45
46
|
export const GOOGLE_TAG_MANAGER_ID = trimEnv(runtimeEnvConfig.googleTagManagerId);
|
|
46
47
|
export const GOOGLE_TAG_EVENT_TARGET = trimEnv(runtimeEnvConfig.googleTagEventTarget);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnelsgrove/analytics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@types/node": "^20",
|
|
46
46
|
"typescript": "^5",
|
|
47
47
|
"vitest": "^3.2.4",
|
|
48
|
-
"@funnelsgrove/runtime": "0.
|
|
48
|
+
"@funnelsgrove/runtime": "0.39.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@funnelsgrove/runtime": "^0.
|
|
51
|
+
"@funnelsgrove/runtime": "^0.39.0"
|
|
52
52
|
}
|
|
53
53
|
}
|