@c15t/scripts 3.0.0-alpha.1 → 3.0.0-alpha.3
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 +129 -59
- package/README.md +8 -29
- package/SKILL.md +33 -0
- package/dist/adobe-analytics.js +2 -0
- package/dist/ahrefs-analytics.js +2 -0
- package/dist/amplitude.js +2 -0
- package/dist/clearbit.js +2 -0
- package/dist/cloudflare-web-analytics.js +2 -0
- package/dist/cloudflare-zaraz.js +2 -0
- package/dist/crisp.js +2 -0
- package/dist/databuddy.js +2 -0
- package/dist/e2e-test-utils.js +2 -137
- package/dist/engine/compile.js +2 -89
- package/dist/engine/runtime.js +2 -448
- package/dist/events.js +2 -0
- package/dist/fathom-analytics.js +2 -0
- package/dist/front-chat.js +2 -0
- package/dist/google-tag-manager.js +2 -0
- package/dist/google-tag.js +2 -0
- package/dist/heap.js +2 -0
- package/dist/hightouch.js +2 -0
- package/dist/hotjar.js +2 -0
- package/dist/intercom.js +2 -0
- package/dist/klaviyo.js +2 -0
- package/dist/linkedin-insights.js +2 -0
- package/dist/logrocket.js +2 -0
- package/dist/matomo-analytics.js +2 -0
- package/dist/meta-pixel.js +2 -0
- package/dist/microsoft-clarity.js +2 -0
- package/dist/microsoft-uet.js +2 -0
- package/dist/mixpanel-analytics.js +2 -0
- package/dist/one-dollar-stats.js +2 -0
- package/dist/openai-pixel.js +2 -0
- package/dist/pinterest-tag.js +2 -0
- package/dist/pirsch.js +2 -0
- package/dist/plausible-analytics.js +2 -0
- package/dist/posthog.js +2 -0
- package/dist/promptwatch.js +2 -0
- package/dist/reddit-pixel.js +2 -0
- package/dist/registry.js +2 -392
- package/dist/resolve.js +2 -33
- package/dist/rudderstack.js +2 -0
- package/dist/rybbit-analytics.js +2 -0
- package/dist/segment.js +2 -0
- package/dist/snapchat-pixel.js +2 -0
- package/dist/tiktok-pixel.js +2 -0
- package/dist/types.js +2 -16
- package/dist/umami-analytics.js +2 -0
- package/dist/vendors/_shared/attributes.js +2 -14
- package/dist/vendors/_shared/google-consent.js +2 -27
- package/dist/vendors/_shared/install-builders.js +2 -21
- package/dist/vendors/_shared/required-id.js +2 -0
- package/dist/vendors/_shared/script-url.js +2 -28
- package/dist/vendors/ads-and-pixels/linkedin-insights.js +2 -48
- package/dist/vendors/ads-and-pixels/meta-pixel.js +2 -153
- package/dist/vendors/ads-and-pixels/microsoft-uet.js +2 -110
- package/dist/vendors/ads-and-pixels/openai-pixel.js +2 -88
- package/dist/vendors/ads-and-pixels/pinterest-tag.js +2 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +2 -107
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +2 -87
- package/dist/vendors/ads-and-pixels/tiktok-pixel.js +2 -89
- package/dist/vendors/ads-and-pixels/x-pixel.js +2 -48
- package/dist/vendors/analytics/adobe-analytics.js +2 -49
- package/dist/vendors/analytics/ahrefs-analytics.js +2 -27
- package/dist/vendors/analytics/amplitude.js +2 -134
- package/dist/vendors/analytics/clearbit.js +2 -28
- package/dist/vendors/analytics/cloudflare-web-analytics.js +2 -32
- package/dist/vendors/analytics/databuddy.js +2 -103
- package/dist/vendors/analytics/fathom-analytics.js +2 -35
- package/dist/vendors/analytics/google-tag.js +2 -66
- package/dist/vendors/analytics/heap.js +2 -134
- package/dist/vendors/analytics/hightouch.js +2 -109
- package/dist/vendors/analytics/hotjar.js +2 -44
- package/dist/vendors/analytics/logrocket.js +2 -58
- package/dist/vendors/analytics/matomo-analytics.js +2 -191
- package/dist/vendors/analytics/microsoft-clarity.js +2 -100
- package/dist/vendors/analytics/mixpanel-analytics.js +2 -93
- package/dist/vendors/analytics/one-dollar-stats.js +2 -0
- package/dist/vendors/analytics/pirsch.js +2 -67
- package/dist/vendors/analytics/plausible-analytics.js +2 -81
- package/dist/vendors/analytics/posthog.js +2 -200
- package/dist/vendors/analytics/promptwatch.js +2 -29
- package/dist/vendors/analytics/rudderstack.js +2 -183
- package/dist/vendors/analytics/rybbit-analytics.js +2 -63
- package/dist/vendors/analytics/segment.js +2 -56
- package/dist/vendors/analytics/umami-analytics.js +2 -39
- package/dist/vendors/analytics/vercel-analytics.js +2 -53
- package/dist/vendors/email-and-sms/klaviyo.js +2 -0
- package/dist/vendors/functional/crisp.js +2 -100
- package/dist/vendors/functional/front-chat.js +2 -0
- package/dist/vendors/functional/intercom.js +2 -45
- package/dist/vendors/tag-managers/cloudflare-zaraz.js +2 -98
- package/dist/vendors/tag-managers/google-tag-manager.js +2 -59
- package/dist/vercel-analytics.js +2 -0
- package/dist/x-pixel.js +2 -0
- package/dist-types/adobe-analytics.d.ts +2 -0
- package/dist-types/ahrefs-analytics.d.ts +2 -0
- package/dist-types/amplitude.d.ts +2 -0
- package/dist-types/clearbit.d.ts +2 -0
- package/dist-types/cloudflare-web-analytics.d.ts +2 -0
- package/dist-types/cloudflare-zaraz.d.ts +2 -0
- package/dist-types/crisp.d.ts +2 -0
- package/dist-types/databuddy.d.ts +2 -0
- package/dist-types/e2e-test-utils.d.ts +2 -0
- package/dist-types/engine/compile.d.ts +2 -3
- package/dist-types/engine/runtime.d.ts +2 -3
- package/dist-types/events.d.ts +2 -0
- package/dist-types/fathom-analytics.d.ts +2 -0
- package/dist-types/front-chat.d.ts +2 -0
- package/dist-types/google-tag-manager.d.ts +2 -0
- package/dist-types/google-tag.d.ts +2 -0
- package/dist-types/heap.d.ts +2 -0
- package/dist-types/hightouch.d.ts +2 -0
- package/dist-types/hotjar.d.ts +2 -0
- package/dist-types/intercom.d.ts +2 -0
- package/dist-types/klaviyo.d.ts +2 -0
- package/dist-types/linkedin-insights.d.ts +2 -0
- package/dist-types/logrocket.d.ts +2 -0
- package/dist-types/matomo-analytics.d.ts +2 -0
- package/dist-types/meta-pixel.d.ts +2 -0
- package/dist-types/microsoft-clarity.d.ts +2 -0
- package/dist-types/microsoft-uet.d.ts +2 -0
- package/dist-types/mixpanel-analytics.d.ts +2 -0
- package/dist-types/one-dollar-stats.d.ts +2 -0
- package/dist-types/openai-pixel.d.ts +2 -0
- package/dist-types/pinterest-tag.d.ts +2 -0
- package/dist-types/pirsch.d.ts +2 -0
- package/dist-types/plausible-analytics.d.ts +2 -0
- package/dist-types/posthog.d.ts +2 -0
- package/dist-types/promptwatch.d.ts +2 -0
- package/dist-types/reddit-pixel.d.ts +2 -0
- package/dist-types/registry.d.ts +2 -458
- package/dist-types/resolve.d.ts +2 -9
- package/dist-types/rudderstack.d.ts +2 -0
- package/dist-types/rybbit-analytics.d.ts +2 -0
- package/dist-types/segment.d.ts +2 -0
- package/dist-types/snapchat-pixel.d.ts +2 -0
- package/dist-types/tiktok-pixel.d.ts +2 -0
- package/dist-types/types.d.ts +2 -314
- package/dist-types/umami-analytics.d.ts +2 -0
- package/dist-types/vendors/_shared/attributes.d.ts +2 -35
- package/dist-types/vendors/_shared/google-consent.d.ts +2 -47
- package/dist-types/vendors/_shared/install-builders.d.ts +2 -30
- package/dist-types/vendors/_shared/required-id.d.ts +2 -0
- package/dist-types/vendors/_shared/script-url.d.ts +2 -75
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +2 -92
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +2 -289
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +2 -105
- package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +2 -211
- package/dist-types/vendors/ads-and-pixels/pinterest-tag.d.ts +2 -0
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +2 -210
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +2 -171
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +2 -106
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +2 -183
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +2 -75
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +2 -62
- package/dist-types/vendors/analytics/amplitude.d.ts +2 -234
- package/dist-types/vendors/analytics/clearbit.d.ts +2 -60
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +2 -67
- package/dist-types/vendors/analytics/databuddy.d.ts +2 -147
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +2 -90
- package/dist-types/vendors/analytics/google-tag.d.ts +2 -93
- package/dist-types/vendors/analytics/heap.d.ts +2 -316
- package/dist-types/vendors/analytics/hightouch.d.ts +2 -285
- package/dist-types/vendors/analytics/hotjar.d.ts +2 -73
- package/dist-types/vendors/analytics/logrocket.d.ts +2 -101
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +2 -41
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +2 -97
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +2 -113
- package/dist-types/vendors/analytics/one-dollar-stats.d.ts +2 -0
- package/dist-types/vendors/analytics/pirsch.d.ts +2 -96
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +2 -122
- package/dist-types/vendors/analytics/posthog.d.ts +2 -175
- package/dist-types/vendors/analytics/promptwatch.d.ts +2 -36
- package/dist-types/vendors/analytics/rudderstack.d.ts +2 -330
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +2 -82
- package/dist-types/vendors/analytics/segment.d.ts +2 -158
- package/dist-types/vendors/analytics/umami-analytics.d.ts +2 -93
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +2 -66
- package/dist-types/vendors/email-and-sms/klaviyo.d.ts +2 -0
- package/dist-types/vendors/functional/crisp.d.ts +2 -78
- package/dist-types/vendors/functional/front-chat.d.ts +2 -0
- package/dist-types/vendors/functional/intercom.d.ts +2 -135
- package/dist-types/vendors/tag-managers/cloudflare-zaraz.d.ts +2 -39
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +2 -94
- package/dist-types/vercel-analytics.d.ts +2 -0
- package/dist-types/x-pixel.d.ts +2 -0
- package/docs/README.md +129 -59
- package/docs/assets/v3/bottom-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/brand-preferences.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/headless-bar-html.png +0 -0
- package/docs/assets/v3/headless-bar-mobile.png +0 -0
- package/docs/assets/v3/headless-bar.png +0 -0
- package/docs/assets/v3/slim-bar.png +0 -0
- package/docs/concepts/choose-your-setup.md +87 -0
- package/docs/concepts/consent-categories.md +84 -0
- package/docs/concepts/consent-state.md +357 -0
- package/docs/{guides → concepts}/data-fetching.md +31 -27
- package/docs/concepts/how-consent-works.md +123 -0
- package/docs/concepts/policies.md +71 -0
- package/docs/customization/class-names.md +202 -0
- package/docs/customization/dark-mode.md +157 -0
- package/docs/customization/motion.md +119 -0
- package/docs/customization/overview.md +67 -33
- package/docs/customization/recipes.md +839 -47
- package/docs/customization/slots.md +216 -35
- package/docs/customization/stylesheets.md +147 -0
- package/docs/customization/tailwind.md +842 -0
- package/docs/customization/tokens.md +166 -36
- package/docs/customization/translations.md +61 -3
- package/docs/frameworks/astro/embeds.md +160 -0
- package/docs/frameworks/astro/network-blocker.md +86 -0
- package/docs/frameworks/astro/scripts.md +146 -0
- package/docs/frameworks/html/embeds.md +142 -0
- package/docs/frameworks/html/network-blocker.md +105 -0
- package/docs/frameworks/html/scripts.md +164 -0
- package/docs/frameworks/javascript/scripts.md +119 -0
- package/docs/frameworks/next/embeds.md +90 -0
- package/docs/frameworks/next/network-blocker.md +153 -0
- package/docs/frameworks/next/scripts.md +196 -0
- package/docs/frameworks/nuxt/embeds.md +81 -0
- package/docs/frameworks/nuxt/network-blocker.md +97 -0
- package/docs/frameworks/nuxt/scripts.md +89 -0
- package/docs/frameworks/react/embeds.md +89 -0
- package/docs/frameworks/react/network-blocker.md +140 -0
- package/docs/frameworks/react/scripts.md +115 -0
- package/docs/frameworks/svelte/embeds.md +96 -0
- package/docs/frameworks/svelte/network-blocker.md +141 -0
- package/docs/frameworks/svelte/scripts.md +137 -0
- package/docs/frameworks/sveltekit/embeds.md +103 -0
- package/docs/frameworks/sveltekit/network-blocker.md +149 -0
- package/docs/frameworks/sveltekit/scripts.md +141 -0
- package/docs/frameworks/tanstack-start/embeds.md +96 -0
- package/docs/frameworks/tanstack-start/network-blocker.md +145 -0
- package/docs/frameworks/tanstack-start/scripts.md +103 -0
- package/docs/frameworks/vue/embeds.md +84 -0
- package/docs/frameworks/vue/network-blocker.md +99 -0
- package/docs/frameworks/vue/scripts.md +93 -0
- package/docs/guides/banner-experiments.md +654 -0
- package/docs/guides/troubleshooting.md +120 -47
- package/docs/guides/verify-consent.md +81 -49
- package/docs/integrations/adobe-analytics.md +168 -160
- package/docs/integrations/ahrefs-analytics.md +153 -155
- package/docs/integrations/amplitude.md +163 -157
- package/docs/integrations/building-integrations.md +136 -37
- package/docs/integrations/clearbit.md +155 -155
- package/docs/integrations/cloudflare-web-analytics.md +157 -157
- package/docs/integrations/cloudflare-zaraz.md +210 -262
- package/docs/integrations/crisp.md +165 -159
- package/docs/integrations/databuddy.md +158 -174
- package/docs/integrations/fathom-analytics.md +159 -157
- package/docs/integrations/front-chat.md +322 -0
- package/docs/integrations/google-maps.md +119 -84
- package/docs/integrations/google-tag-manager.md +179 -164
- package/docs/integrations/google-tag.md +164 -161
- package/docs/integrations/heap.md +164 -156
- package/docs/integrations/hightouch.md +162 -158
- package/docs/integrations/hotjar.md +160 -156
- package/docs/integrations/intercom.md +184 -154
- package/docs/integrations/klaviyo.md +486 -0
- package/docs/integrations/linkedin-insights.md +175 -151
- package/docs/integrations/logrocket.md +161 -157
- package/docs/integrations/matomo-analytics.md +189 -179
- package/docs/integrations/meta-pixel.md +189 -151
- package/docs/integrations/microsoft-clarity.md +164 -156
- package/docs/integrations/microsoft-uet.md +149 -155
- package/docs/integrations/mixpanel-analytics.md +156 -161
- package/docs/integrations/one-dollar-stats.md +306 -0
- package/docs/integrations/openai-pixel.md +205 -302
- package/docs/integrations/overview.md +143 -83
- package/docs/integrations/pinterest-tag.md +329 -0
- package/docs/integrations/pirsch.md +170 -160
- package/docs/integrations/plausible-analytics.md +173 -159
- package/docs/integrations/posthog.md +227 -242
- package/docs/integrations/promptwatch.md +155 -155
- package/docs/integrations/reddit-pixel.md +186 -158
- package/docs/integrations/rudderstack.md +202 -187
- package/docs/integrations/rybbit-analytics.md +172 -161
- package/docs/integrations/segment.md +183 -155
- package/docs/integrations/snapchat-pixel.md +187 -157
- package/docs/integrations/tiktok-pixel.md +172 -151
- package/docs/integrations/umami-analytics.md +164 -159
- package/docs/integrations/vercel-analytics.md +167 -158
- package/docs/integrations/x-pixel.md +177 -151
- package/docs/integrations/youtube.md +122 -87
- package/docs/upgrade-v3.md +490 -354
- package/package.json +12 -236
- package/dist-types/__tests__/helpers.d.ts +0 -141
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/frameworks/javascript/script-loader.md +0 -94
- package/docs/frameworks/next/script-loader.md +0 -210
- package/docs/frameworks/react/script-loader.md +0 -63
- package/docs/guides/consent-state.md +0 -60
- package/docs/guides/deployment-modes.md +0 -75
- package/docs/integrations/clear-on-revocation.md +0 -167
- package/docs/integrations/granular-consent.md +0 -208
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Granular consent
|
|
3
|
-
description: Let visitors grant a category and still turn one vendor off,
|
|
4
|
-
without adopting IAB TCF.
|
|
5
|
-
group: integrations
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Granular consent is choice below the category level: a visitor grants
|
|
9
|
-
marketing and still turns Meta off. The unit of that choice is a vendor, so
|
|
10
|
-
the API names them `vendors`, `vendor` and `data-vendor`, and the hooks
|
|
11
|
-
`useVendorAllowed` and `useVendorDraft`. Everything else stays as it is:
|
|
12
|
-
categories, policies, and the preference center gain vendor rows rather than
|
|
13
|
-
a second consent model.
|
|
14
|
-
|
|
15
|
-
## Declare vendors
|
|
16
|
-
|
|
17
|
-
Add `vendors` to your runtime options. Each vendor sits inside a category
|
|
18
|
-
condition and needs a name and a privacy policy URL so the preference surface
|
|
19
|
-
can list it. The React provider takes the same option once its preference
|
|
20
|
-
center renders vendor rows; scripts, rules and iframes are gated the same way
|
|
21
|
-
whichever place declares it:
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { hosted, type Vendor } from 'c15t';
|
|
25
|
-
import { createConsentRuntime } from 'c15t/runtime';
|
|
26
|
-
|
|
27
|
-
const vendors = [
|
|
28
|
-
{
|
|
29
|
-
id: 'meta-pixel',
|
|
30
|
-
name: 'Meta Pixel',
|
|
31
|
-
category: 'marketing',
|
|
32
|
-
privacyPolicyUrl: 'https://www.facebook.com/privacy/policy/',
|
|
33
|
-
description: 'Ad conversion measurement and audiences.',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'google-analytics',
|
|
37
|
-
name: 'Google Analytics',
|
|
38
|
-
category: 'measurement',
|
|
39
|
-
privacyPolicyUrl: 'https://policies.google.com/privacy',
|
|
40
|
-
},
|
|
41
|
-
] satisfies Vendor[];
|
|
42
|
-
|
|
43
|
-
const runtime = createConsentRuntime({
|
|
44
|
-
mode: hosted({ url: '/api/c15t' }),
|
|
45
|
-
vendors,
|
|
46
|
-
scripts: [
|
|
47
|
-
{
|
|
48
|
-
id: 'meta-pixel',
|
|
49
|
-
category: 'marketing',
|
|
50
|
-
vendor: 'meta-pixel',
|
|
51
|
-
src: 'https://connect.facebook.net/en_US/fbevents.js',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Start in the browser after mount. The endpoint must serve your c15t backend.
|
|
57
|
-
runtime.start();
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The `id` is a lowercase slug of up to 64 characters. Reuse it as the `vendor`
|
|
61
|
-
field on scripts and network rules and as the `data-vendor` attribute on
|
|
62
|
-
iframes. Integrations from `@c15t/scripts` already set `vendor` to their
|
|
63
|
-
manifest slug, so `gtag()` and `metaPixel()` need no extra wiring.
|
|
64
|
-
|
|
65
|
-
A backend can also declare vendors. Add `vendors` and an optional
|
|
66
|
-
`vendorListVersion` to the manifest configuration; `/init` returns them and the
|
|
67
|
-
client merges them with the vendors declared in code. When both declare the
|
|
68
|
-
same id, the copy declared in code wins, and the backend copy comes back if the
|
|
69
|
-
code declaration is removed later. A slug used by a script, rule or iframe
|
|
70
|
-
but declared nowhere still gates loading. It is hidden from the preference surface, and the
|
|
71
|
-
runtime warns about it outside production.
|
|
72
|
-
|
|
73
|
-
## How a vendor is gated
|
|
74
|
-
|
|
75
|
-
A target loads when its category condition passes and the visitor has not
|
|
76
|
-
turned its vendor off:
|
|
77
|
-
|
|
78
|
-
```text
|
|
79
|
-
loads = category condition satisfied AND vendor not denied
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
The category is evaluated first, so an unknown category still throws as a
|
|
83
|
-
configuration error. A vendor toggle never grants a category on its own: with
|
|
84
|
-
marketing denied, `meta-pixel` stays blocked whatever its own switch says.
|
|
85
|
-
A script with `alwaysLoad` still mounts, as it does for a denied category;
|
|
86
|
-
its callbacks receive the vendor result in `info.vendor.granted` so a
|
|
87
|
-
self-managing SDK can honor it.
|
|
88
|
-
|
|
89
|
-
Under an `iab` policy the `vendor` slug is inert. Vendor consent then comes from
|
|
90
|
-
the TC string through `vendorId`, and the vendor rows are not shown.
|
|
91
|
-
|
|
92
|
-
The same rule applies to the three gates:
|
|
93
|
-
|
|
94
|
-
| Surface | Field |
|
|
95
|
-
| --------------- | ------------------------------- |
|
|
96
|
-
| Script loader | `Script.vendor` |
|
|
97
|
-
| Network blocker | `NetworkBlockerRule.vendor` |
|
|
98
|
-
| Iframe blocker | `data-vendor` on the `<iframe>` |
|
|
99
|
-
|
|
100
|
-
An iframe with `data-vendor` and no `data-category` is gated on the vendor
|
|
101
|
-
alone. An unknown `data-vendor` value is granted rather than thrown: a vendor
|
|
102
|
-
the visitor never saw cannot have been turned off. Such a frame has no
|
|
103
|
-
category to follow, so a denial the visitor recorded earlier holds even while
|
|
104
|
-
nothing declares the slug, for example before the backend's vendor list has
|
|
105
|
-
arrived on a cold start.
|
|
106
|
-
|
|
107
|
-
A script, rule or frame keeps its slug declared for as long as it is
|
|
108
|
-
configured. If a backend list or a provider update drops the entry, the
|
|
109
|
-
loader or blocker puts it back, so a stored denial keeps gating it. A slug
|
|
110
|
-
several modules share stays under every category they name it with, whichever
|
|
111
|
-
module updates last, and drops a category only once no module names it there.
|
|
112
|
-
Disposing a loader or blocker, or removing a gated frame from the page, drops
|
|
113
|
-
what only it named, so a vendor no live module owns stops being toggleable.
|
|
114
|
-
|
|
115
|
-
## Record a vendor choice
|
|
116
|
-
|
|
117
|
-
Vendor grants travel with the save. Stage them and confirm with the next save,
|
|
118
|
-
or pass them next to the categories:
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
// Stage from a toggle handler; nothing changes until save({}) runs. The
|
|
122
|
-
// empty patch confirms no category, so only the staged vendor is recorded;
|
|
123
|
-
// save() with no input would reconfirm every displayed category too.
|
|
124
|
-
runtime.stageVendorConsent('meta-pixel', false);
|
|
125
|
-
await runtime.kernel.commands.save({});
|
|
126
|
-
|
|
127
|
-
// Or confirm categories and vendors in one action.
|
|
128
|
-
await runtime.kernel.commands.save({
|
|
129
|
-
marketing: true,
|
|
130
|
-
measurement: true,
|
|
131
|
-
vendors: { 'meta-pixel': false },
|
|
132
|
-
});
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
`stageVendorConsent` stages a vendor slug for the next save; it is not the
|
|
136
|
-
IAB handle's `setVendorConsent`, which sets a TCF vendor by numeric id and
|
|
137
|
-
takes effect at once. The grants can also travel in the save context as
|
|
138
|
-
`{ vendors }`, which wins when both are given.
|
|
139
|
-
|
|
140
|
-
Only the vendors the visitor turned off are stored. Accept all and reject all
|
|
141
|
-
both clear that list, so vendors follow their category on a bulk action. A bulk
|
|
142
|
-
action narrowed to the displayed categories only lifts the denials of vendors
|
|
143
|
-
those categories decide on their own; a vendor another granted category would
|
|
144
|
-
still load keeps its denial. A
|
|
145
|
-
vendor that is not declared, or is declared with `disabled: true`, is ignored.
|
|
146
|
-
Under an opt-out policy every vendor starts on and the stored list is the
|
|
147
|
-
do-not-sell list.
|
|
148
|
-
|
|
149
|
-
A vendor-only change records without touching category receipts. The kernel
|
|
150
|
-
emits `vendors:recorded` rather than `choice:recorded`, writes the
|
|
151
|
-
`<storageKey>-vendors` cookie and localStorage entry, and sends the complete
|
|
152
|
-
grant map to the backend as `vendorChoice`. Category confirmation times are not
|
|
153
|
-
renewed. The vendor entry also carries the subject id, so a visitor whose first
|
|
154
|
-
act only decided vendors keeps the same subject after a reload even though no
|
|
155
|
-
category record exists yet.
|
|
156
|
-
|
|
157
|
-
Scripts see the vendor result in their callbacks. `ScriptCallbackInfo.vendor`
|
|
158
|
-
carries `{ id, granted }` outside IAB mode. Integrations that send Google
|
|
159
|
-
Consent Mode or RudderStack signals send every category as denied while their
|
|
160
|
-
vendor is off, so the vendor's own consent API cannot re-enable tracking.
|
|
161
|
-
|
|
162
|
-
## Show vendors in the preference center
|
|
163
|
-
|
|
164
|
-
The `ConsentWidget` and `ConsentDialog` in React, Vue and Svelte list vendors
|
|
165
|
-
under their category when the provider declares them. Pass the same `vendors`
|
|
166
|
-
array to `ConsentProvider`, to the `vendors` prop of `ConsentRoot` in
|
|
167
|
-
[Next.js](../frameworks/next/script-loader.md#granular-consent) and
|
|
168
|
-
[TanStack Start](https://c15t.com/docs/frameworks/tanstack-start/quickstart#granular-consent),
|
|
169
|
-
to the Nuxt module or Vue plugin config next to `scripts`, or to
|
|
170
|
-
`ConsentManagerProvider` options in Svelte:
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
import { ConsentProvider, hosted } from 'c15t/react';
|
|
174
|
-
|
|
175
|
-
<ConsentProvider options={{ mode: hosted({ url: '/api/c15t' }), vendors }}>
|
|
176
|
-
{children}
|
|
177
|
-
</ConsentProvider>;
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Each category row expands to one card per vendor with its own switch. The
|
|
181
|
-
switches disable while the category is off in the draft, and Save records the
|
|
182
|
-
vendors the visitor moved. A custom control uses `useVendorDraft()` from
|
|
183
|
-
`c15t/react` to read and stage the same grants, with `isStale` and `reset` for
|
|
184
|
-
a draft the policy or vendor list changed under, and `useVendorAllowed(id)` to
|
|
185
|
-
read one vendor's effective result. Copy comes from
|
|
186
|
-
`consentManagerDialog.vendors.{title, privacyPolicy, disabledByCategory,
|
|
187
|
-
switchLabel}` in the translations. In Vue, `useConsentDraft()` returns the
|
|
188
|
-
same `vendors` map and `setVendor`; in Svelte, `getConsentManager()` exposes
|
|
189
|
-
`selectedVendors`, `setSelectedVendor` and `getDisplayedVendors(category)`.
|
|
190
|
-
The three frameworks render the same cards, and the parity suite compares
|
|
191
|
-
their markup, accessibility tree, computed styles and geometry.
|
|
192
|
-
|
|
193
|
-
## What a denial does not do
|
|
194
|
-
|
|
195
|
-
Turning a vendor off blocks future loads and requests. It does not delete the
|
|
196
|
-
cookies that vendor already set, and
|
|
197
|
-
[clear on revocation](./clear-on-revocation.md) does not help here:
|
|
198
|
-
it runs when a category is denied, and the category stays granted when only one
|
|
199
|
-
of its vendors is off. Remove that vendor's cookies yourself from an
|
|
200
|
-
`onConsentChange` callback that checks `info.vendor.granted`.
|
|
201
|
-
|
|
202
|
-
A vendor denial has no expiry and no policy basis. It stays until the visitor
|
|
203
|
-
changes it or a bulk action clears it, including across a policy change that
|
|
204
|
-
requires the category choice again.
|
|
205
|
-
|
|
206
|
-
Adding a vendor to the list does not reopen consent. New vendors default to on
|
|
207
|
-
inside a granted category. Use the policy rule's `copyRevision` when a new
|
|
208
|
-
vendor should prompt the visitor again.
|