@c15t/nextjs 2.0.0-rc.4 → 2.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/headless.cjs +1 -1
- package/dist/iab/styles.css +1 -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 +1 -0
- package/dist/types.cjs +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist-types/headless.d.ts +1 -0
- package/{dist → dist-types}/index.d.ts +4 -3
- package/dist-types/libs/browser-initial-data.d.ts +9 -0
- package/{dist → dist-types}/libs/initial-data.d.ts +1 -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 +250 -0
- package/docs/callbacks.md +117 -0
- package/docs/components/consent-banner.md +174 -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 +137 -0
- package/docs/components/consent-manager-provider.md +423 -0
- package/docs/components/consent-widget.md +78 -0
- package/docs/components/dev-tools.md +63 -0
- package/docs/components/frame.md +73 -0
- package/docs/concepts/client-modes.md +163 -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 +141 -0
- package/docs/concepts/policy-packs.md +229 -0
- package/docs/headless.md +184 -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 +390 -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 +117 -0
- package/docs/iab/consent-banner.md +95 -0
- package/docs/iab/consent-dialog.md +135 -0
- package/docs/iab/overview.md +119 -0
- package/docs/iab/use-gvl-data.md +208 -0
- package/docs/iframe-blocking.md +107 -0
- package/docs/integrations/databuddy.md +186 -0
- package/docs/integrations/google-tag-manager.md +153 -0
- package/docs/integrations/google-tag.md +149 -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 +89 -0
- package/docs/integrations/posthog.md +177 -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 +156 -0
- package/docs/policy-packs.md +246 -0
- package/docs/quickstart.md +155 -0
- package/docs/script-loader.md +300 -0
- package/docs/server-side.md +171 -0
- package/docs/styling/classnames.md +84 -0
- package/docs/styling/color-scheme.md +82 -0
- package/docs/styling/css-variables.md +92 -0
- package/docs/styling/overview.md +312 -0
- package/docs/styling/slots.md +93 -0
- package/docs/styling/tailwind.md +115 -0
- package/docs/styling/tokens.md +214 -0
- package/docs/troubleshooting.md +146 -0
- package/package.json +20 -13
- package/dist/headless.d.ts +0 -2
- 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,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: useGVLData
|
|
3
|
+
description: Hook to access processed Global Vendor List (GVL) data for building custom IAB TCF UI components.
|
|
4
|
+
---
|
|
5
|
+
> ❌ **Error:**
|
|
6
|
+
> c15t is not yet IAB certified. The IAB TCF components are under active development and should not be used in production. APIs and behavior may change before certification is achieved.
|
|
7
|
+
|
|
8
|
+
`useGVLData()` processes the raw IAB Global Vendor List (GVL) into a UI-friendly format. It handles purpose grouping into stacks, vendor mapping, special purpose/feature extraction, and loading state.
|
|
9
|
+
|
|
10
|
+
Use this hook when building a custom IAB TCF UI instead of the pre-built `IABConsentDialog`.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { useGVLData } from '@c15t/react/hooks';
|
|
14
|
+
|
|
15
|
+
function CustomIABPreferences() {
|
|
16
|
+
const { purposes, stacks, standalonePurposes, totalVendors, isLoading } = useGVLData();
|
|
17
|
+
|
|
18
|
+
if (isLoading) return <p>Loading vendor data...</p>;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div>
|
|
22
|
+
<p>{totalVendors} partners</p>
|
|
23
|
+
{standalonePurposes.map((purpose) => (
|
|
24
|
+
<div key={purpose.id}>
|
|
25
|
+
<h3>{purpose.name}</h3>
|
|
26
|
+
<p>{purpose.description}</p>
|
|
27
|
+
<p>{purpose.vendors.length} vendors</p>
|
|
28
|
+
</div>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> ℹ️ **Info:**
|
|
36
|
+
> Must be used within a ConsentManagerProvider with IAB mode enabled. Returns empty data if IAB is not configured.
|
|
37
|
+
|
|
38
|
+
## Return Value
|
|
39
|
+
|
|
40
|
+
The hook returns a `GVLData` object:
|
|
41
|
+
|
|
42
|
+
### GVLData
|
|
43
|
+
|
|
44
|
+
|Property|Type|Description|Default|Required|
|
|
45
|
+
|:--|:--|:--|:--|:--:|
|
|
46
|
+
|purposes|ProcessedPurpose|-|-|✅ Required|
|
|
47
|
+
|specialPurposes|ProcessedPurpose|-|-|✅ Required|
|
|
48
|
+
|specialFeatures|ProcessedSpecialFeature|-|-|✅ Required|
|
|
49
|
+
|features|ProcessedFeature|-|-|✅ Required|
|
|
50
|
+
|stacks|ProcessedStack|-|-|✅ Required|
|
|
51
|
+
|standalonePurposes|ProcessedPurpose|-|-|✅ Required|
|
|
52
|
+
|totalVendors|number|-|-|✅ Required|
|
|
53
|
+
|isLoading|boolean|-|-|✅ Required|
|
|
54
|
+
|
|
55
|
+
#### `purposes` ProcessedPurpose
|
|
56
|
+
|
|
57
|
+
|Property|Type|Description|Default|Required|
|
|
58
|
+
|:--|:--|:--|:--|:--:|
|
|
59
|
+
|id|number|-|-|✅ Required|
|
|
60
|
+
|name|string|-|-|✅ Required|
|
|
61
|
+
|description|string|-|-|✅ Required|
|
|
62
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
63
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
64
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
65
|
+
|isSpecialPurpose|boolean \|undefined|-|-|Optional|
|
|
66
|
+
|
|
67
|
+
#### `specialPurposes` ProcessedPurpose
|
|
68
|
+
|
|
69
|
+
|Property|Type|Description|Default|Required|
|
|
70
|
+
|:--|:--|:--|:--|:--:|
|
|
71
|
+
|id|number|-|-|✅ Required|
|
|
72
|
+
|name|string|-|-|✅ Required|
|
|
73
|
+
|description|string|-|-|✅ Required|
|
|
74
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
75
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
76
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
77
|
+
|isSpecialPurpose|boolean \|undefined|-|-|Optional|
|
|
78
|
+
|
|
79
|
+
#### `specialFeatures` ProcessedSpecialFeature
|
|
80
|
+
|
|
81
|
+
|Property|Type|Description|Default|Required|
|
|
82
|
+
|:--|:--|:--|:--|:--:|
|
|
83
|
+
|id|number|-|-|✅ Required|
|
|
84
|
+
|name|string|-|-|✅ Required|
|
|
85
|
+
|description|string|-|-|✅ Required|
|
|
86
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
87
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
88
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
89
|
+
|
|
90
|
+
#### `features` ProcessedFeature
|
|
91
|
+
|
|
92
|
+
|Property|Type|Description|Default|Required|
|
|
93
|
+
|:--|:--|:--|:--|:--:|
|
|
94
|
+
|id|number|-|-|✅ Required|
|
|
95
|
+
|name|string|-|-|✅ Required|
|
|
96
|
+
|description|string|-|-|✅ Required|
|
|
97
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
98
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
99
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
100
|
+
|
|
101
|
+
#### `stacks` ProcessedStack
|
|
102
|
+
|
|
103
|
+
|Property|Type|Description|Default|Required|
|
|
104
|
+
|:--|:--|:--|:--|:--:|
|
|
105
|
+
|id|number|-|-|✅ Required|
|
|
106
|
+
|name|string|-|-|✅ Required|
|
|
107
|
+
|description|string|-|-|✅ Required|
|
|
108
|
+
|purposes|ProcessedPurpose|-|-|✅ Required|
|
|
109
|
+
|
|
110
|
+
#### `standalonePurposes` ProcessedPurpose
|
|
111
|
+
|
|
112
|
+
|Property|Type|Description|Default|Required|
|
|
113
|
+
|:--|:--|:--|:--|:--:|
|
|
114
|
+
|id|number|-|-|✅ Required|
|
|
115
|
+
|name|string|-|-|✅ Required|
|
|
116
|
+
|description|string|-|-|✅ Required|
|
|
117
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
118
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
119
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
120
|
+
|isSpecialPurpose|boolean \|undefined|-|-|Optional|
|
|
121
|
+
|
|
122
|
+
## Types
|
|
123
|
+
|
|
124
|
+
### ProcessedPurpose
|
|
125
|
+
|
|
126
|
+
|Property|Type|Description|Default|Required|
|
|
127
|
+
|:--|:--|:--|:--|:--:|
|
|
128
|
+
|id|number|-|-|✅ Required|
|
|
129
|
+
|name|string|-|-|✅ Required|
|
|
130
|
+
|description|string|-|-|✅ Required|
|
|
131
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
132
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
133
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
134
|
+
|isSpecialPurpose|boolean \|undefined|-|-|Optional|
|
|
135
|
+
|
|
136
|
+
#### `vendors` ProcessedVendor
|
|
137
|
+
|
|
138
|
+
|Property|Type|Description|Default|Required|
|
|
139
|
+
|:--|:--|:--|:--|:--:|
|
|
140
|
+
|id|VendorId|-|-|✅ Required|
|
|
141
|
+
|name|string|-|-|✅ Required|
|
|
142
|
+
|policyUrl|string|-|-|✅ Required|
|
|
143
|
+
|usesNonCookieAccess|boolean|-|-|✅ Required|
|
|
144
|
+
|deviceStorageDisclosureUrl|string \|null|-|-|✅ Required|
|
|
145
|
+
|usesCookies|boolean|-|-|✅ Required|
|
|
146
|
+
|cookieMaxAgeSeconds|number \|null|-|-|✅ Required|
|
|
147
|
+
|cookieRefresh|boolean \|undefined|-|-|Optional|
|
|
148
|
+
|specialPurposes|number\[]|-|-|✅ Required|
|
|
149
|
+
|specialFeatures|number\[]|-|-|✅ Required|
|
|
150
|
+
|features|number\[]|-|-|✅ Required|
|
|
151
|
+
|purposes|number\[]|-|-|✅ Required|
|
|
152
|
+
|legIntPurposes|number\[]|-|-|✅ Required|
|
|
153
|
+
|legitimateInterestUrl|string \|null \|undefined|-|-|Optional|
|
|
154
|
+
|isCustom|boolean \|undefined|-|-|Optional|
|
|
155
|
+
|usesLegitimateInterest|boolean \|undefined|-|-|Optional|
|
|
156
|
+
|dataRetention|Object \|undefined|-|-|Optional|
|
|
157
|
+
|dataDeclaration|number\[] \|undefined|-|-|Optional|
|
|
158
|
+
|
|
159
|
+
### ProcessedVendor
|
|
160
|
+
|
|
161
|
+
|Property|Type|Description|Default|Required|
|
|
162
|
+
|:--|:--|:--|:--|:--:|
|
|
163
|
+
|id|VendorId|-|-|✅ Required|
|
|
164
|
+
|name|string|-|-|✅ Required|
|
|
165
|
+
|policyUrl|string|-|-|✅ Required|
|
|
166
|
+
|usesNonCookieAccess|boolean|-|-|✅ Required|
|
|
167
|
+
|deviceStorageDisclosureUrl|string \|null|-|-|✅ Required|
|
|
168
|
+
|usesCookies|boolean|-|-|✅ Required|
|
|
169
|
+
|cookieMaxAgeSeconds|number \|null|-|-|✅ Required|
|
|
170
|
+
|cookieRefresh|boolean \|undefined|-|-|Optional|
|
|
171
|
+
|specialPurposes|number\[]|-|-|✅ Required|
|
|
172
|
+
|specialFeatures|number\[]|-|-|✅ Required|
|
|
173
|
+
|features|number\[]|-|-|✅ Required|
|
|
174
|
+
|purposes|number\[]|-|-|✅ Required|
|
|
175
|
+
|legIntPurposes|number\[]|-|-|✅ Required|
|
|
176
|
+
|legitimateInterestUrl|string \|null \|undefined|-|-|Optional|
|
|
177
|
+
|isCustom|boolean \|undefined|-|-|Optional|
|
|
178
|
+
|usesLegitimateInterest|boolean \|undefined|-|-|Optional|
|
|
179
|
+
|dataRetention|Object \|undefined|-|-|Optional|
|
|
180
|
+
|dataDeclaration|number\[] \|undefined|-|-|Optional|
|
|
181
|
+
|
|
182
|
+
#### `dataRetention`
|
|
183
|
+
|
|
184
|
+
|Property|Type|Description|Default|Required|
|
|
185
|
+
|:--|:--|:--|:--|:--:|
|
|
186
|
+
|purposes|Record\<number, number> \|undefined|-|-|Optional|
|
|
187
|
+
|specialPurposes|Record\<number, number> \|undefined|-|-|Optional|
|
|
188
|
+
|stdRetention|number \|undefined|-|-|Optional|
|
|
189
|
+
|
|
190
|
+
### ProcessedStack
|
|
191
|
+
|
|
192
|
+
|Property|Type|Description|Default|Required|
|
|
193
|
+
|:--|:--|:--|:--|:--:|
|
|
194
|
+
|id|number|-|-|✅ Required|
|
|
195
|
+
|name|string|-|-|✅ Required|
|
|
196
|
+
|description|string|-|-|✅ Required|
|
|
197
|
+
|purposes|ProcessedPurpose|-|-|✅ Required|
|
|
198
|
+
|
|
199
|
+
### ProcessedSpecialFeature
|
|
200
|
+
|
|
201
|
+
|Property|Type|Description|Default|Required|
|
|
202
|
+
|:--|:--|:--|:--|:--:|
|
|
203
|
+
|id|number|-|-|✅ Required|
|
|
204
|
+
|name|string|-|-|✅ Required|
|
|
205
|
+
|description|string|-|-|✅ Required|
|
|
206
|
+
|descriptionLegal|string \|undefined|-|-|Optional|
|
|
207
|
+
|illustrations|string\[]|-|-|✅ Required|
|
|
208
|
+
|vendors|ProcessedVendor|-|-|✅ Required|
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Iframe Blocking
|
|
3
|
+
description: Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category.
|
|
4
|
+
---
|
|
5
|
+
Embedded iframes from third parties (YouTube, Google Maps, social media widgets) can set cookies and track users without their consent. c15t provides two approaches to gate iframes behind consent:
|
|
6
|
+
|
|
7
|
+
1. **`<Frame>` component** - A React component that conditionally renders children based on consent
|
|
8
|
+
2. **HTML `data-category` attribute** - For raw `<iframe>` elements outside of React
|
|
9
|
+
|
|
10
|
+
## Frame Component
|
|
11
|
+
|
|
12
|
+
The `<Frame>` component wraps content that requires consent. Children are only mounted when the specified category has consent. When consent is not granted, a placeholder is shown instead.
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Frame } from '@c15t/nextjs';
|
|
16
|
+
|
|
17
|
+
function YouTubeEmbed() {
|
|
18
|
+
return (
|
|
19
|
+
<Frame category="marketing">
|
|
20
|
+
<iframe
|
|
21
|
+
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
|
|
22
|
+
width="560"
|
|
23
|
+
height="315"
|
|
24
|
+
allowFullScreen
|
|
25
|
+
/>
|
|
26
|
+
</Frame>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Custom Placeholder
|
|
32
|
+
|
|
33
|
+
Replace the default placeholder with your own UI:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<Frame
|
|
37
|
+
category="marketing"
|
|
38
|
+
placeholder={
|
|
39
|
+
<div className="flex items-center justify-center h-64 bg-gray-100 rounded">
|
|
40
|
+
<p>Enable marketing cookies to watch this video.</p>
|
|
41
|
+
</div>
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
<iframe src="https://www.youtube.com/embed/..." />
|
|
45
|
+
</Frame>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Compound Components
|
|
49
|
+
|
|
50
|
+
Build custom placeholder layouts using compound components:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<Frame.Root category="marketing">
|
|
54
|
+
<Frame.Title category="marketing" />
|
|
55
|
+
<Frame.Button category="marketing" />
|
|
56
|
+
</Frame.Root>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## HTML Attribute Approach
|
|
60
|
+
|
|
61
|
+
For iframes outside of React (e.g., CMS content, server-rendered HTML), add `data-category` and use `data-src` instead of `src`:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<iframe
|
|
65
|
+
data-src="https://www.youtube.com/embed/dQw4w9WgXcQ"
|
|
66
|
+
data-category="marketing"
|
|
67
|
+
width="560"
|
|
68
|
+
height="315"
|
|
69
|
+
></iframe>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
When consent for the specified category is granted, c15t automatically swaps `data-src` to `src`, loading the iframe. When consent is revoked, `src` is moved back to `data-src`.
|
|
73
|
+
|
|
74
|
+
### Dynamic Iframes
|
|
75
|
+
|
|
76
|
+
c15t uses a `MutationObserver` to watch for dynamically added iframes. Any iframe with `data-category` added to the DOM after initialization is automatically processed.
|
|
77
|
+
|
|
78
|
+
## Initializing the Iframe Blocker
|
|
79
|
+
|
|
80
|
+
The iframe blocker for HTML attributes needs to be initialized separately from the Frame component:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { useConsentManager } from '@c15t/nextjs';
|
|
84
|
+
import { useEffect } from 'react';
|
|
85
|
+
|
|
86
|
+
function IframeBlockerInit() {
|
|
87
|
+
const { initializeIframeBlocker } = useConsentManager();
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
initializeIframeBlocker();
|
|
91
|
+
}, [initializeIframeBlocker]);
|
|
92
|
+
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## API Reference
|
|
98
|
+
|
|
99
|
+
### FrameProps
|
|
100
|
+
|
|
101
|
+
|Property|Type|Description|Default|Required|
|
|
102
|
+
|:--|:--|:--|:--|:--:|
|
|
103
|
+
|children|ReactNode|Content rendered when consent is granted. Children are not mounted until consent is given, preventing unnecessary network requests.|-|✅ Required|
|
|
104
|
+
|category|AllConsentNames|Consent category required to render children.|-|✅ Required|
|
|
105
|
+
|placeholder|ReactNode|A custom placeholder component to display when consent is not met. If not provided, a default placeholder will be displayed.|-|Optional|
|
|
106
|
+
|noStyle|boolean \|undefined|When true, removes all default styling from the component|false|Optional|
|
|
107
|
+
|theme|any|Custom theme to override default styles while maintaining structure and accessibility. Merges with defaults. Ignored when \`noStyle=\{true}\`.|undefined|Optional|
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Databuddy
|
|
3
|
+
description: Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization.
|
|
4
|
+
lastModified: 2025-10-31
|
|
5
|
+
|
|
6
|
+
icon: databuddy
|
|
7
|
+
---
|
|
8
|
+
The Databuddy script automatically respects consent preferences by toggling tracking on and off based on the user's consent state.
|
|
9
|
+
|
|
10
|
+
## Script Implementation
|
|
11
|
+
|
|
12
|
+
1. **Adding the Databuddy script to c15t**
|
|
13
|
+
|
|
14
|
+
> ℹ️ Info:
|
|
15
|
+
>
|
|
16
|
+
> See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { databuddy } from '@c15t/scripts/databuddy';
|
|
20
|
+
|
|
21
|
+
databuddy({
|
|
22
|
+
clientId: 'your-client-id',
|
|
23
|
+
scriptUrl: 'https://cdn.databuddy.cc/databuddy.js',
|
|
24
|
+
apiUrl: 'https://basket.databuddy.cc',
|
|
25
|
+
options: {
|
|
26
|
+
trackScreenViews: true,
|
|
27
|
+
trackOutgoingLinks: true,
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Using Databuddy in your application** Once initialized, Databuddy is available globally via window\.databuddy or window\.db:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// Track a custom event
|
|
36
|
+
window.databuddy?.trackCustomEvent('button_clicked', {
|
|
37
|
+
button_id: 'signup',
|
|
38
|
+
page: '/landing'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Or use the shorthand
|
|
42
|
+
window.db?.track('purchase_completed', {
|
|
43
|
+
amount: 99.99,
|
|
44
|
+
currency: 'USD'
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Track a screen view manually
|
|
48
|
+
window.databuddy?.screenView('/dashboard', {
|
|
49
|
+
user_role: 'admin'
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Set global properties for all events
|
|
53
|
+
window.databuddy?.setGlobalProperties({
|
|
54
|
+
app_version: '1.2.3',
|
|
55
|
+
environment: 'production'
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## How Consent Management Works
|
|
60
|
+
|
|
61
|
+
The Databuddy integration automatically handles consent management:
|
|
62
|
+
|
|
63
|
+
1. **Before Script Load**: Sets `window.databuddyConfig.disabled` based on initial consent state
|
|
64
|
+
2. **On Consent Grant**: Enables tracking by setting `window.databuddy.options.disabled = false`
|
|
65
|
+
3. **On Consent Revoke**: Disables tracking by setting `window.databuddy.options.disabled = true`
|
|
66
|
+
|
|
67
|
+
This ensures that no tracking occurs without user consent, keeping your analytics privacy-compliant.
|
|
68
|
+
|
|
69
|
+
## Configuration Options
|
|
70
|
+
|
|
71
|
+
The `options` parameter allows you to customize Databuddy's behavior:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
databuddy({
|
|
75
|
+
clientId: 'your-client-id',
|
|
76
|
+
scriptUrl: 'https://cdn.databuddy.cc/databuddy.js',
|
|
77
|
+
apiUrl: 'https://basket.databuddy.cc', // Optional, defaults to basket.databuddy.cc, change if self-hosting
|
|
78
|
+
options: {
|
|
79
|
+
// Tracking options
|
|
80
|
+
trackScreenViews: true, // Automatically track page views
|
|
81
|
+
trackOutgoingLinks: true, // Track clicks on external links
|
|
82
|
+
trackAttributes: false, // Track data-track attributes on elements
|
|
83
|
+
trackErrors: false, // Track JavaScript errors
|
|
84
|
+
trackPerformance: true, // Track performance metrics
|
|
85
|
+
trackWebVitals: false, // Track Core Web Vitals
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
// Network options
|
|
89
|
+
enableBatching: false, // Batch events before sending
|
|
90
|
+
batchSize: 10, // Events per batch
|
|
91
|
+
batchTimeout: 2000, // Batch timeout in ms
|
|
92
|
+
samplingRate: 1.0, // Sample rate (0.0-1.0)
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Types
|
|
98
|
+
|
|
99
|
+
### DatabuddyConsentOptions
|
|
100
|
+
|
|
101
|
+
|Property|Type|Description|Default|Required|
|
|
102
|
+
|:--|:--|:--|:--|:--:|
|
|
103
|
+
|clientId|string|Your Databuddy client ID.|-|✅ Required|
|
|
104
|
+
|apiUrl|string \|undefined|Your Databuddy API URL.|'https\://basket.databuddy.cc'|Optional|
|
|
105
|
+
|scriptUrl|string \|undefined|The Databuddy script URL.|'https\://cdn.databuddy.cc/databuddy.js'|Optional|
|
|
106
|
+
|options|Record\<string, unknown> \|undefined|Additional configuration options for Databuddy.|-|Optional|
|
|
107
|
+
|script|Script \|undefined|Override or extend the default script values. Options: \`id\`: 'databuddy'; \`category\`: 'measurement'|-|Optional|
|
|
108
|
+
|
|
109
|
+
### Script
|
|
110
|
+
|
|
111
|
+
|Property|Type|Description|Default|Required|
|
|
112
|
+
|:--|:--|:--|:--|:--:|
|
|
113
|
+
|id|string|Unique identifier for the script|-|✅ Required|
|
|
114
|
+
|src|string \|undefined|URL of the script to load|-|Optional|
|
|
115
|
+
|textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
|
|
116
|
+
|category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
|
|
117
|
+
|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|
|
|
118
|
+
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
119
|
+
|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|
|
|
120
|
+
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
121
|
+
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
122
|
+
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
123
|
+
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
124
|
+
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
125
|
+
|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|
|
|
126
|
+
|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|
|
|
127
|
+
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
128
|
+
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
129
|
+
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
130
|
+
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
131
|
+
|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|
|
|
132
|
+
|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|
|
|
133
|
+
|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|
|
|
134
|
+
|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|
|
|
135
|
+
|
|
136
|
+
#### `onBeforeLoad`
|
|
137
|
+
|
|
138
|
+
Callback executed before the script is loaded
|
|
139
|
+
|
|
140
|
+
|Property|Type|Description|Default|Required|
|
|
141
|
+
|:--|:--|:--|:--|:--:|
|
|
142
|
+
|id|string|The original script ID|-|✅ Required|
|
|
143
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
144
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
145
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
146
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
147
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
148
|
+
|
|
149
|
+
#### `onLoad`
|
|
150
|
+
|
|
151
|
+
Callback executed when the script loads successfully
|
|
152
|
+
|
|
153
|
+
|Property|Type|Description|Default|Required|
|
|
154
|
+
|:--|:--|:--|:--|:--:|
|
|
155
|
+
|id|string|The original script ID|-|✅ Required|
|
|
156
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
157
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
158
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
159
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
160
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
161
|
+
|
|
162
|
+
#### `onError`
|
|
163
|
+
|
|
164
|
+
Callback executed if the script fails to load
|
|
165
|
+
|
|
166
|
+
|Property|Type|Description|Default|Required|
|
|
167
|
+
|:--|:--|:--|:--|:--:|
|
|
168
|
+
|id|string|The original script ID|-|✅ Required|
|
|
169
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
170
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
171
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
172
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
173
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
174
|
+
|
|
175
|
+
#### `onConsentChange`
|
|
176
|
+
|
|
177
|
+
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
178
|
+
|
|
179
|
+
|Property|Type|Description|Default|Required|
|
|
180
|
+
|:--|:--|:--|:--|:--:|
|
|
181
|
+
|id|string|The original script ID|-|✅ Required|
|
|
182
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
183
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
184
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
185
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
186
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Google Tag Manager
|
|
3
|
+
description: Deploy and manage marketing tags centrally with automatic consent state synchronization.
|
|
4
|
+
lastModified: 2026-02-10
|
|
5
|
+
|
|
6
|
+
icon: google-tag-manager
|
|
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.
|
|
9
|
+
|
|
10
|
+
c15t automatically injects the GTM script into your page and syncs consent state with GTM using Consent Mode v2. By default, c15t loads GTM regardless of consent because GTM manages its own internal consent state and only fires tags when appropriate consent is granted.
|
|
11
|
+
|
|
12
|
+
This prevents GTM-managed scripts from loading without proper consent while giving you centralized control over your marketing stack.
|
|
13
|
+
|
|
14
|
+
> ℹ️ **Info:**
|
|
15
|
+
> Use GTM if your team manages many tags centrally in the GTM UI. Use gtag.js if you only need GA4/Google Ads directly in code. Don't run both for the same destination unless intentional, or you may duplicate events.
|
|
16
|
+
|
|
17
|
+
## Implementation
|
|
18
|
+
|
|
19
|
+
1. **Creating a Tag Manager Container**
|
|
20
|
+
|
|
21
|
+
> ℹ️ Info:
|
|
22
|
+
>
|
|
23
|
+
> This step is optional if you already have a Tag Manager container. Ensure your container has consent overview enabled.
|
|
24
|
+
|
|
25
|
+
After signing into Google Tag Manager, you can create a new container.
|
|
26
|
+
Continue to Google Tag Manager
|
|
27
|
+
|
|
28
|
+
In Tag Manager, click Admin > Container Settings.Under Additional Settings, select "Enable consent overview".
|
|
29
|
+
|
|
30
|
+
Enable consent overview
|
|
31
|
+
|
|
32
|
+
2. **Custom Update Trigger** We now need to create a custom trigger in GTM to trigger the update event, this is the trigger that is fired when the consent state is updated, e.g. user gives consent to a specific purpose.
|
|
33
|
+
|
|
34
|
+
In GTM, you can create a new trigger by clicking on the "Triggers" tab and then clicking on "New".
|
|
35
|
+
|
|
36
|
+
For the event name, you can use the default "consent-update", this is customizable later so you can change it if you want.
|
|
37
|
+
|
|
38
|
+
Create trigger
|
|
39
|
+
|
|
40
|
+
3. **Adding / Updating tags** Now for your existing tags, you can add the "consent-update" trigger to the tag, this will fire the update event when the consent state is updated & it has the appropriate consent state.
|
|
41
|
+
|
|
42
|
+
Update tags
|
|
43
|
+
|
|
44
|
+
4. **Setting up c15t with Google Tag Manager** After creating your container, you can set up c15t with Google Tag Manager. All you need to do is copy and paste your container ID & begins with "GTM-".
|
|
45
|
+
|
|
46
|
+
> ℹ️ Info:
|
|
47
|
+
>
|
|
48
|
+
> See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import { googleTagManager } from '@c15t/scripts/google-tag-manager';
|
|
52
|
+
|
|
53
|
+
googleTagManager({
|
|
54
|
+
id: 'GTM-XXXXXXX',
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Post-setup verification checklist
|
|
59
|
+
|
|
60
|
+
1. Open GTM Preview mode and confirm your container (`GTM-...`) loads on page load.
|
|
61
|
+
2. Before giving consent, confirm non-essential tags do not fire in GTM Preview.
|
|
62
|
+
3. Accept consent in the c15t banner/dialog and confirm a `consent-update` event appears in the GTM event timeline.
|
|
63
|
+
4. Confirm measurement/marketing tags fire only after the matching consent is granted.
|
|
64
|
+
5. Revoke consent and confirm a new `consent-update` event appears and affected tags stop firing.
|
|
65
|
+
|
|
66
|
+
## Types
|
|
67
|
+
|
|
68
|
+
### GoogleTagManagerOptions
|
|
69
|
+
|
|
70
|
+
|Property|Type|Description|Default|Required|
|
|
71
|
+
|:--|:--|:--|:--|:--:|
|
|
72
|
+
|id|string|Your Google Tag Manager container ID. Begins with 'GTM-'.|-|✅ Required|
|
|
73
|
+
|updateEventName|string \|undefined|Update Event Name A custom event name used as a trigger to load your script once the consent has been updated.|'consent-update'|Optional|
|
|
74
|
+
|script|Script \|undefined|Override or extend the default script values.|-|Optional|
|
|
75
|
+
|
|
76
|
+
### Script
|
|
77
|
+
|
|
78
|
+
|Property|Type|Description|Default|Required|
|
|
79
|
+
|:--|:--|:--|:--|:--:|
|
|
80
|
+
|id|string|Unique identifier for the script|-|✅ Required|
|
|
81
|
+
|src|string \|undefined|URL of the script to load|-|Optional|
|
|
82
|
+
|textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
|
|
83
|
+
|category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
|
|
84
|
+
|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|
|
|
85
|
+
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
86
|
+
|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|
|
|
87
|
+
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
88
|
+
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
89
|
+
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
90
|
+
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
91
|
+
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
92
|
+
|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|
|
|
93
|
+
|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|
|
|
94
|
+
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
95
|
+
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
96
|
+
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
97
|
+
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
98
|
+
|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|
|
|
99
|
+
|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|
|
|
100
|
+
|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|
|
|
101
|
+
|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|
|
|
102
|
+
|
|
103
|
+
#### `onBeforeLoad`
|
|
104
|
+
|
|
105
|
+
Callback executed before the script is loaded
|
|
106
|
+
|
|
107
|
+
|Property|Type|Description|Default|Required|
|
|
108
|
+
|:--|:--|:--|:--|:--:|
|
|
109
|
+
|id|string|The original script ID|-|✅ Required|
|
|
110
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
111
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
112
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
113
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
114
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
115
|
+
|
|
116
|
+
#### `onLoad`
|
|
117
|
+
|
|
118
|
+
Callback executed when the script loads successfully
|
|
119
|
+
|
|
120
|
+
|Property|Type|Description|Default|Required|
|
|
121
|
+
|:--|:--|:--|:--|:--:|
|
|
122
|
+
|id|string|The original script ID|-|✅ Required|
|
|
123
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
124
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
125
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
126
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
127
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
128
|
+
|
|
129
|
+
#### `onError`
|
|
130
|
+
|
|
131
|
+
Callback executed if the script fails to load
|
|
132
|
+
|
|
133
|
+
|Property|Type|Description|Default|Required|
|
|
134
|
+
|:--|:--|:--|:--|:--:|
|
|
135
|
+
|id|string|The original script ID|-|✅ Required|
|
|
136
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
137
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
138
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
139
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
140
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
141
|
+
|
|
142
|
+
#### `onConsentChange`
|
|
143
|
+
|
|
144
|
+
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
145
|
+
|
|
146
|
+
|Property|Type|Description|Default|Required|
|
|
147
|
+
|:--|:--|:--|:--|:--:|
|
|
148
|
+
|id|string|The original script ID|-|✅ Required|
|
|
149
|
+
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
150
|
+
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
151
|
+
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
152
|
+
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
153
|
+
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|