@c15t/react 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +35 -5
- package/README.md +2 -2
- package/dist/component-hooks/use-consent-gate.js +2 -0
- package/dist/component-hooks/use-consent-labels.js +2 -0
- package/dist/component-hooks/use-consent-text-direction.js +2 -0
- package/dist/component-hooks/use-vendors-listed-under.js +2 -0
- package/dist/components/consent-gate/atoms.js +1 -1
- package/dist/components/consent-gate/consent-gate.js +1 -1
- package/dist/components/iab-prompt/atoms/root.js +1 -1
- package/dist/components/panel-trigger/atoms/toolbar.js +1 -1
- package/dist/components/preferences/atoms/button.js +1 -1
- package/dist/components/preferences/atoms/vendor-list.js +1 -1
- package/dist/components/prompt/atoms/root.js +1 -1
- package/dist/components/prompt/components.js +1 -1
- package/dist/components/prompt/policy-actions.js +1 -1
- package/dist/components/prompt/prompt.js +1 -1
- package/dist/components/prompt/surface-context.js +1 -1
- package/dist/components/prompt/use-banner-copy.js +1 -1
- package/dist/components/shared/streamed-surface.js +1 -1
- package/dist/headless.js +1 -1
- package/dist/index-parts/offline.js +1 -1
- package/dist/modes.js +1 -1
- package/dist/styles.tw3.css +2 -2
- package/dist/transports/offline.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/component-hooks/use-consent-gate.d.ts +102 -0
- package/dist-types/component-hooks/use-consent-labels.d.ts +32 -0
- package/dist-types/component-hooks/use-consent-text-direction.d.ts +22 -0
- package/dist-types/component-hooks/use-vendors-listed-under.d.ts +30 -0
- package/dist-types/components/prompt/atoms/root.d.ts +3 -3
- package/dist-types/components/prompt/prompt.d.ts +4 -3
- package/dist-types/components/prompt/surface-context.d.ts +1 -14
- package/dist-types/components/prompt/use-banner-copy.d.ts +8 -3
- package/dist-types/components/shared/streamed-surface.d.ts +47 -10
- package/dist-types/headless.d.ts +10 -1
- package/dist-types/hooks/use-iab-policy-guard.d.ts +17 -1
- package/dist-types/hooks/use-scroll-lock.d.ts +16 -2
- package/dist-types/index-parts/offline.d.ts +1 -1
- package/dist-types/modes.d.ts +1 -1
- package/dist-types/module-hooks/script-loader.d.ts +9 -0
- package/dist-types/provider.d.ts +3 -3
- package/dist-types/transports/offline.d.ts +2 -2
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +35 -5
- package/docs/concepts/choose-your-setup.md +9 -9
- package/docs/concepts/consent-state.md +81 -9
- package/docs/concepts/data-fetching.md +30 -23
- package/docs/concepts/modes.md +87 -35
- package/docs/customization/recipes.md +4 -4
- package/docs/customization/stylesheets.md +42 -3
- package/docs/customization/tailwind.md +17 -34
- package/docs/customization/translations.md +18 -12
- package/docs/frameworks/react/clear-on-revocation.md +3 -2
- package/docs/frameworks/react/components/consent-banner.md +3 -3
- package/docs/frameworks/react/components/consent-provider.md +29 -29
- package/docs/frameworks/react/gpp.md +1 -1
- package/docs/frameworks/react/headless.md +146 -19
- package/docs/frameworks/react/hooks.md +2 -1
- package/docs/frameworks/react/iab.md +8 -1
- package/docs/frameworks/react/quickstart.md +2 -2
- package/docs/frameworks/react/rendering.md +1 -1
- package/docs/frameworks/react/translations.md +9 -9
- package/docs/frameworks/react/troubleshooting.md +1 -1
- package/docs/frameworks/react/upgrade-v3.md +39 -32
- package/docs/frameworks/react/vendor-consent.md +5 -0
- package/docs/guides/banner-experiments.md +3 -3
- package/docs/guides/troubleshooting.md +3 -2
- package/docs/integrations/activecampaign.md +297 -0
- package/docs/integrations/ada.md +396 -0
- package/docs/integrations/adobe-analytics.md +2 -2
- package/docs/integrations/adobe-target.md +460 -0
- package/docs/integrations/adroll.md +336 -0
- package/docs/integrations/ahrefs-analytics.md +2 -2
- package/docs/integrations/amazon-ads.md +424 -0
- package/docs/integrations/amplitude.md +2 -2
- package/docs/integrations/appcues.md +368 -0
- package/docs/integrations/attentive.md +313 -0
- package/docs/integrations/building-integrations.md +29 -16
- package/docs/integrations/clay.md +305 -0
- package/docs/integrations/clearbit.md +3 -3
- package/docs/integrations/cloudflare-web-analytics.md +2 -2
- package/docs/integrations/cloudflare-zaraz.md +2 -2
- package/docs/integrations/crisp.md +2 -2
- package/docs/integrations/customer-io.md +369 -0
- package/docs/integrations/databuddy.md +127 -52
- package/docs/integrations/default-com.md +497 -0
- package/docs/integrations/dynamic-yield.md +373 -0
- package/docs/integrations/fathom-analytics.md +2 -2
- package/docs/integrations/front-chat.md +2 -2
- package/docs/integrations/fullstory.md +298 -0
- package/docs/integrations/gainsight-px.md +418 -0
- package/docs/integrations/google-maps.md +2 -2
- package/docs/integrations/google-tag-manager.md +59 -2
- package/docs/integrations/google-tag.md +2 -2
- package/docs/integrations/gorgias.md +365 -0
- package/docs/integrations/heap.md +2 -2
- package/docs/integrations/hightouch.md +2 -2
- package/docs/integrations/hotjar.md +40 -26
- package/docs/integrations/hubspot.md +529 -0
- package/docs/integrations/insider.md +550 -0
- package/docs/integrations/intercom.md +2 -2
- package/docs/integrations/klaviyo.md +2 -2
- package/docs/integrations/linkedin-insights.md +2 -2
- package/docs/integrations/liveintent.md +327 -0
- package/docs/integrations/logrocket.md +2 -2
- package/docs/integrations/lucky-orange.md +336 -0
- package/docs/integrations/marketo.md +309 -0
- package/docs/integrations/matomo-analytics.md +2 -2
- package/docs/integrations/meta-pixel.md +2 -2
- package/docs/integrations/microsoft-clarity.md +2 -2
- package/docs/integrations/microsoft-uet.md +2 -2
- package/docs/integrations/mixpanel-analytics.md +2 -2
- package/docs/integrations/one-dollar-stats.md +2 -2
- package/docs/integrations/openai-pixel.md +2 -2
- package/docs/integrations/optimizely.md +411 -0
- package/docs/integrations/oracle-eloqua.md +301 -0
- package/docs/integrations/overview.md +128 -81
- package/docs/integrations/pendo.md +339 -0
- package/docs/integrations/pinterest-tag.md +2 -2
- package/docs/integrations/pirsch.md +2 -2
- package/docs/integrations/plausible-analytics.md +2 -2
- package/docs/integrations/posthog.md +2 -2
- package/docs/integrations/promptwatch.md +2 -2
- package/docs/integrations/rb2b.md +363 -0
- package/docs/integrations/reddit-pixel.md +2 -2
- package/docs/integrations/rudderstack.md +2 -2
- package/docs/integrations/rybbit-analytics.md +2 -2
- package/docs/integrations/salesforce-pardot.md +342 -0
- package/docs/integrations/segment.md +2 -2
- package/docs/integrations/sentry.md +2 -2
- package/docs/integrations/shopify.md +323 -0
- package/docs/integrations/snapchat-pixel.md +2 -2
- package/docs/integrations/statable-analytics.md +345 -0
- package/docs/integrations/the-trade-desk.md +328 -0
- package/docs/integrations/tiktok-pixel.md +2 -2
- package/docs/integrations/umami-analytics.md +2 -2
- package/docs/integrations/vector.md +333 -0
- package/docs/integrations/vercel-analytics.md +2 -2
- package/docs/integrations/vercel-speed-insights.md +7 -2
- package/docs/integrations/wisepops.md +416 -0
- package/docs/integrations/x-pixel.md +2 -2
- package/docs/integrations/youtube.md +2 -2
- package/docs/integrations/zendesk.md +359 -0
- package/package.json +10 -32
- package/dist/components/prompt/resolve-banner-primary-actions.js +0 -1
- package/dist-types/components/prompt/resolve-banner-primary-actions.d.ts +0 -14
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Zendesk Messaging
|
|
3
|
+
description: Load the Zendesk Messaging Web Widget after functionality consent,
|
|
4
|
+
map measurement consent to its cookie ranges and clear widget storage on
|
|
5
|
+
revocation.
|
|
6
|
+
seoTitle: Zendesk Messaging cookie consent with c15t
|
|
7
|
+
seoDescription: Gate Zendesk Messaging on functionality consent. Map measurement
|
|
8
|
+
consent to analytics storage and send Zendesk's none range when consent is
|
|
9
|
+
withdrawn.
|
|
10
|
+
icon: messages-square
|
|
11
|
+
group: integrations
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Zendesk Messaging adds the Zendesk support chat widget to your site. The c15t
|
|
15
|
+
`zendeskWidget` helper waits for `functionality` consent before it creates
|
|
16
|
+
Zendesk's globals or requests the widget. Before the widget loads, it tells
|
|
17
|
+
Zendesk which storage to use: functional storage only, or analytics storage as
|
|
18
|
+
well when `measurement` is allowed.
|
|
19
|
+
|
|
20
|
+
On withdrawal, the helper tells Zendesk to hide the widget and delete its local
|
|
21
|
+
and session storage, and c15t reloads the page by default.
|
|
22
|
+
|
|
23
|
+
This helper covers Zendesk Messaging. Web Widget Classic uses a different API.
|
|
24
|
+
|
|
25
|
+
## Configure Zendesk Messaging
|
|
26
|
+
|
|
27
|
+
In **Admin Center > Channels > Messaging and social > Messaging**, select your
|
|
28
|
+
widget and open **Installation**. Copy the widget key from its code snippet.
|
|
29
|
+
Then remove the Zendesk snippet from your page or tag manager.
|
|
30
|
+
|
|
31
|
+
| Package manager | Command |
|
|
32
|
+
| :-------------- | :------------------------------- |
|
|
33
|
+
| npm | `npm install @c15t/integrations` |
|
|
34
|
+
| pnpm | `pnpm add @c15t/integrations` |
|
|
35
|
+
| yarn | `yarn add @c15t/integrations` |
|
|
36
|
+
| bun | `bun add @c15t/integrations` |
|
|
37
|
+
|
|
38
|
+
```ts title="src/consent-scripts.ts"
|
|
39
|
+
import { zendeskWidget } from '@c15t/integrations/zendesk';
|
|
40
|
+
|
|
41
|
+
export const scripts = [zendeskWidget({ key: 'YOUR_ZENDESK_WIDGET_KEY' })];
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Register the scripts
|
|
45
|
+
|
|
46
|
+
Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
|
|
47
|
+
endpoint, policy, styles and consent UI. Remove the vendor's original script,
|
|
48
|
+
SDK initializer or tag-manager entry, so the vendor loads only through c15t.
|
|
49
|
+
|
|
50
|
+
The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
|
|
51
|
+
quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
|
|
52
|
+
in the Next.js guide, add the helper to that array instead of creating a
|
|
53
|
+
second file.
|
|
54
|
+
The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
|
|
55
|
+
point for your framework below. These are edits to that provider, not a second
|
|
56
|
+
provider.
|
|
57
|
+
|
|
58
|
+
**Next.js**
|
|
59
|
+
|
|
60
|
+
Add the configuration to `scripts` in `c15t.config.ts`, next to
|
|
61
|
+
`next.config.ts`:
|
|
62
|
+
|
|
63
|
+
```ts title="c15t.config.ts"
|
|
64
|
+
import { defineConsentConfig } from 'c15t/next';
|
|
65
|
+
import { scripts } from './src/consent-scripts';
|
|
66
|
+
|
|
67
|
+
export default defineConsentConfig({ scripts });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Keep the rest of your config, such as `mode` and `routePrefix`, in the
|
|
71
|
+
same call. `ConsentRoot` reads the config in the browser, so the layout
|
|
72
|
+
keeps passing only `state`. App Router, Pages Router and static export all
|
|
73
|
+
read the same file. See
|
|
74
|
+
[Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
|
|
75
|
+
|
|
76
|
+
**TanStack Start**
|
|
77
|
+
|
|
78
|
+
Import the configuration into your root route and pass it to the existing
|
|
79
|
+
`ConsentRoot` as a top-level prop. Keep the loader from the
|
|
80
|
+
[TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
|
|
81
|
+
|
|
82
|
+
```tsx title="src/routes/__root.tsx"
|
|
83
|
+
import { scripts } from '../consent-scripts';
|
|
84
|
+
|
|
85
|
+
<ConsentRoot state={consent} scripts={scripts}>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Import vendor helpers in the root route module, not in a server function.
|
|
89
|
+
A server function's return value must be serializable, and script
|
|
90
|
+
configurations carry callbacks. See
|
|
91
|
+
[TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
|
|
92
|
+
|
|
93
|
+
**React**
|
|
94
|
+
|
|
95
|
+
Add the configuration to the existing `ConsentProvider` options, next to
|
|
96
|
+
`mode`:
|
|
97
|
+
|
|
98
|
+
```tsx title="src/consent.tsx"
|
|
99
|
+
import { scripts } from './consent-scripts';
|
|
100
|
+
|
|
101
|
+
<ConsentProvider options={{ mode, scripts }}>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`mode` is the `manifest()` value from the
|
|
105
|
+
[React quickstart](../frameworks/react/quickstart.md). Keep the banner,
|
|
106
|
+
dialog and preferences link inside the provider. See
|
|
107
|
+
[React scripts and embeds](../frameworks/react/scripts.md).
|
|
108
|
+
|
|
109
|
+
**Nuxt**
|
|
110
|
+
|
|
111
|
+
Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
|
|
112
|
+
relative import to where you created `consent-scripts.ts`:
|
|
113
|
+
|
|
114
|
+
```ts title="app/app.config.ts"
|
|
115
|
+
import { scripts } from '../src/consent-scripts';
|
|
116
|
+
|
|
117
|
+
export default defineAppConfig({
|
|
118
|
+
c15t: { scripts },
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The Nuxt module merges this over its options in `nuxt.config.ts` and starts
|
|
123
|
+
one script loader in the browser after hydration, once it has applied the
|
|
124
|
+
visitor's stored choice and privacy signals. Keep `scripts` out of
|
|
125
|
+
`nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
|
|
126
|
+
callbacks. Write the vendor IDs into `consent-scripts.ts`. See
|
|
127
|
+
[Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
|
|
128
|
+
|
|
129
|
+
**Vue**
|
|
130
|
+
|
|
131
|
+
Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
|
|
132
|
+
|
|
133
|
+
```ts title="src/main.ts"
|
|
134
|
+
import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
|
|
135
|
+
import { scripts } from './consent-scripts';
|
|
136
|
+
|
|
137
|
+
app.use(c15tVue, {
|
|
138
|
+
mode: manifest(),
|
|
139
|
+
scripts,
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Keep your existing `mode` and other options. The plugin starts one
|
|
144
|
+
script loader when the app mounts, after it has applied the visitor's stored
|
|
145
|
+
choice. Do not also call `createScriptLoader` from a component. See
|
|
146
|
+
[Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
|
|
147
|
+
|
|
148
|
+
**Astro**
|
|
149
|
+
|
|
150
|
+
Add the scripts to the client entrypoint from the
|
|
151
|
+
[Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
|
|
152
|
+
which the integration finds on its own. Keep `astro.config.mjs` as it is.
|
|
153
|
+
If the module already exports scripts, combine the two arrays.
|
|
154
|
+
|
|
155
|
+
```ts title="src/c15t.client.ts"
|
|
156
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
157
|
+
import { scripts } from './consent-scripts';
|
|
158
|
+
|
|
159
|
+
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Vendor helpers contain callbacks, and the integration options in
|
|
163
|
+
`astro.config.mjs` are serialized into the page, so do not put helpers in
|
|
164
|
+
the integration's `scripts` option. The integration passes the client
|
|
165
|
+
entrypoint to the one runtime every page shares, including across
|
|
166
|
+
`ClientRouter` navigation.
|
|
167
|
+
|
|
168
|
+
**Svelte**
|
|
169
|
+
|
|
170
|
+
Import the scripts in the component that owns your existing provider and
|
|
171
|
+
pass them as a top-level prop:
|
|
172
|
+
|
|
173
|
+
```svelte title="src/App.svelte"
|
|
174
|
+
<script lang="ts">
|
|
175
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
176
|
+
import { scripts } from './consent-scripts';
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<ConsentProvider mode={manifest()} {scripts}>
|
|
180
|
+
<!-- Keep your application, consent UI and preferences link here. -->
|
|
181
|
+
</ConsentProvider>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
|
|
185
|
+
The provider owns the loader and disposes it on unmount.
|
|
186
|
+
|
|
187
|
+
**SvelteKit**
|
|
188
|
+
|
|
189
|
+
Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
|
|
190
|
+
handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
|
|
191
|
+
|
|
192
|
+
```svelte title="src/routes/+layout.svelte"
|
|
193
|
+
<script lang="ts">
|
|
194
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
195
|
+
import { scripts } from '../consent-scripts';
|
|
196
|
+
|
|
197
|
+
let { children, data } = $props();
|
|
198
|
+
</script>
|
|
199
|
+
|
|
200
|
+
<ConsentRoot state={data.consent} {scripts}>
|
|
201
|
+
{@render children()}
|
|
202
|
+
<!-- Keep your consent UI and preferences link here. -->
|
|
203
|
+
</ConsentRoot>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Import vendor helpers in the layout component, not in `+layout.server.ts`:
|
|
207
|
+
a server load cannot send functions to the browser. Prerendered, static and
|
|
208
|
+
SPA-mode pages use the same `scripts` prop. If you pass an externally owned
|
|
209
|
+
`runtime` to the provider, register scripts when creating that runtime instead.
|
|
210
|
+
|
|
211
|
+
**HTML**
|
|
212
|
+
|
|
213
|
+
The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
|
|
214
|
+
page that loads the c15t script tag, paste the vendor's own snippet instead
|
|
215
|
+
and keep it inert until its category is allowed:
|
|
216
|
+
|
|
217
|
+
```html
|
|
218
|
+
<script type="text/plain" data-c15t-category="measurement">
|
|
219
|
+
// The vendor's snippet, unchanged
|
|
220
|
+
</script>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Use the category this guide names for the vendor. c15t runs the snippet
|
|
224
|
+
once that category is allowed, and reloads the page when the visitor
|
|
225
|
+
withdraws it. Helper options on this page, such as `loadMode`, do not apply
|
|
226
|
+
to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
|
|
227
|
+
|
|
228
|
+
**JavaScript**
|
|
229
|
+
|
|
230
|
+
Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
import { init, manifest } from '@c15t/browser';
|
|
234
|
+
import { scripts } from './consent-scripts';
|
|
235
|
+
|
|
236
|
+
const consent = init({
|
|
237
|
+
mode: manifest(),
|
|
238
|
+
scripts,
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Keep the mode from your quickstart. With
|
|
243
|
+
`createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
|
|
244
|
+
A kernel you create yourself needs a loader from
|
|
245
|
+
`c15t/modules/script-loader`. Attach one loader per kernel. See
|
|
246
|
+
[JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
|
|
247
|
+
|
|
248
|
+
## Options
|
|
249
|
+
|
|
250
|
+
| Option | Default | Behavior |
|
|
251
|
+
| ---------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
252
|
+
| `key` | Required | Public Messaging widget key. Trimmed and URL-encoded. If it's missing or blank, c15t logs `zendeskWidget: missing or invalid key` and never loads the widget. |
|
|
253
|
+
| `category` | `functionality` | c15t consent category or condition needed to load the widget. Measurement consent still controls analytics storage. |
|
|
254
|
+
|
|
255
|
+
## Loading and revocation
|
|
256
|
+
|
|
257
|
+
When the consent condition passes, the helper creates Zendesk's `zE` command
|
|
258
|
+
queue (also exposed as `zEmbed`) and loads
|
|
259
|
+
`https://static.zdassets.com/ekr/snippet.js?key=<key>`. Before the loader runs,
|
|
260
|
+
and again on each consent change, it queues
|
|
261
|
+
`zE('messenger:set', 'cookies', range)`:
|
|
262
|
+
|
|
263
|
+
| Mapped consent | Measurement consent | Zendesk range |
|
|
264
|
+
| -------------------- | ------------------- | ------------- |
|
|
265
|
+
| Granted | Granted | `all` |
|
|
266
|
+
| Granted | Denied | `functional` |
|
|
267
|
+
| Denied after loading | Either | `none` |
|
|
268
|
+
|
|
269
|
+
With `functional`, Zendesk turns off the analytics behind Pages viewed and
|
|
270
|
+
Proactive messages analytics. With `none`, Zendesk hides the widget and deletes
|
|
271
|
+
its local and session storage. These effects come from Zendesk's
|
|
272
|
+
[Set cookies API](https://developer.zendesk.com/api-reference/widget-messaging/web/core/#set-cookies).
|
|
273
|
+
Turning off the visitor's Zendesk vendor switch counts as denied, so it also
|
|
274
|
+
sends `none`.
|
|
275
|
+
|
|
276
|
+
c15t removes the loader on revocation. The `none` call doesn't unload the SDK or
|
|
277
|
+
stop every request in progress. Keep `reloadOnConsentRevoked` enabled to stop
|
|
278
|
+
code already running on the page. If the visitor grants consent again before
|
|
279
|
+
the reload, c15t inserts a new loader and the helper sends the current range.
|
|
280
|
+
|
|
281
|
+
### Several helpers and one widget key
|
|
282
|
+
|
|
283
|
+
Helper calls with the same key and consent condition share one script. If you
|
|
284
|
+
recreate the helper on each render, its loader and consent updates stay active.
|
|
285
|
+
If several registrations share that configuration, the widget stays available
|
|
286
|
+
while any of them has consent. `all` needs measurement consent from every
|
|
287
|
+
granted registration.
|
|
288
|
+
|
|
289
|
+
Use one widget key per page. Zendesk exposes a single global `zE` API, so two
|
|
290
|
+
widgets on the same page control each other. Different keys get separate
|
|
291
|
+
loaders, but that doesn't separate Zendesk's global API.
|
|
292
|
+
|
|
293
|
+
### Removing the helper
|
|
294
|
+
|
|
295
|
+
Removing the helper from your configuration, or unmounting its provider,
|
|
296
|
+
releases that registration. When the last registration goes, c15t removes the
|
|
297
|
+
loader but keeps the conversation and storage. It doesn't send `none` or unload
|
|
298
|
+
code that already ran, and later consent changes no longer reach the widget.
|
|
299
|
+
Revoke consent first, or reload the page, when you need the widget stopped and
|
|
300
|
+
its storage cleared.
|
|
301
|
+
|
|
302
|
+
## Cookies and storage
|
|
303
|
+
|
|
304
|
+
Zendesk's [in-product cookie policy](https://support.zendesk.com/hc/en-us/articles/4408824378650-Zendesk-In-Product-Cookie-Policy)
|
|
305
|
+
lists these entries for the Web Widget. Check your own widget configuration for
|
|
306
|
+
other product storage.
|
|
307
|
+
|
|
308
|
+
| Name | Zendesk category | Lifetime |
|
|
309
|
+
| ------------------------------------------------------------------------------------------ | ---------------- | --------------------------------------------------------- |
|
|
310
|
+
| `<integrationId>.appUserId`, `<integrationId>.clientId`, `<integrationId>.sessionToken` | Essential | Local or session storage, subject to the browser's policy |
|
|
311
|
+
| `ZD-suid` | Analytics | 20 minutes |
|
|
312
|
+
| `ZD-buid` | Analytics | Forever |
|
|
313
|
+
| `ZD-widgetOpen`, `ZD-launcherLabelRemoved` | Functionality | Forever |
|
|
314
|
+
| `ZD-soundNotificationDisabledKey`, `ZD-campaigns`, `<integrationId>.conversationStartedAt` | Functionality | Subject to the browser's policy |
|
|
315
|
+
|
|
316
|
+
## Verify Zendesk Messaging
|
|
317
|
+
|
|
318
|
+
Filter Network by `zdassets.com` and your Zendesk subdomain. Before consent,
|
|
319
|
+
no Zendesk loader request appears and `window.zE` is undefined, as long as you
|
|
320
|
+
removed other Zendesk installations.
|
|
321
|
+
|
|
322
|
+
Grant functionality without measurement and check that the widget's analytics
|
|
323
|
+
storage stays off. Grant measurement while the widget is open, then withdraw
|
|
324
|
+
it, and check that the widget stays available with analytics off.
|
|
325
|
+
|
|
326
|
+
Revoke functionality and check that Zendesk hides the widget. After c15t
|
|
327
|
+
reloads, the loader stays absent. A successful response for `snippet.js` alone
|
|
328
|
+
doesn't prove your widget key or Messaging setup works. Open a conversation in
|
|
329
|
+
your widget to check that.
|
|
330
|
+
|
|
331
|
+
Sources: [install and show the Web Widget](https://developer.zendesk.com/documentation/zendesk-web-widget-sdks/sdks/web/messaging-show-web-widget/),
|
|
332
|
+
[Messaging core API](https://developer.zendesk.com/api-reference/widget-messaging/web/core/),
|
|
333
|
+
and [Zendesk privacy notice](https://www.zendesk.com/company/agreements-and-terms/privacy-notice/).
|
|
334
|
+
|
|
335
|
+
Test in a private window with an opt-in policy. Open DevTools Network, disable
|
|
336
|
+
the cache and filter by the vendor's domain:
|
|
337
|
+
|
|
338
|
+
1. Load the page. No request goes to the vendor before you choose.
|
|
339
|
+
2. Click Reject, then reload. There is still no vendor request.
|
|
340
|
+
3. Open Privacy settings and allow the helper's category. The vendor script
|
|
341
|
+
loads without a page reload.
|
|
342
|
+
4. Turn the category off again and save. c15t reloads the page, and the new
|
|
343
|
+
page makes no vendor request.
|
|
344
|
+
|
|
345
|
+
c15t reloads on revocation because removing a script element does not stop
|
|
346
|
+
code that already ran. The vendor's listeners, timers and queued events stay
|
|
347
|
+
alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
|
|
348
|
+
the vendor yourself. Register a callback-only script whose `onConsentChange`
|
|
349
|
+
calls the vendor's opt-out API, as shown in
|
|
350
|
+
[custom integrations](./building-integrations.md), and check the
|
|
351
|
+
permission before each of your own event calls. The reload does not delete
|
|
352
|
+
cookies the vendor already set; see
|
|
353
|
+
[clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
|
|
354
|
+
|
|
355
|
+
The helper lists its vendor by name in the preference dialog, so a visitor can
|
|
356
|
+
turn it off inside an allowed category. See
|
|
357
|
+
[vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
|
|
358
|
+
[consent verification guide](../guides/verify-consent.md) covers navigation,
|
|
359
|
+
expiry and hosting checks.
|
package/package.json
CHANGED
|
@@ -1,41 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/react",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "React cookie consent banner
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"description": "React cookie consent banner and React consent dialog for c15t, plus a React cookie banner, preference center and headless hooks.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"banner",
|
|
7
|
-
"ccpa",
|
|
8
6
|
"cmp",
|
|
9
7
|
"consent",
|
|
10
|
-
"consent-banner",
|
|
11
|
-
"consent-management",
|
|
12
|
-
"consent-management-platform",
|
|
13
8
|
"consent-manager",
|
|
14
|
-
"consent-manager-react",
|
|
15
|
-
"consent-mode-v2",
|
|
16
|
-
"cookie",
|
|
17
9
|
"cookie-banner",
|
|
18
10
|
"cookie-consent",
|
|
19
11
|
"gdpr",
|
|
20
|
-
"global-privacy-control",
|
|
21
|
-
"google-consent-mode",
|
|
22
12
|
"headless",
|
|
23
|
-
"iab",
|
|
24
13
|
"iab-tcf",
|
|
25
|
-
"lgpd",
|
|
26
|
-
"preference-center",
|
|
27
|
-
"privacy",
|
|
28
14
|
"react",
|
|
29
|
-
"react-cmp",
|
|
30
|
-
"react-consent",
|
|
31
15
|
"react-cookie-banner",
|
|
32
|
-
"react-cookie-consent"
|
|
33
|
-
"react-server-components",
|
|
34
|
-
"rsc",
|
|
35
|
-
"tcf",
|
|
36
|
-
"tracking-consent",
|
|
37
|
-
"typescript",
|
|
38
|
-
"use-client"
|
|
16
|
+
"react-cookie-consent"
|
|
39
17
|
],
|
|
40
18
|
"homepage": "https://c15t.com/docs/frameworks/react/quickstart",
|
|
41
19
|
"bugs": {
|
|
@@ -269,16 +247,16 @@
|
|
|
269
247
|
"test:watch": "bun prebuild && vitest"
|
|
270
248
|
},
|
|
271
249
|
"dependencies": {
|
|
272
|
-
"@c15t/core": "3.
|
|
273
|
-
"@c15t/dev-tools": "3.
|
|
274
|
-
"@c15t/iab": "3.
|
|
275
|
-
"@c15t/schema": "3.1.
|
|
276
|
-
"@c15t/translations": "3.
|
|
277
|
-
"@c15t/ui": "3.0
|
|
250
|
+
"@c15t/core": "3.2.0",
|
|
251
|
+
"@c15t/dev-tools": "3.2.0",
|
|
252
|
+
"@c15t/iab": "3.2.0",
|
|
253
|
+
"@c15t/schema": "3.1.1",
|
|
254
|
+
"@c15t/translations": "3.2.0",
|
|
255
|
+
"@c15t/ui": "3.1.0",
|
|
278
256
|
"@types/google.maps": "3.65.3"
|
|
279
257
|
},
|
|
280
258
|
"devDependencies": {
|
|
281
|
-
"@c15t/backend": "3.
|
|
259
|
+
"@c15t/backend": "3.2.0",
|
|
282
260
|
"@c15t/conformance": "0.0.1",
|
|
283
261
|
"@c15t/typescript-config": "0.0.1",
|
|
284
262
|
"@c15t/vitest-config": "1.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let r=function(r,e){return 0===r.length&&1===e.length&&"dismiss"===e[0]?e:r};export{r as resolveBannerPrimaryActions};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Primary actions for the banner, with dismiss promoted on a bare notice.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* The resolver's default primary is `customize`, which a notice never
|
|
6
|
-
* offers, so a notice resolves with no primary action. When dismiss is the
|
|
7
|
-
* only control on the surface it is the primary one.
|
|
8
|
-
*
|
|
9
|
-
* @param primaryActions - Primary actions from the resolved presentation.
|
|
10
|
-
* @param orderedActions - Every action the surface renders, in order.
|
|
11
|
-
* @returns The primary actions the banner should style.
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare const resolveBannerPrimaryActions: <Action extends string>(primaryActions: readonly Action[], orderedActions: readonly Action[]) => readonly Action[];
|