@c15t/nextjs 2.1.0 → 2.2.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/AGENTS.md +155 -0
- package/README.md +31 -15
- package/client/components/integrations.js +3 -0
- package/dist/components/integrations/index.cjs +1 -0
- package/dist/components/integrations/index.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/libs/browser-initial-data.cjs +1 -1
- package/dist/libs/initial-data.cjs +1 -1
- package/dist/styles.tw3.css +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist-types/components/integrations/index.d.ts +1 -0
- package/dist-types/libs/browser-initial-data.d.ts +1 -1
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +155 -73
- package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
- package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
- package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
- package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
- package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
- package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
- package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
- package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
- package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
- package/docs/{components → frameworks/next/components}/frame.md +8 -9
- package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
- package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
- package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
- package/docs/{headless.md → frameworks/next/headless.md} +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
- package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
- package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
- package/docs/frameworks/next/hooks/use-translations.md +55 -0
- package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
- package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
- package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
- package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
- package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
- package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
- package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
- package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
- package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
- package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
- package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
- package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
- package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
- package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
- package/docs/frameworks/next/styling/css-variables.md +53 -0
- package/docs/frameworks/next/styling/overview.md +299 -0
- package/docs/frameworks/next/styling/slots.md +94 -0
- package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
- package/docs/frameworks/next/styling/tokens.md +156 -0
- package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +15 -82
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +15 -181
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +15 -83
- package/docs/integrations/crisp.md +13 -87
- package/docs/integrations/databuddy.md +16 -85
- package/docs/integrations/fathom-analytics.md +15 -86
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +18 -86
- package/docs/integrations/google-tag.md +15 -84
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +15 -83
- package/docs/integrations/intercom.md +13 -83
- package/docs/integrations/linkedin-insights.md +15 -82
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +13 -88
- package/docs/integrations/meta-pixel.md +33 -316
- package/docs/integrations/microsoft-clarity.md +15 -83
- package/docs/integrations/microsoft-uet.md +16 -83
- package/docs/integrations/mixpanel-analytics.md +15 -83
- package/docs/integrations/overview.md +55 -6
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +14 -97
- package/docs/integrations/posthog.md +26 -98
- package/docs/integrations/promptwatch.md +16 -82
- package/docs/integrations/reddit-pixel.md +27 -122
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +15 -94
- package/docs/integrations/segment.md +15 -82
- package/docs/integrations/snapchat-pixel.md +21 -102
- package/docs/integrations/tiktok-pixel.md +13 -81
- package/docs/integrations/umami-analytics.md +16 -88
- package/docs/integrations/vercel-analytics.md +13 -85
- package/docs/integrations/x-pixel.md +27 -102
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/concepts/client-modes.md +103 -0
- package/docs/shared/concepts/consent-categories.md +41 -0
- package/docs/shared/concepts/consent-models.md +72 -0
- package/docs/shared/concepts/cookie-management.md +88 -0
- package/docs/shared/concepts/glossary.md +24 -0
- package/docs/shared/concepts/initialization-flow.md +105 -0
- package/docs/shared/concepts/policy-packs.md +225 -0
- package/docs/shared/react/components/consent-banner.md +242 -0
- package/docs/shared/react/components/consent-dialog-link.md +45 -0
- package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
- package/docs/shared/react/components/consent-dialog.md +119 -0
- package/docs/shared/react/components/consent-manager-provider.md +225 -0
- package/docs/shared/react/components/consent-widget.md +121 -0
- package/docs/shared/react/components/dev-tools.md +81 -0
- package/docs/shared/react/components/frame.md +52 -0
- package/docs/shared/react/guides/building-headless-components.md +110 -0
- package/docs/shared/react/guides/callbacks.md +89 -0
- package/docs/shared/react/guides/headless.md +31 -0
- package/docs/shared/react/guides/iframe-blocking.md +65 -0
- package/docs/shared/react/guides/internationalization.md +123 -0
- package/docs/shared/react/guides/network-blocker.md +72 -0
- package/docs/shared/react/guides/optimization.md +44 -0
- package/docs/shared/react/guides/policy-packs.md +173 -0
- package/docs/shared/react/guides/script-loader.md +311 -0
- package/docs/shared/react/hooks/use-color-scheme.md +31 -0
- package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
- package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
- package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
- package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
- package/docs/shared/react/hooks/use-draggable.md +30 -0
- package/docs/shared/react/hooks/use-focus-trap.md +20 -0
- package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
- package/docs/shared/react/hooks/use-ssr-status.md +16 -0
- package/docs/shared/react/hooks/use-text-direction.md +38 -0
- package/docs/shared/react/hooks/use-translations.md +15 -0
- package/docs/shared/react/iab/consent-banner.md +60 -0
- package/docs/shared/react/iab/consent-dialog.md +76 -0
- package/docs/shared/react/iab/overview.md +80 -0
- package/docs/shared/react/iab/use-gvl-data.md +21 -0
- package/docs/shared/react/styling/classnames.md +93 -0
- package/docs/shared/react/styling/color-scheme.md +35 -0
- package/docs/shared/react/styling/css-variables.md +53 -0
- package/docs/shared/react/styling/overview.md +261 -0
- package/docs/shared/react/styling/slots.md +93 -0
- package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
- package/docs/shared/react/styling/tailwind.md +88 -0
- package/docs/shared/react/styling/tokens.md +155 -0
- package/docs/shared/troubleshooting.md +82 -0
- package/package.json +19 -10
- package/readme.json +14 -8
- package/docs/ai-agents.md +0 -111
- package/docs/components/consent-dialog-trigger.md +0 -103
- package/docs/components/consent-manager-provider.md +0 -425
- package/docs/hooks/use-consent-manager/overview.md +0 -420
- package/docs/hooks/use-translations.md +0 -118
- package/docs/styling/css-variables.md +0 -92
- package/docs/styling/overview.md +0 -457
- package/docs/styling/slots.md +0 -128
- package/docs/styling/tokens.md +0 -216
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Databuddy
|
|
3
|
-
description: Databuddy is a privacy-focused analytics platform that helps you
|
|
4
|
-
|
|
3
|
+
description: Databuddy is a privacy-focused analytics platform that helps you
|
|
4
|
+
understand user behavior and track events. It supports cookieless tracking and
|
|
5
|
+
manages consent automatically through c15t's consent state synchronization.
|
|
5
6
|
icon: databuddy
|
|
7
|
+
group: integrations
|
|
6
8
|
---
|
|
7
9
|
The Databuddy script automatically respects consent preferences by toggling tracking on and off based on the user's consent state.
|
|
8
10
|
|
|
@@ -186,89 +188,18 @@ This ensures that no tracking occurs without user consent, keeping your analytic
|
|
|
186
188
|
|
|
187
189
|
### DatabuddyConsentOptions
|
|
188
190
|
|
|
189
|
-
|Property|
|
|
190
|
-
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|configWhenDenied|Record\<string, unknown>|Databuddy config object to seed when consent is denied at load time.|-|✅ Required|
|
|
191
|
+
|Property|Value|
|
|
192
|
+
|:--|:--|
|
|
193
|
+
|Type Name|\`DatabuddyConsentOptions\`|
|
|
194
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/databuddy.ts\`|
|
|
195
|
+
|
|
196
|
+
\*ExtractedTypeTable: Could not extract "DatabuddyConsentOptions" from "./packages/scripts/src/vendors/analytics/databuddy.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
196
197
|
|
|
197
198
|
### Script
|
|
198
199
|
|
|
199
|
-
|Property|
|
|
200
|
-
|
|
201
|
-
|
|
|
202
|
-
|src
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|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|
|
|
206
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
207
|
-
|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|
|
|
208
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
209
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
210
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
211
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
212
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
213
|
-
|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|
|
|
214
|
-
|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|
|
|
215
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
216
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
217
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
218
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
219
|
-
|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|
|
|
220
|
-
|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|
|
|
221
|
-
|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|
|
|
222
|
-
|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|
|
|
223
|
-
|
|
224
|
-
#### `onBeforeLoad`
|
|
225
|
-
|
|
226
|
-
Callback executed before the script is loaded
|
|
227
|
-
|
|
228
|
-
|Property|Type|Description|Default|Required|
|
|
229
|
-
|:--|:--|:--|:--|:--:|
|
|
230
|
-
|id|string|The original script ID|-|✅ Required|
|
|
231
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
232
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
233
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
234
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
235
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
236
|
-
|
|
237
|
-
#### `onLoad`
|
|
238
|
-
|
|
239
|
-
Callback executed when the script loads successfully
|
|
240
|
-
|
|
241
|
-
|Property|Type|Description|Default|Required|
|
|
242
|
-
|:--|:--|:--|:--|:--:|
|
|
243
|
-
|id|string|The original script ID|-|✅ Required|
|
|
244
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
245
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
246
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
247
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
248
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
249
|
-
|
|
250
|
-
#### `onError`
|
|
251
|
-
|
|
252
|
-
Callback executed if the script fails to load
|
|
253
|
-
|
|
254
|
-
|Property|Type|Description|Default|Required|
|
|
255
|
-
|:--|:--|:--|:--|:--:|
|
|
256
|
-
|id|string|The original script ID|-|✅ Required|
|
|
257
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
258
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
259
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
260
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
261
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
262
|
-
|
|
263
|
-
#### `onConsentChange`
|
|
264
|
-
|
|
265
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
266
|
-
|
|
267
|
-
|Property|Type|Description|Default|Required|
|
|
268
|
-
|:--|:--|:--|:--|:--:|
|
|
269
|
-
|id|string|The original script ID|-|✅ Required|
|
|
270
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
271
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
272
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
273
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
274
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
200
|
+
|Property|Value|
|
|
201
|
+
|:--|:--|
|
|
202
|
+
|Type Name|\`Script\`|
|
|
203
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
204
|
+
|
|
205
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Fathom Analytics
|
|
3
|
-
description: Privacy-friendly cookieless analytics with a prebuilt helper that
|
|
4
|
-
|
|
3
|
+
description: Privacy-friendly cookieless analytics with a prebuilt helper that
|
|
4
|
+
maps Fathom's data attributes into a c15t-managed script.
|
|
5
|
+
group: integrations
|
|
5
6
|
icon: fathom-analytics
|
|
6
7
|
---
|
|
7
8
|
Fathom Analytics is a lightweight, cookieless analytics product configured entirely through `data-*` attributes on its loader. The `fathomAnalytics()` helper serializes your site ID and tracking options into those attributes and hands the result to c15t's script loader.
|
|
@@ -132,90 +133,18 @@ if (consentStore.getState().has('measurement')) {
|
|
|
132
133
|
|
|
133
134
|
### FathomAnalyticsOptions
|
|
134
135
|
|
|
135
|
-
|Property|
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|honorDnt|boolean \|undefined|Honor Do Not Track requests.|-|Optional|
|
|
142
|
-
|scriptUrl|string \|undefined|Custom loader URL.|'https\://cdn.usefathom.com/script.js'|Optional|
|
|
136
|
+
|Property|Value|
|
|
137
|
+
|:--|:--|
|
|
138
|
+
|Type Name|\`FathomAnalyticsOptions\`|
|
|
139
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/fathom-analytics.ts\`|
|
|
140
|
+
|
|
141
|
+
\*ExtractedTypeTable: Could not extract "FathomAnalyticsOptions" from "./packages/scripts/src/vendors/analytics/fathom-analytics.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
143
142
|
|
|
144
143
|
### Script
|
|
145
144
|
|
|
146
|
-
|Property|
|
|
147
|
-
|
|
148
|
-
|
|
|
149
|
-
|src
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|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|
|
|
153
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
154
|
-
|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|
|
|
155
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
156
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
157
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
158
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
159
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
160
|
-
|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|
|
|
161
|
-
|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|
|
|
162
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
163
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
164
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
165
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
166
|
-
|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|
|
|
167
|
-
|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|
|
|
168
|
-
|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|
|
|
169
|
-
|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|
|
|
170
|
-
|
|
171
|
-
#### `onBeforeLoad`
|
|
172
|
-
|
|
173
|
-
Callback executed before the script is loaded
|
|
174
|
-
|
|
175
|
-
|Property|Type|Description|Default|Required|
|
|
176
|
-
|:--|:--|:--|:--|:--:|
|
|
177
|
-
|id|string|The original script ID|-|✅ Required|
|
|
178
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
179
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
180
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
181
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
182
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
183
|
-
|
|
184
|
-
#### `onLoad`
|
|
185
|
-
|
|
186
|
-
Callback executed when the script loads successfully
|
|
187
|
-
|
|
188
|
-
|Property|Type|Description|Default|Required|
|
|
189
|
-
|:--|:--|:--|:--|:--:|
|
|
190
|
-
|id|string|The original script ID|-|✅ Required|
|
|
191
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
192
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
193
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
194
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
195
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
196
|
-
|
|
197
|
-
#### `onError`
|
|
198
|
-
|
|
199
|
-
Callback executed if the script fails to load
|
|
200
|
-
|
|
201
|
-
|Property|Type|Description|Default|Required|
|
|
202
|
-
|:--|:--|:--|:--|:--:|
|
|
203
|
-
|id|string|The original script ID|-|✅ Required|
|
|
204
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
205
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
206
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
207
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
208
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
209
|
-
|
|
210
|
-
#### `onConsentChange`
|
|
211
|
-
|
|
212
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
213
|
-
|
|
214
|
-
|Property|Type|Description|Default|Required|
|
|
215
|
-
|:--|:--|:--|:--|:--:|
|
|
216
|
-
|id|string|The original script ID|-|✅ Required|
|
|
217
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
218
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
219
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
220
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
221
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
145
|
+
|Property|Value|
|
|
146
|
+
|:--|:--|
|
|
147
|
+
|Type Name|\`Script\`|
|
|
148
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
149
|
+
|
|
150
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Google Maps
|
|
3
|
+
description: Render Google Maps only after consent with one shared Maps
|
|
4
|
+
JavaScript API loader and independently managed map instances.
|
|
5
|
+
icon: google-maps
|
|
6
|
+
group: integrations
|
|
7
|
+
---
|
|
8
|
+
`GoogleMap` is a renderable integration for React and Next.js. It keeps the
|
|
9
|
+
Google Maps JavaScript API off the page until the configured consent category is
|
|
10
|
+
allowed, then loads the SDK once and creates a map for each mounted component.
|
|
11
|
+
|
|
12
|
+
Unlike the helpers from `@c15t/scripts`, `GoogleMap` owns both the consent-aware
|
|
13
|
+
script lifecycle and the visible map container.
|
|
14
|
+
|
|
15
|
+
> ℹ️ **Info:**
|
|
16
|
+
> The browser must receive a Google Maps API key, so the key is visible to site visitors. Keep it out of source control, use a key created for browser use, and restrict it by website and API in Google Cloud.
|
|
17
|
+
|
|
18
|
+
## Integrate with c15t
|
|
19
|
+
|
|
20
|
+
`GoogleMap` must render inside a `ConsentManagerProvider`. Complete the
|
|
21
|
+
[React quickstart](/docs/frameworks/react/quickstart) or
|
|
22
|
+
[Next.js quickstart](/docs/frameworks/next/quickstart) first.
|
|
23
|
+
|
|
24
|
+
**React**
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { GoogleMap } from '@c15t/react';
|
|
28
|
+
|
|
29
|
+
const apiKey = import.meta.env.VITE_GOOGLE_MAPS_API_KEY;
|
|
30
|
+
|
|
31
|
+
export function StoreMap() {
|
|
32
|
+
if (!apiKey) {
|
|
33
|
+
return <p>Google Maps is not configured.</p>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<GoogleMap
|
|
38
|
+
apiKey={apiKey}
|
|
39
|
+
authReferrerPolicy="origin"
|
|
40
|
+
center={{ lat: 40.7128, lng: -74.006 }}
|
|
41
|
+
consentCategory="measurement"
|
|
42
|
+
style={{ height: 400 }}
|
|
43
|
+
zoom={12}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Next.js**
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
'use client';
|
|
53
|
+
|
|
54
|
+
import { GoogleMap } from '@c15t/nextjs';
|
|
55
|
+
|
|
56
|
+
const apiKey = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;
|
|
57
|
+
|
|
58
|
+
export function StoreMap() {
|
|
59
|
+
if (!apiKey) {
|
|
60
|
+
return <p>Google Maps is not configured.</p>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<GoogleMap
|
|
65
|
+
apiKey={apiKey}
|
|
66
|
+
authReferrerPolicy="origin"
|
|
67
|
+
center={{ lat: 40.7128, lng: -74.006 }}
|
|
68
|
+
consentCategory="measurement"
|
|
69
|
+
style={{ height: 400 }}
|
|
70
|
+
zoom={12}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`measurement` is a common choice for an interactive map, but the correct
|
|
77
|
+
category depends on why your application uses Google Maps and the policy shown
|
|
78
|
+
to your users.
|
|
79
|
+
|
|
80
|
+
## How c15t loads it
|
|
81
|
+
|
|
82
|
+
* **Before consent:** no Maps JavaScript API script is requested and no map
|
|
83
|
+
instance is created.
|
|
84
|
+
* **After consent:** c15t registers one shared SDK loader and waits for Google's
|
|
85
|
+
callback before constructing the map.
|
|
86
|
+
* **Multiple maps:** components with the same `scriptId` reuse the SDK while
|
|
87
|
+
keeping separate map instances.
|
|
88
|
+
* **On revocation or unmount:** the component clears the map instance and its
|
|
89
|
+
listeners. The page-level SDK registration is retained after its first load
|
|
90
|
+
because Google supports one loader per page.
|
|
91
|
+
* **Existing SDK:** if another part of the application already loaded a
|
|
92
|
+
compatible Google Maps global, the component adopts it instead of adding a
|
|
93
|
+
duplicate script.
|
|
94
|
+
* **Visible states:** the blocked, loading, and error states are accessible and
|
|
95
|
+
use the active c15t translations by default.
|
|
96
|
+
|
|
97
|
+
Keep one `scriptId` and one loader configuration across the page. Override the
|
|
98
|
+
default `scriptId` only to coordinate with a known c15t script registration, not
|
|
99
|
+
to load a second Maps SDK configuration. If two maps register conflicting
|
|
100
|
+
loader options, c15t reports the conflict and tells you to align the key,
|
|
101
|
+
language, region, libraries, and other loader options. A different `scriptId`
|
|
102
|
+
does not make a second Google loader safe.
|
|
103
|
+
|
|
104
|
+
## Configure the map
|
|
105
|
+
|
|
106
|
+
Pass `center`, `zoom`, `mapId`, and `options` as you would when constructing a
|
|
107
|
+
Google map:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<GoogleMap
|
|
111
|
+
apiKey={apiKey}
|
|
112
|
+
center={{ lat: 51.5072, lng: -0.1276 }}
|
|
113
|
+
consentCategory="measurement"
|
|
114
|
+
mapId="YOUR_MAP_ID"
|
|
115
|
+
options={{
|
|
116
|
+
disableDefaultUI: true,
|
|
117
|
+
gestureHandling: 'cooperative',
|
|
118
|
+
}}
|
|
119
|
+
zoom={11}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Changes to `center`, `zoom`, and updateable `options` are applied to the existing
|
|
124
|
+
map. Changing `mapId` recreates it because Google treats that value as
|
|
125
|
+
construction-time configuration.
|
|
126
|
+
|
|
127
|
+
The component has a default height of `320px`. Override `style.height` or apply
|
|
128
|
+
a class with an explicit height when your layout needs another size.
|
|
129
|
+
|
|
130
|
+
### Loader options
|
|
131
|
+
|
|
132
|
+
The direct Maps JavaScript API loader options are available as component props:
|
|
133
|
+
|
|
134
|
+
* `libraries`
|
|
135
|
+
* `language`
|
|
136
|
+
* `region`
|
|
137
|
+
* `version`
|
|
138
|
+
* `authReferrerPolicy`
|
|
139
|
+
* `mapIds`
|
|
140
|
+
* `channel`
|
|
141
|
+
* `solutionChannel`
|
|
142
|
+
* `nonce`
|
|
143
|
+
|
|
144
|
+
`mapIds` preloads map ID configuration; `mapId` selects the map ID for the
|
|
145
|
+
component instance.
|
|
146
|
+
|
|
147
|
+
## Handle loading and errors
|
|
148
|
+
|
|
149
|
+
The built-in loading and error states use `frame.loading` and `frame.error` from
|
|
150
|
+
your c15t messages. The consent placeholder uses the localized consent-type
|
|
151
|
+
title in both its message and button—for example, an `Analytics` title produces
|
|
152
|
+
“Enable Analytics consent.”
|
|
153
|
+
|
|
154
|
+
Use the fallback props when you need integration-specific content and `onError`
|
|
155
|
+
for reporting:
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
import { Frame, GoogleMap } from '@c15t/react';
|
|
159
|
+
|
|
160
|
+
function reportMapError(error: Error) {
|
|
161
|
+
// Send the error to your observability provider.
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
<GoogleMap
|
|
165
|
+
apiKey={apiKey}
|
|
166
|
+
center={{ lat: 40.7128, lng: -74.006 }}
|
|
167
|
+
consentCategory="measurement"
|
|
168
|
+
loadingFallback={<p>Loading map…</p>}
|
|
169
|
+
errorFallback={<p>The map could not be loaded.</p>}
|
|
170
|
+
onError={reportMapError}
|
|
171
|
+
placeholder={
|
|
172
|
+
<Frame.Root>
|
|
173
|
+
<Frame.Title>Allow measurement consent to view this map.</Frame.Title>
|
|
174
|
+
<Frame.Button category="measurement" />
|
|
175
|
+
</Frame.Root>
|
|
176
|
+
}
|
|
177
|
+
/>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
`onError` covers loader failures, timeouts, map-constructor failures, and
|
|
181
|
+
Google's global authentication failure callback. Authentication failures
|
|
182
|
+
usually indicate an invalid key, missing billing, a disabled API, or a referrer
|
|
183
|
+
that is not allowed.
|
|
184
|
+
|
|
185
|
+
If you provide a custom `placeholder`, include `Frame.Button` or another way to
|
|
186
|
+
reopen consent preferences or grant the required category.
|
|
187
|
+
|
|
188
|
+
### Retry a failed map
|
|
189
|
+
|
|
190
|
+
Increment `retryKey` to retry the same map after a loader, authentication, or
|
|
191
|
+
constructor failure:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { GoogleMap } from '@c15t/react';
|
|
195
|
+
import { useState } from 'react';
|
|
196
|
+
|
|
197
|
+
function RetryableMap({ apiKey }: { apiKey: string }) {
|
|
198
|
+
const [retryKey, setRetryKey] = useState(0);
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<>
|
|
202
|
+
<GoogleMap
|
|
203
|
+
apiKey={apiKey}
|
|
204
|
+
center={{ lat: 40.7128, lng: -74.006 }}
|
|
205
|
+
retryKey={retryKey}
|
|
206
|
+
/>
|
|
207
|
+
|
|
208
|
+
<button type="button" onClick={() => setRetryKey((key) => key + 1)}>
|
|
209
|
+
Retry map
|
|
210
|
+
</button>
|
|
211
|
+
</>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Changing `retryKey` clears the failed attempt and retries with the same
|
|
217
|
+
`scriptId`. A successful page-level SDK registration remains shared and is not
|
|
218
|
+
loaded again.
|
|
219
|
+
|
|
220
|
+
## Secure the browser key
|
|
221
|
+
|
|
222
|
+
For production:
|
|
223
|
+
|
|
224
|
+
1. Create a key specifically for the browser application.
|
|
225
|
+
2. Apply a **Websites** application restriction for every allowed development
|
|
226
|
+
and production origin.
|
|
227
|
+
3. Restrict the key to the **Maps JavaScript API** and any additional APIs used
|
|
228
|
+
by requested libraries.
|
|
229
|
+
4. Keep the value in an untracked environment file and expose it through the
|
|
230
|
+
browser environment variable required by your framework.
|
|
231
|
+
5. Monitor key usage and rotate the key if you see unexpected traffic.
|
|
232
|
+
|
|
233
|
+
When `authReferrerPolicy="origin"` is set, configure origin-level website
|
|
234
|
+
restrictions without URL paths.
|
|
235
|
+
|
|
236
|
+
* [Google Maps Platform security guidance](https://developers.google.com/maps/api-security-best-practices)
|
|
237
|
+
* [Maps JavaScript API loader options](https://developers.google.com/maps/documentation/javascript/load-maps-js-api)
|
|
238
|
+
* [Maps Demo Key for local prototypes](https://developers.google.com/maps/documentation/javascript/demo-key)
|
|
239
|
+
|
|
240
|
+
## Verify setup
|
|
241
|
+
|
|
242
|
+
1. Clear saved consent and reload the page.
|
|
243
|
+
2. Confirm no request to `maps.googleapis.com/maps/api/js` occurs before the
|
|
244
|
+
configured category is allowed.
|
|
245
|
+
3. Grant consent and confirm the map reaches its ready state.
|
|
246
|
+
4. Render two maps with the same `scriptId` and confirm only one loader script is
|
|
247
|
+
added.
|
|
248
|
+
5. Revoke consent and confirm each map instance is removed.
|
|
249
|
+
6. Test a rejected key or referrer and confirm `errorFallback` and `onError`
|
|
250
|
+
receive the failure.
|
|
251
|
+
7. Fix the rejected configuration, change `retryKey`, and confirm the map can
|
|
252
|
+
recover without changing `scriptId`.
|
|
253
|
+
|
|
254
|
+
## Types
|
|
255
|
+
|
|
256
|
+
### GoogleMapProps
|
|
257
|
+
|
|
258
|
+
|Property|Value|
|
|
259
|
+
|:--|:--|
|
|
260
|
+
|Type Name|\`GoogleMapProps\`|
|
|
261
|
+
|Source Path|\`./packages/react/src/components/integrations/google-map.tsx\`|
|
|
262
|
+
|
|
263
|
+
\*ExtractedTypeTable: Could not extract "GoogleMapProps" from "./packages/react/src/components/integrations/google-map.tsx" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Google Tag Manager
|
|
3
|
-
description: Deploy and manage marketing tags centrally with automatic consent
|
|
4
|
-
|
|
3
|
+
description: Deploy and manage marketing tags centrally with automatic consent
|
|
4
|
+
state synchronization.
|
|
5
5
|
icon: google-tag-manager
|
|
6
|
+
group: integrations
|
|
6
7
|
---
|
|
7
8
|
Google Tag Manager (GTM) is Google's tag management system that lets you deploy and manage marketing tags, analytics scripts, and conversion pixels without modifying your codebase. Instead of hardcoding multiple scripts, you configure them through GTM's web interface.
|
|
8
9
|
|
|
@@ -90,14 +91,14 @@ getOrCreateConsentRuntime({
|
|
|
90
91
|
|
|
91
92
|
1. **Creating a Tag Manager Container**
|
|
92
93
|
|
|
93
|
-
>
|
|
94
|
-
>
|
|
94
|
+
> 📝 Note:
|
|
95
95
|
> This step is optional if you already have a Tag Manager container. Ensure your container has consent overview enabled.
|
|
96
96
|
|
|
97
97
|
After signing into Google Tag Manager, you can create a new container.
|
|
98
98
|
Continue to Google Tag Manager
|
|
99
99
|
|
|
100
|
-
In Tag Manager, click Admin > Container Settings.
|
|
100
|
+
1. In Tag Manager, click Admin > Container Settings.
|
|
101
|
+
2. Under Additional Settings, select "Enable consent overview".
|
|
101
102
|
|
|
102
103
|
Enable consent overview
|
|
103
104
|
|
|
@@ -136,87 +137,18 @@ You do not need to wrap `dataLayer.push(...)` in a `useConsentManager().has(...)
|
|
|
136
137
|
|
|
137
138
|
### GoogleTagManagerOptions
|
|
138
139
|
|
|
139
|
-
|Property|
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
140
|
+
|Property|Value|
|
|
141
|
+
|:--|:--|
|
|
142
|
+
|Type Name|\`GoogleTagManagerOptions\`|
|
|
143
|
+
|Source Path|\`./packages/scripts/src/vendors/tag-managers/google-tag-manager.ts\`|
|
|
144
|
+
|
|
145
|
+
\*ExtractedTypeTable: Could not extract "GoogleTagManagerOptions" from "./packages/scripts/src/vendors/tag-managers/google-tag-manager.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
144
146
|
|
|
145
147
|
### Script
|
|
146
148
|
|
|
147
|
-
|Property|
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|src
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|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|
|
|
154
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
155
|
-
|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|
|
|
156
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
157
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
158
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
159
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
160
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
161
|
-
|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|
|
|
162
|
-
|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|
|
|
163
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
164
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
165
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
166
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
167
|
-
|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|
|
|
168
|
-
|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|
|
|
169
|
-
|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|
|
|
170
|
-
|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|
|
|
171
|
-
|
|
172
|
-
#### `onBeforeLoad`
|
|
173
|
-
|
|
174
|
-
Callback executed before the script is loaded
|
|
175
|
-
|
|
176
|
-
|Property|Type|Description|Default|Required|
|
|
177
|
-
|:--|:--|:--|:--|:--:|
|
|
178
|
-
|id|string|The original script ID|-|✅ Required|
|
|
179
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
180
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
181
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
182
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
183
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
184
|
-
|
|
185
|
-
#### `onLoad`
|
|
186
|
-
|
|
187
|
-
Callback executed when the script loads successfully
|
|
188
|
-
|
|
189
|
-
|Property|Type|Description|Default|Required|
|
|
190
|
-
|:--|:--|:--|:--|:--:|
|
|
191
|
-
|id|string|The original script ID|-|✅ Required|
|
|
192
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
193
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
194
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
195
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
196
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
197
|
-
|
|
198
|
-
#### `onError`
|
|
199
|
-
|
|
200
|
-
Callback executed if the script fails to load
|
|
201
|
-
|
|
202
|
-
|Property|Type|Description|Default|Required|
|
|
203
|
-
|:--|:--|:--|:--|:--:|
|
|
204
|
-
|id|string|The original script ID|-|✅ Required|
|
|
205
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
206
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
207
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
208
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
209
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
210
|
-
|
|
211
|
-
#### `onConsentChange`
|
|
212
|
-
|
|
213
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
214
|
-
|
|
215
|
-
|Property|Type|Description|Default|Required|
|
|
216
|
-
|:--|:--|:--|:--|:--:|
|
|
217
|
-
|id|string|The original script ID|-|✅ Required|
|
|
218
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
219
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
220
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
221
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
222
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
149
|
+
|Property|Value|
|
|
150
|
+
|:--|:--|
|
|
151
|
+
|Type Name|\`Script\`|
|
|
152
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
153
|
+
|
|
154
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|