@c15t/nextjs 2.0.0-rc.0 → 2.0.0-rc.10
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 +10 -3
- package/client/components/consent-dialog-link.js +3 -0
- package/dist/headless.cjs +1 -1
- package/dist/iab/styles.css +12 -0
- package/dist/iab/styles.tw3.css +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/browser-initial-data.cjs +1 -0
- package/dist/libs/browser-initial-data.js +1 -0
- package/dist/libs/initial-data.cjs +1 -1
- package/dist/libs/initial-data.js +1 -1
- package/dist/styles.css +10 -0
- package/dist/styles.tw3.css +13 -0
- package/dist/types.cjs +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/{dist → dist-types}/headless.d.ts +0 -1
- package/{dist → dist-types}/index.d.ts +3 -2
- package/dist-types/libs/browser-initial-data.d.ts +9 -0
- package/{dist → dist-types}/libs/initial-data.d.ts +7 -2
- package/dist-types/types.d.ts +38 -0
- package/dist-types/version.d.ts +1 -0
- package/docs/README.md +73 -0
- package/docs/building-headless-components.md +377 -0
- package/docs/callbacks.md +184 -0
- package/docs/components/consent-banner.md +269 -0
- package/docs/components/consent-dialog-link.md +59 -0
- package/docs/components/consent-dialog-trigger.md +103 -0
- package/docs/components/consent-dialog.md +177 -0
- package/docs/components/consent-manager-provider.md +425 -0
- package/docs/components/consent-widget.md +133 -0
- package/docs/components/dev-tools.md +63 -0
- package/docs/components/frame.md +73 -0
- package/docs/concepts/client-modes.md +175 -0
- package/docs/concepts/consent-categories.md +97 -0
- package/docs/concepts/consent-models.md +116 -0
- package/docs/concepts/cookie-management.md +122 -0
- package/docs/concepts/glossary.md +23 -0
- package/docs/concepts/initialization-flow.md +148 -0
- package/docs/concepts/policy-packs.md +229 -0
- package/docs/headless.md +190 -0
- package/docs/hooks/use-color-scheme.md +40 -0
- package/docs/hooks/use-consent-manager/checking-consent.md +94 -0
- package/docs/hooks/use-consent-manager/location-info.md +95 -0
- package/docs/hooks/use-consent-manager/overview.md +420 -0
- package/docs/hooks/use-consent-manager/setting-consent.md +92 -0
- package/docs/hooks/use-draggable.md +57 -0
- package/docs/hooks/use-focus-trap.md +41 -0
- package/docs/hooks/use-reduced-motion.md +35 -0
- package/docs/hooks/use-ssr-status.md +31 -0
- package/docs/hooks/use-text-direction.md +49 -0
- package/docs/hooks/use-translations.md +118 -0
- package/docs/iab/consent-banner.md +94 -0
- package/docs/iab/consent-dialog.md +134 -0
- package/docs/iab/overview.md +126 -0
- package/docs/iab/use-gvl-data.md +20 -0
- package/docs/iframe-blocking.md +107 -0
- package/docs/integrations/building-integrations.md +405 -0
- package/docs/integrations/databuddy.md +203 -0
- package/docs/integrations/google-tag-manager.md +153 -0
- package/docs/integrations/google-tag.md +122 -0
- package/docs/integrations/linkedin-insights.md +109 -0
- package/docs/integrations/meta-pixel.md +342 -0
- package/docs/integrations/microsoft-uet.md +112 -0
- package/docs/integrations/overview.md +105 -0
- package/docs/integrations/posthog.md +199 -0
- package/docs/integrations/tiktok-pixel.md +113 -0
- package/docs/integrations/x-pixel.md +143 -0
- package/docs/internationalization.md +197 -0
- package/docs/network-blocker.md +178 -0
- package/docs/optimization.md +234 -0
- package/docs/policy-packs.md +246 -0
- package/docs/quickstart.md +161 -0
- package/docs/script-loader.md +321 -0
- package/docs/server-side.md +176 -0
- package/docs/styling/classnames.md +92 -0
- package/docs/styling/color-scheme.md +82 -0
- package/docs/styling/css-variables.md +92 -0
- package/docs/styling/overview.md +456 -0
- package/docs/styling/slots.md +127 -0
- package/docs/styling/tailwind.md +113 -0
- package/docs/styling/tokens.md +216 -0
- package/docs/troubleshooting.md +146 -0
- package/iab/styles.css +1 -0
- package/package.json +38 -17
- package/readme.json +4 -0
- package/src/iab/styles.css +12 -0
- package/src/iab/styles.tw3.css +14 -0
- package/src/styles.css +10 -0
- package/src/styles.tw3.css +13 -0
- package/styles.css +1 -0
- package/dist/headless.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/libs/initial-data.d.ts.map +0 -1
- package/dist/types.d.ts +0 -16
- package/dist/types.d.ts.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Meta Pixel
|
|
3
|
+
description: Track conversions and build audiences for Facebook and Instagram advertising campaigns.
|
|
4
|
+
lastModified: 2025-09-24
|
|
5
|
+
|
|
6
|
+
icon: meta
|
|
7
|
+
---
|
|
8
|
+
Meta Pixel (formerly Facebook Pixel) is Meta's conversion tracking and audience targeting tool for Facebook and Instagram advertising. It tracks user actions, measures ad effectiveness, builds custom audiences, and optimizes ad delivery. By default, c15t loads this script based on `marketing` consent.
|
|
9
|
+
|
|
10
|
+
This script persists after consent is revoked because it has built-in consent management. When consent changes, c15t updates Meta's internal consent state rather than removing the script entirely.
|
|
11
|
+
|
|
12
|
+
## Adding the Meta Pixel to c15t
|
|
13
|
+
|
|
14
|
+
> ℹ️ **Info:**
|
|
15
|
+
> See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { metaPixel } from '@c15t/scripts/meta-pixel';
|
|
19
|
+
|
|
20
|
+
metaPixel({
|
|
21
|
+
pixelId: '123456789012345',
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## metaPixelEvent
|
|
26
|
+
|
|
27
|
+
You can use the `metaPixelEvent` function to track events. This is a wrapper around the `fbq` function that the Meta Pixel script uses.
|
|
28
|
+
|
|
29
|
+
To learn more about Meta Pixel's standard events, see the [Meta Pixel documentation](https://developers.facebook.com/docs/meta-pixel/reference).
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { metaPixelEvent } from '@c15t/scripts/meta-pixel';
|
|
33
|
+
|
|
34
|
+
metaPixelEvent('Purchase', { value: 10.0, currency: 'USD' });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Types
|
|
38
|
+
|
|
39
|
+
### MetaPixelOptions
|
|
40
|
+
|
|
41
|
+
|Property|Type|Description|Default|Required|
|
|
42
|
+
|:--|:--|:--|:--|:--:|
|
|
43
|
+
|pixelId|string|Your Meta Pixel ID|-|✅ Required|
|
|
44
|
+
|scriptSrc|string \|undefined|Meta Pixel loader URL.|-|Optional|
|
|
45
|
+
|
|
46
|
+
### Script
|
|
47
|
+
|
|
48
|
+
|Property|Type|Description|Default|Required|
|
|
49
|
+
|:--|:--|:--|:--|:--:|
|
|
50
|
+
|id|string|Unique identifier for the script|-|✅ Required|
|
|
51
|
+
|src|string \|undefined|URL of the script to load|-|Optional|
|
|
52
|
+
|textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
|
|
53
|
+
|category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
|
|
54
|
+
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
55
|
+
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
56
|
+
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
57
|
+
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
58
|
+
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
59
|
+
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
60
|
+
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
61
|
+
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
62
|
+
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
63
|
+
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
64
|
+
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
65
|
+
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
66
|
+
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
67
|
+
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
68
|
+
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
69
|
+
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
70
|
+
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
71
|
+
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
72
|
+
|
|
73
|
+
#### `onBeforeLoad`
|
|
74
|
+
|
|
75
|
+
Callback executed before the script is loaded
|
|
76
|
+
|
|
77
|
+
|Property|Type|Description|Default|Required|
|
|
78
|
+
|:--|:--|:--|:--|:--:|
|
|
79
|
+
|id|string|The original script ID|-|✅ Required|
|
|
80
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
81
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
82
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
83
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
84
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
85
|
+
|
|
86
|
+
#### `onLoad`
|
|
87
|
+
|
|
88
|
+
Callback executed when the script loads successfully
|
|
89
|
+
|
|
90
|
+
|Property|Type|Description|Default|Required|
|
|
91
|
+
|:--|:--|:--|:--|:--:|
|
|
92
|
+
|id|string|The original script ID|-|✅ Required|
|
|
93
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
94
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
95
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
96
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
97
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
98
|
+
|
|
99
|
+
#### `onError`
|
|
100
|
+
|
|
101
|
+
Callback executed if the script fails to load
|
|
102
|
+
|
|
103
|
+
|Property|Type|Description|Default|Required|
|
|
104
|
+
|:--|:--|:--|:--|:--:|
|
|
105
|
+
|id|string|The original script ID|-|✅ Required|
|
|
106
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
107
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
108
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
109
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
110
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
111
|
+
|
|
112
|
+
#### `onConsentChange`
|
|
113
|
+
|
|
114
|
+
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
115
|
+
|
|
116
|
+
|Property|Type|Description|Default|Required|
|
|
117
|
+
|:--|:--|:--|:--|:--:|
|
|
118
|
+
|id|string|The original script ID|-|✅ Required|
|
|
119
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
120
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
121
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
122
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
123
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
124
|
+
|
|
125
|
+
### StandardEventParams
|
|
126
|
+
|
|
127
|
+
|Property|Type|Description|Default|Required|
|
|
128
|
+
|:--|:--|:--|:--|:--:|
|
|
129
|
+
|AddPaymentInfo|AddPaymentInfoParams|-|-|✅ Required|
|
|
130
|
+
|AddToCart|AddToCartParams|-|-|✅ Required|
|
|
131
|
+
|AddToWishlist|AddToWishlistParams|-|-|✅ Required|
|
|
132
|
+
|CompleteRegistration|CompleteRegistrationParams|-|-|✅ Required|
|
|
133
|
+
|Contact|FbqBaseEventParams|-|-|✅ Required|
|
|
134
|
+
|CustomizeProduct|FbqBaseEventParams|-|-|✅ Required|
|
|
135
|
+
|Donate|FbqBaseEventParams|-|-|✅ Required|
|
|
136
|
+
|FindLocation|FbqBaseEventParams|-|-|✅ Required|
|
|
137
|
+
|InitiateCheckout|InitiateCheckoutParams|-|-|✅ Required|
|
|
138
|
+
|Lead|LeadParams|-|-|✅ Required|
|
|
139
|
+
|Purchase|PurchaseParams|-|-|✅ Required|
|
|
140
|
+
|Schedule|FbqBaseEventParams|-|-|✅ Required|
|
|
141
|
+
|Search|SearchParams|-|-|✅ Required|
|
|
142
|
+
|StartTrial|StartTrialParams|-|-|✅ Required|
|
|
143
|
+
|SubmitApplication|FbqBaseEventParams|-|-|✅ Required|
|
|
144
|
+
|Subscribe|SubscribeParams|-|-|✅ Required|
|
|
145
|
+
|ViewContent|ViewContentParams|-|-|✅ Required|
|
|
146
|
+
|
|
147
|
+
#### `AddPaymentInfo` AddPaymentInfoParams
|
|
148
|
+
|
|
149
|
+
|Property|Type|Description|Default|Required|
|
|
150
|
+
|:--|:--|:--|:--|:--:|
|
|
151
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
152
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
153
|
+
|currency|string \|undefined|-|-|Optional|
|
|
154
|
+
|value|number \|undefined|-|-|Optional|
|
|
155
|
+
|
|
156
|
+
#### `AddToCart` AddToCartParams
|
|
157
|
+
|
|
158
|
+
|Property|Type|Description|Default|Required|
|
|
159
|
+
|:--|:--|:--|:--|:--:|
|
|
160
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
161
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
162
|
+
|currency|string \|undefined|-|-|Optional|
|
|
163
|
+
|value|number \|undefined|-|-|Optional|
|
|
164
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
165
|
+
|
|
166
|
+
#### `AddToWishlist` AddToWishlistParams
|
|
167
|
+
|
|
168
|
+
|Property|Type|Description|Default|Required|
|
|
169
|
+
|:--|:--|:--|:--|:--:|
|
|
170
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
171
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
172
|
+
|currency|string \|undefined|-|-|Optional|
|
|
173
|
+
|value|number \|undefined|-|-|Optional|
|
|
174
|
+
|
|
175
|
+
#### `CompleteRegistration` CompleteRegistrationParams
|
|
176
|
+
|
|
177
|
+
|Property|Type|Description|Default|Required|
|
|
178
|
+
|:--|:--|:--|:--|:--:|
|
|
179
|
+
|currency|string \|undefined|-|-|Optional|
|
|
180
|
+
|value|number \|undefined|-|-|Optional|
|
|
181
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
182
|
+
|
|
183
|
+
#### `Contact` FbqBaseEventParams
|
|
184
|
+
|
|
185
|
+
|Property|Type|Description|Default|Required|
|
|
186
|
+
|:--|:--|:--|:--|:--:|
|
|
187
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
188
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
189
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
190
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
191
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
192
|
+
|currency|string \|undefined|-|-|Optional|
|
|
193
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
194
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
195
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
196
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
197
|
+
|value|number \|undefined|-|-|Optional|
|
|
198
|
+
|
|
199
|
+
#### `CustomizeProduct` FbqBaseEventParams
|
|
200
|
+
|
|
201
|
+
|Property|Type|Description|Default|Required|
|
|
202
|
+
|:--|:--|:--|:--|:--:|
|
|
203
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
204
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
205
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
206
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
207
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
208
|
+
|currency|string \|undefined|-|-|Optional|
|
|
209
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
210
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
211
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
212
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
213
|
+
|value|number \|undefined|-|-|Optional|
|
|
214
|
+
|
|
215
|
+
#### `Donate` FbqBaseEventParams
|
|
216
|
+
|
|
217
|
+
|Property|Type|Description|Default|Required|
|
|
218
|
+
|:--|:--|:--|:--|:--:|
|
|
219
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
220
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
221
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
222
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
223
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
224
|
+
|currency|string \|undefined|-|-|Optional|
|
|
225
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
226
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
227
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
228
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
229
|
+
|value|number \|undefined|-|-|Optional|
|
|
230
|
+
|
|
231
|
+
#### `FindLocation` FbqBaseEventParams
|
|
232
|
+
|
|
233
|
+
|Property|Type|Description|Default|Required|
|
|
234
|
+
|:--|:--|:--|:--|:--:|
|
|
235
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
236
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
237
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
238
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
239
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
240
|
+
|currency|string \|undefined|-|-|Optional|
|
|
241
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
242
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
243
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
244
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
245
|
+
|value|number \|undefined|-|-|Optional|
|
|
246
|
+
|
|
247
|
+
#### `InitiateCheckout` InitiateCheckoutParams
|
|
248
|
+
|
|
249
|
+
|Property|Type|Description|Default|Required|
|
|
250
|
+
|:--|:--|:--|:--|:--:|
|
|
251
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
252
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
253
|
+
|currency|string \|undefined|-|-|Optional|
|
|
254
|
+
|value|number \|undefined|-|-|Optional|
|
|
255
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
256
|
+
|
|
257
|
+
#### `Lead` LeadParams
|
|
258
|
+
|
|
259
|
+
|Property|Type|Description|Default|Required|
|
|
260
|
+
|:--|:--|:--|:--|:--:|
|
|
261
|
+
|currency|string \|undefined|-|-|Optional|
|
|
262
|
+
|value|number \|undefined|-|-|Optional|
|
|
263
|
+
|
|
264
|
+
#### `Purchase` PurchaseParams
|
|
265
|
+
|
|
266
|
+
|Property|Type|Description|Default|Required|
|
|
267
|
+
|:--|:--|:--|:--|:--:|
|
|
268
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
269
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
270
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
271
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
272
|
+
|currency|string|-|-|Optional|
|
|
273
|
+
|value|number|-|-|Optional|
|
|
274
|
+
|
|
275
|
+
#### `Schedule` FbqBaseEventParams
|
|
276
|
+
|
|
277
|
+
|Property|Type|Description|Default|Required|
|
|
278
|
+
|:--|:--|:--|:--|:--:|
|
|
279
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
280
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
281
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
282
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
283
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
284
|
+
|currency|string \|undefined|-|-|Optional|
|
|
285
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
286
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
287
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
288
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
289
|
+
|value|number \|undefined|-|-|Optional|
|
|
290
|
+
|
|
291
|
+
#### `Search` SearchParams
|
|
292
|
+
|
|
293
|
+
|Property|Type|Description|Default|Required|
|
|
294
|
+
|:--|:--|:--|:--|:--:|
|
|
295
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
296
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
297
|
+
|currency|string \|undefined|-|-|Optional|
|
|
298
|
+
|value|number \|undefined|-|-|Optional|
|
|
299
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
300
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
301
|
+
|
|
302
|
+
#### `StartTrial` StartTrialParams
|
|
303
|
+
|
|
304
|
+
|Property|Type|Description|Default|Required|
|
|
305
|
+
|:--|:--|:--|:--|:--:|
|
|
306
|
+
|currency|string \|undefined|-|-|Optional|
|
|
307
|
+
|value|number \|undefined|-|-|Optional|
|
|
308
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
309
|
+
|
|
310
|
+
#### `SubmitApplication` FbqBaseEventParams
|
|
311
|
+
|
|
312
|
+
|Property|Type|Description|Default|Required|
|
|
313
|
+
|:--|:--|:--|:--|:--:|
|
|
314
|
+
|content\_category|string \|undefined|-|-|Optional|
|
|
315
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
316
|
+
|content\_name|string \|undefined|-|-|Optional|
|
|
317
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
318
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
319
|
+
|currency|string \|undefined|-|-|Optional|
|
|
320
|
+
|num\_items|number \|undefined|-|-|Optional|
|
|
321
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
322
|
+
|search\_string|string \|undefined|-|-|Optional|
|
|
323
|
+
|status|boolean \|undefined|-|-|Optional|
|
|
324
|
+
|value|number \|undefined|-|-|Optional|
|
|
325
|
+
|
|
326
|
+
#### `Subscribe` SubscribeParams
|
|
327
|
+
|
|
328
|
+
|Property|Type|Description|Default|Required|
|
|
329
|
+
|:--|:--|:--|:--|:--:|
|
|
330
|
+
|currency|string \|undefined|-|-|Optional|
|
|
331
|
+
|value|number \|undefined|-|-|Optional|
|
|
332
|
+
|predicted\_ltv|number \|undefined|-|-|Optional|
|
|
333
|
+
|
|
334
|
+
#### `ViewContent` ViewContentParams
|
|
335
|
+
|
|
336
|
+
|Property|Type|Description|Default|Required|
|
|
337
|
+
|:--|:--|:--|:--|:--:|
|
|
338
|
+
|content\_ids|(string \|number)\[] \|undefined|-|-|Optional|
|
|
339
|
+
|contents|FbqContent \|undefined|-|-|Optional|
|
|
340
|
+
|currency|string \|undefined|-|-|Optional|
|
|
341
|
+
|value|number \|undefined|-|-|Optional|
|
|
342
|
+
|content\_type|"product" \|"product\_group" \|undefined|-|-|Optional|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Microsoft UET
|
|
3
|
+
description: Track conversions and measure performance for Microsoft Advertising and Bing Ads.
|
|
4
|
+
lastModified: 2025-09-24
|
|
5
|
+
|
|
6
|
+
icon: microsoft
|
|
7
|
+
---
|
|
8
|
+
Microsoft UET (Universal Event Tracking) is Microsoft's conversion tracking tag for Microsoft Advertising. It tracks user actions, measures campaign effectiveness, and enables remarketing campaigns. By default, c15t loads this script based on `marketing` consent.
|
|
9
|
+
|
|
10
|
+
> ℹ️ **Info:**
|
|
11
|
+
> UET can also load Microsoft Clarity (if enabled in your UET tag settings). Since Clarity is an analytics tool, we recommend loading it separately with measurement consent instead.
|
|
12
|
+
|
|
13
|
+
## Adding Microsoft UET to c15t
|
|
14
|
+
|
|
15
|
+
> ℹ️ **Info:**
|
|
16
|
+
> See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { microsoftUet } from '@c15t/scripts/microsoft-uet';
|
|
20
|
+
|
|
21
|
+
microsoftUet({
|
|
22
|
+
id: '123456789012345',
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Types
|
|
27
|
+
|
|
28
|
+
### MicrosoftUetOptions
|
|
29
|
+
|
|
30
|
+
|Property|Type|Description|Default|Required|
|
|
31
|
+
|:--|:--|:--|:--|:--:|
|
|
32
|
+
|id|string|Your Microsoft UET ID|-|✅ Required|
|
|
33
|
+
|scriptSrc|string \|undefined|Microsoft UET loader URL.|-|Optional|
|
|
34
|
+
|
|
35
|
+
### Script
|
|
36
|
+
|
|
37
|
+
|Property|Type|Description|Default|Required|
|
|
38
|
+
|:--|:--|:--|:--|:--:|
|
|
39
|
+
|id|string|Unique identifier for the script|-|✅ Required|
|
|
40
|
+
|src|string \|undefined|URL of the script to load|-|Optional|
|
|
41
|
+
|textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
|
|
42
|
+
|category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
|
|
43
|
+
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
44
|
+
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
45
|
+
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
46
|
+
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
47
|
+
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
48
|
+
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
49
|
+
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
50
|
+
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
51
|
+
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
52
|
+
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
53
|
+
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
54
|
+
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
55
|
+
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
56
|
+
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
57
|
+
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
58
|
+
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
59
|
+
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
60
|
+
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
61
|
+
|
|
62
|
+
#### `onBeforeLoad`
|
|
63
|
+
|
|
64
|
+
Callback executed before the script is loaded
|
|
65
|
+
|
|
66
|
+
|Property|Type|Description|Default|Required|
|
|
67
|
+
|:--|:--|:--|:--|:--:|
|
|
68
|
+
|id|string|The original script ID|-|✅ Required|
|
|
69
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
70
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
71
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
72
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
73
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
74
|
+
|
|
75
|
+
#### `onLoad`
|
|
76
|
+
|
|
77
|
+
Callback executed when the script loads successfully
|
|
78
|
+
|
|
79
|
+
|Property|Type|Description|Default|Required|
|
|
80
|
+
|:--|:--|:--|:--|:--:|
|
|
81
|
+
|id|string|The original script ID|-|✅ Required|
|
|
82
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
83
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
84
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
85
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
86
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
87
|
+
|
|
88
|
+
#### `onError`
|
|
89
|
+
|
|
90
|
+
Callback executed if the script fails to load
|
|
91
|
+
|
|
92
|
+
|Property|Type|Description|Default|Required|
|
|
93
|
+
|:--|:--|:--|:--|:--:|
|
|
94
|
+
|id|string|The original script ID|-|✅ Required|
|
|
95
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
96
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
97
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
98
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
99
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
100
|
+
|
|
101
|
+
#### `onConsentChange`
|
|
102
|
+
|
|
103
|
+
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
104
|
+
|
|
105
|
+
|Property|Type|Description|Default|Required|
|
|
106
|
+
|:--|:--|:--|:--|:--:|
|
|
107
|
+
|id|string|The original script ID|-|✅ Required|
|
|
108
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
109
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
110
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
111
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
112
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Integrations
|
|
3
|
+
description: "Many of your tools may require consent to be given before they can be used. This is especially true for analytics and marketing tools. \nc15t has various ways to integrate with your tools, depending on the tool you are using."
|
|
4
|
+
lastModified: 2026-04-10
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
c15t supports two integration styles:
|
|
8
|
+
|
|
9
|
+
* use a prebuilt helper from `@c15t/scripts`
|
|
10
|
+
* build your own script or manifest-backed helper
|
|
11
|
+
|
|
12
|
+
If you are building something reusable or contributing to `@c15t/scripts`, start with the [custom integration guide](/docs/integrations/building-integrations).
|
|
13
|
+
|
|
14
|
+
## General Pattern
|
|
15
|
+
|
|
16
|
+
Every integration provides a script configuration function. Pass it to your framework's setup:
|
|
17
|
+
|
|
18
|
+
**JavaScript**
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { getOrCreateConsentRuntime } from 'c15t';
|
|
22
|
+
import { yourScript } from '@c15t/scripts/your-script';
|
|
23
|
+
|
|
24
|
+
getOrCreateConsentRuntime({
|
|
25
|
+
mode: 'hosted',
|
|
26
|
+
scripts: [
|
|
27
|
+
yourScript({ /* options */ }),
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**React**
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { yourScript } from '@c15t/scripts/your-script';
|
|
36
|
+
import { ConsentManagerProvider } from '@c15t/react';
|
|
37
|
+
|
|
38
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
39
|
+
return (
|
|
40
|
+
<ConsentManagerProvider
|
|
41
|
+
options={{
|
|
42
|
+
scripts: [
|
|
43
|
+
yourScript({ /* options */ }),
|
|
44
|
+
],
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</ConsentManagerProvider>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Next.js**
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { yourScript } from '@c15t/scripts/your-script';
|
|
57
|
+
import { ConsentManagerProvider } from '@c15t/nextjs';
|
|
58
|
+
|
|
59
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
60
|
+
return (
|
|
61
|
+
<ConsentManagerProvider
|
|
62
|
+
options={{
|
|
63
|
+
scripts: [
|
|
64
|
+
yourScript({ /* options */ }),
|
|
65
|
+
],
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</ConsentManagerProvider>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Script Loader
|
|
75
|
+
|
|
76
|
+
Many marketing and analytics tools are commonly loaded using a script tag, such as Google Tag Manager (GTM), Google Tag (gtag.js), Meta Pixel and TikTok Pixel.
|
|
77
|
+
|
|
78
|
+
c15t's script loader allows you to easily integrate your tools that require consent with c15t. The prebuilt integrations in `@c15t/scripts` are the recommended starting point, and the custom integration guide explains how to build your own when you need something more specialized.
|
|
79
|
+
|
|
80
|
+
* [JavaScript](/docs/frameworks/javascript/script-loader)
|
|
81
|
+
* [React](/docs/frameworks/react/script-loader)
|
|
82
|
+
* [Next.js](/docs/frameworks/next/script-loader)
|
|
83
|
+
|
|
84
|
+
## Building Your Own
|
|
85
|
+
|
|
86
|
+
If you need a vendor we do not ship yet:
|
|
87
|
+
|
|
88
|
+
* build a one-off `Script` directly in your app for simple cases
|
|
89
|
+
* build a reusable manifest-backed helper for shared or package-level integrations
|
|
90
|
+
|
|
91
|
+
Read the [custom integration guide](/docs/integrations/building-integrations) for the manifest phases, structured step model, testing checklist, and devtools debugging flow.
|
|
92
|
+
|
|
93
|
+
## has() method
|
|
94
|
+
|
|
95
|
+
The `has()` method allows you to check if the user has given consent for a specific purpose. You can learn more about the `has()` method [here](/docs/frameworks/javascript/store/checking-consent).
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
const hasAnalytics = has('measurement');
|
|
101
|
+
|
|
102
|
+
if (hasAnalytics) {
|
|
103
|
+
myAnalyticsLibrary.track('checkout_completed');
|
|
104
|
+
}
|
|
105
|
+
```
|