@junctionjs/destination-meta 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/README.md +42 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +143 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @junctionjs/destination-meta
|
|
2
|
+
|
|
3
|
+
Meta Pixel + Conversions API destination for Junction.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Client-side via Meta Pixel (`fbq`)
|
|
8
|
+
- Server-side via Conversions API (CAPI)
|
|
9
|
+
- Both modes can run simultaneously for redundant delivery with deduplication via `event_id`
|
|
10
|
+
- Standard event mapping (PageView, ViewContent, Purchase, etc.)
|
|
11
|
+
- Advanced matching support
|
|
12
|
+
- Consent management via `fbq("consent", ...)`
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @junctionjs/destination-meta
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { meta } from "@junctionjs/destination-meta";
|
|
24
|
+
|
|
25
|
+
// In your collector config
|
|
26
|
+
const config = {
|
|
27
|
+
destinations: [
|
|
28
|
+
{
|
|
29
|
+
destination: meta,
|
|
30
|
+
config: {
|
|
31
|
+
pixelId: "YOUR_PIXEL_ID",
|
|
32
|
+
accessToken: process.env.META_CAPI_TOKEN, // server-side only
|
|
33
|
+
},
|
|
34
|
+
consent: ["marketing"],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Destination } from '@junctionjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @junctionjs/destination-meta
|
|
5
|
+
*
|
|
6
|
+
* Meta (Facebook) destination for Junction.
|
|
7
|
+
*
|
|
8
|
+
* Client-side: Meta Pixel (fbq)
|
|
9
|
+
* Server-side: Conversions API (CAPI)
|
|
10
|
+
*
|
|
11
|
+
* Design: Both modes can run simultaneously for "redundant" event
|
|
12
|
+
* delivery (Meta recommends this for signal quality + dedup).
|
|
13
|
+
* The event_id field is shared between pixel and CAPI for deduplication.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface MetaConfig {
|
|
17
|
+
/** Meta Pixel ID */
|
|
18
|
+
pixelId: string;
|
|
19
|
+
/** Conversions API access token (server-side only) */
|
|
20
|
+
accessToken?: string;
|
|
21
|
+
/** Test event code (for CAPI testing) */
|
|
22
|
+
testEventCode?: string;
|
|
23
|
+
/** Whether to load the Meta Pixel script if not present (default: true) */
|
|
24
|
+
loadScript?: boolean;
|
|
25
|
+
/** Enable advanced matching (hashed email, phone, etc.) */
|
|
26
|
+
advancedMatching?: boolean;
|
|
27
|
+
/** Custom event name mapping */
|
|
28
|
+
eventNameMap?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
declare const meta: Destination<MetaConfig>;
|
|
31
|
+
|
|
32
|
+
export { type MetaConfig, meta as default, meta };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var META_EVENT_MAP = {
|
|
3
|
+
"page:viewed": "PageView",
|
|
4
|
+
"product:viewed": "ViewContent",
|
|
5
|
+
"product:added": "AddToCart",
|
|
6
|
+
"product:list_viewed": "ViewContent",
|
|
7
|
+
"checkout:started": "InitiateCheckout",
|
|
8
|
+
"checkout:payment_added": "AddPaymentInfo",
|
|
9
|
+
"order:completed": "Purchase",
|
|
10
|
+
"search:performed": "Search",
|
|
11
|
+
"user:signed_up": "CompleteRegistration",
|
|
12
|
+
"user:subscribed": "Subscribe",
|
|
13
|
+
"lead:created": "Lead",
|
|
14
|
+
"content:viewed": "ViewContent",
|
|
15
|
+
"wishlist:added": "AddToWishlist"
|
|
16
|
+
};
|
|
17
|
+
function getMetaEventName(event, config) {
|
|
18
|
+
const key = `${event.entity}:${event.action}`;
|
|
19
|
+
return config.eventNameMap?.[key] ?? META_EVENT_MAP[key] ?? `Custom_${event.entity}_${event.action}`;
|
|
20
|
+
}
|
|
21
|
+
function mapToMetaParams(event) {
|
|
22
|
+
const props = event.properties;
|
|
23
|
+
const params = {};
|
|
24
|
+
if (props.total || props.revenue || props.price) {
|
|
25
|
+
params.value = props.total ?? props.revenue ?? props.price;
|
|
26
|
+
}
|
|
27
|
+
if (props.currency) params.currency = props.currency;
|
|
28
|
+
if (props.product_id || props.name) {
|
|
29
|
+
params.content_ids = [props.product_id ?? props.name];
|
|
30
|
+
params.content_name = props.name;
|
|
31
|
+
params.content_type = "product";
|
|
32
|
+
}
|
|
33
|
+
if (props.category) params.content_category = props.category;
|
|
34
|
+
if (props.search_term || props.query) params.search_string = props.search_term ?? props.query;
|
|
35
|
+
if (props.order_id) params.order_id = props.order_id;
|
|
36
|
+
if (props.quantity) params.num_items = props.quantity;
|
|
37
|
+
return params;
|
|
38
|
+
}
|
|
39
|
+
function buildCAPIPayload(event, eventName, params, config) {
|
|
40
|
+
return {
|
|
41
|
+
data: [
|
|
42
|
+
{
|
|
43
|
+
event_name: eventName,
|
|
44
|
+
event_time: Math.floor(new Date(event.timestamp).getTime() / 1e3),
|
|
45
|
+
event_id: event.id,
|
|
46
|
+
// shared with pixel for dedup
|
|
47
|
+
event_source_url: event.context.page?.url,
|
|
48
|
+
user_data: {
|
|
49
|
+
client_user_agent: event.context.device?.userAgent,
|
|
50
|
+
external_id: event.user.userId
|
|
51
|
+
// fbc/fbp cookies would be extracted from context
|
|
52
|
+
},
|
|
53
|
+
custom_data: params,
|
|
54
|
+
action_source: "website"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
...config.testEventCode ? { test_event_code: config.testEventCode } : {}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function loadPixel(pixelId) {
|
|
61
|
+
if (typeof window === "undefined") return;
|
|
62
|
+
if (typeof window.fbq === "function") return;
|
|
63
|
+
const n = window.fbq = function() {
|
|
64
|
+
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
|
|
65
|
+
};
|
|
66
|
+
if (!window._fbq) window._fbq = n;
|
|
67
|
+
n.push = n;
|
|
68
|
+
n.loaded = true;
|
|
69
|
+
n.version = "2.0";
|
|
70
|
+
n.queue = [];
|
|
71
|
+
const script = document.createElement("script");
|
|
72
|
+
script.async = true;
|
|
73
|
+
script.src = "https://connect.facebook.net/en_US/fbevents.js";
|
|
74
|
+
document.head.appendChild(script);
|
|
75
|
+
window.fbq("init", pixelId);
|
|
76
|
+
}
|
|
77
|
+
var meta = {
|
|
78
|
+
name: "meta",
|
|
79
|
+
description: "Meta Pixel + Conversions API",
|
|
80
|
+
version: "0.1.0",
|
|
81
|
+
consent: ["marketing"],
|
|
82
|
+
runtime: "both",
|
|
83
|
+
init(config) {
|
|
84
|
+
if (!config.pixelId) {
|
|
85
|
+
throw new Error("[Junction:Meta] pixelId is required");
|
|
86
|
+
}
|
|
87
|
+
if (typeof window !== "undefined" && config.loadScript !== false) {
|
|
88
|
+
loadPixel(config.pixelId);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
transform(event) {
|
|
92
|
+
if (event.entity === "_system") return null;
|
|
93
|
+
const eventName = getMetaEventName(event, {});
|
|
94
|
+
const params = mapToMetaParams(event);
|
|
95
|
+
return {
|
|
96
|
+
eventName,
|
|
97
|
+
params,
|
|
98
|
+
eventId: event.id,
|
|
99
|
+
event
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
async send(payload, config) {
|
|
103
|
+
const { eventName, params, eventId, event } = payload;
|
|
104
|
+
if (typeof window !== "undefined" && typeof window.fbq === "function") {
|
|
105
|
+
const isStandard = Object.values(META_EVENT_MAP).includes(eventName);
|
|
106
|
+
if (isStandard) {
|
|
107
|
+
window.fbq("track", eventName, params, { eventID: eventId });
|
|
108
|
+
} else {
|
|
109
|
+
window.fbq("trackCustom", eventName, params, { eventID: eventId });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (config.accessToken) {
|
|
113
|
+
const capiPayload = buildCAPIPayload(event, eventName, params, config);
|
|
114
|
+
const response = await fetch(
|
|
115
|
+
`https://graph.facebook.com/v19.0/${config.pixelId}/events?access_token=${config.accessToken}`,
|
|
116
|
+
{
|
|
117
|
+
method: "POST",
|
|
118
|
+
headers: { "Content-Type": "application/json" },
|
|
119
|
+
body: JSON.stringify(capiPayload)
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
const body = await response.text();
|
|
124
|
+
throw new Error(`Meta CAPI error (${response.status}): ${body}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
onConsent(state) {
|
|
129
|
+
if (typeof window !== "undefined" && typeof window.fbq === "function") {
|
|
130
|
+
if (state.marketing === false) {
|
|
131
|
+
window.fbq("consent", "revoke");
|
|
132
|
+
} else if (state.marketing === true) {
|
|
133
|
+
window.fbq("consent", "grant");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var index_default = meta;
|
|
139
|
+
export {
|
|
140
|
+
index_default as default,
|
|
141
|
+
meta
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @junctionjs/destination-meta\n *\n * Meta (Facebook) destination for Junction.\n *\n * Client-side: Meta Pixel (fbq)\n * Server-side: Conversions API (CAPI)\n *\n * Design: Both modes can run simultaneously for \"redundant\" event\n * delivery (Meta recommends this for signal quality + dedup).\n * The event_id field is shared between pixel and CAPI for deduplication.\n */\n\nimport type { Destination, JctEvent, ConsentState } from \"@junctionjs/core\";\n\n// ─── Configuration ───────────────────────────────────────────────\n\nexport interface MetaConfig {\n /** Meta Pixel ID */\n pixelId: string;\n\n /** Conversions API access token (server-side only) */\n accessToken?: string;\n\n /** Test event code (for CAPI testing) */\n testEventCode?: string;\n\n /** Whether to load the Meta Pixel script if not present (default: true) */\n loadScript?: boolean;\n\n /** Enable advanced matching (hashed email, phone, etc.) */\n advancedMatching?: boolean;\n\n /** Custom event name mapping */\n eventNameMap?: Record<string, string>;\n}\n\n// ─── Meta Standard Events ────────────────────────────────────────\n\nconst META_EVENT_MAP: Record<string, string> = {\n \"page:viewed\": \"PageView\",\n \"product:viewed\": \"ViewContent\",\n \"product:added\": \"AddToCart\",\n \"product:list_viewed\": \"ViewContent\",\n \"checkout:started\": \"InitiateCheckout\",\n \"checkout:payment_added\": \"AddPaymentInfo\",\n \"order:completed\": \"Purchase\",\n \"search:performed\": \"Search\",\n \"user:signed_up\": \"CompleteRegistration\",\n \"user:subscribed\": \"Subscribe\",\n \"lead:created\": \"Lead\",\n \"content:viewed\": \"ViewContent\",\n \"wishlist:added\": \"AddToWishlist\",\n};\n\nfunction getMetaEventName(event: JctEvent, config: MetaConfig): string {\n const key = `${event.entity}:${event.action}`;\n return config.eventNameMap?.[key] ?? META_EVENT_MAP[key] ?? `Custom_${event.entity}_${event.action}`;\n}\n\n// ─── Meta Parameter Mapping ──────────────────────────────────────\n\nfunction mapToMetaParams(event: JctEvent): Record<string, unknown> {\n const props = event.properties;\n const params: Record<string, unknown> = {};\n\n // Standard Meta parameters\n if (props.total || props.revenue || props.price) {\n params.value = props.total ?? props.revenue ?? props.price;\n }\n if (props.currency) params.currency = props.currency;\n if (props.product_id || props.name) {\n params.content_ids = [props.product_id ?? props.name];\n params.content_name = props.name;\n params.content_type = \"product\";\n }\n if (props.category) params.content_category = props.category;\n if (props.search_term || props.query) params.search_string = props.search_term ?? props.query;\n if (props.order_id) params.order_id = props.order_id;\n if (props.quantity) params.num_items = props.quantity;\n\n return params;\n}\n\n// ─── CAPI Payload ────────────────────────────────────────────────\n\ninterface CAPIPayload {\n data: Array<{\n event_name: string;\n event_time: number;\n event_id: string;\n event_source_url?: string;\n user_data: {\n client_ip_address?: string;\n client_user_agent?: string;\n fbc?: string;\n fbp?: string;\n external_id?: string;\n em?: string; // hashed email\n ph?: string; // hashed phone\n };\n custom_data: Record<string, unknown>;\n action_source: \"website\" | \"email\" | \"app\" | \"phone_call\" | \"chat\" | \"physical_store\" | \"system_generated\" | \"other\";\n }>;\n test_event_code?: string;\n}\n\nfunction buildCAPIPayload(\n event: JctEvent,\n eventName: string,\n params: Record<string, unknown>,\n config: MetaConfig,\n): CAPIPayload {\n return {\n data: [\n {\n event_name: eventName,\n event_time: Math.floor(new Date(event.timestamp).getTime() / 1000),\n event_id: event.id, // shared with pixel for dedup\n event_source_url: event.context.page?.url,\n user_data: {\n client_user_agent: event.context.device?.userAgent,\n external_id: event.user.userId,\n // fbc/fbp cookies would be extracted from context\n },\n custom_data: params,\n action_source: \"website\",\n },\n ],\n ...(config.testEventCode ? { test_event_code: config.testEventCode } : {}),\n };\n}\n\n// ─── Pixel Loader ────────────────────────────────────────────────\n\nfunction loadPixel(pixelId: string): void {\n if (typeof window === \"undefined\") return;\n if (typeof (window as any).fbq === \"function\") return;\n\n // Standard Meta Pixel initialization\n const n: any = ((window as any).fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n });\n if (!(window as any)._fbq) (window as any)._fbq = n;\n n.push = n;\n n.loaded = true;\n n.version = \"2.0\";\n n.queue = [];\n\n const script = document.createElement(\"script\");\n script.async = true;\n script.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n document.head.appendChild(script);\n\n (window as any).fbq(\"init\", pixelId);\n}\n\n// ─── Destination Export ──────────────────────────────────────────\n\ninterface MetaPayload {\n eventName: string;\n params: Record<string, unknown>;\n eventId: string;\n event: JctEvent;\n}\n\nexport const meta: Destination<MetaConfig> = {\n name: \"meta\",\n description: \"Meta Pixel + Conversions API\",\n version: \"0.1.0\",\n consent: [\"marketing\"],\n runtime: \"both\",\n\n init(config: MetaConfig) {\n if (!config.pixelId) {\n throw new Error(\"[Junction:Meta] pixelId is required\");\n }\n\n if (typeof window !== \"undefined\" && config.loadScript !== false) {\n loadPixel(config.pixelId);\n }\n },\n\n transform(event: JctEvent): MetaPayload | null {\n if (event.entity === \"_system\") return null;\n\n const eventName = getMetaEventName(event, {} as MetaConfig);\n const params = mapToMetaParams(event);\n\n return {\n eventName,\n params,\n eventId: event.id,\n event,\n };\n },\n\n async send(payload: unknown, config: MetaConfig) {\n const { eventName, params, eventId, event } = payload as MetaPayload;\n\n // Client-side: Meta Pixel\n if (typeof window !== \"undefined\" && typeof (window as any).fbq === \"function\") {\n const isStandard = Object.values(META_EVENT_MAP).includes(eventName);\n if (isStandard) {\n (window as any).fbq(\"track\", eventName, params, { eventID: eventId });\n } else {\n (window as any).fbq(\"trackCustom\", eventName, params, { eventID: eventId });\n }\n }\n\n // Server-side: Conversions API\n if (config.accessToken) {\n const capiPayload = buildCAPIPayload(event, eventName, params, config);\n\n const response = await fetch(\n `https://graph.facebook.com/v19.0/${config.pixelId}/events?access_token=${config.accessToken}`,\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(capiPayload),\n },\n );\n\n if (!response.ok) {\n const body = await response.text();\n throw new Error(`Meta CAPI error (${response.status}): ${body}`);\n }\n }\n },\n\n onConsent(state: ConsentState) {\n // Meta doesn't have a formal consent mode like Google,\n // but we can revoke pixel if marketing consent is denied\n if (typeof window !== \"undefined\" && typeof (window as any).fbq === \"function\") {\n if (state.marketing === false) {\n (window as any).fbq(\"consent\", \"revoke\");\n } else if (state.marketing === true) {\n (window as any).fbq(\"consent\", \"grant\");\n }\n }\n },\n};\n\nexport default meta;\n"],"mappings":";AAuCA,IAAM,iBAAyC;AAAA,EAC7C,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,i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,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@junctionjs/destination-meta",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Meta Pixel + Conversions API destination for Junction",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": ["dist", "README.md"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup src/index.ts --format esm --dts --sourcemap --target es2022 --no-config --external @junctionjs/core",
|
|
17
|
+
"dev": "tsup src/index.ts --format esm --dts --watch --no-config --external @junctionjs/core",
|
|
18
|
+
"clean": "rm -rf dist",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@junctionjs/core": "*"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@junctionjs/core": "*",
|
|
26
|
+
"tsup": "^8.0.0",
|
|
27
|
+
"typescript": "^5.5.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/tyssejc/junction.git",
|
|
36
|
+
"directory": "packages/destination-meta"
|
|
37
|
+
},
|
|
38
|
+
"keywords": ["analytics", "meta", "facebook-pixel", "conversions-api", "junction-destination"]
|
|
39
|
+
}
|