@c15t/react 3.2.0-canary.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/AGENTS.md +33 -10
  2. package/README.md +5 -7
  3. package/dist/styles.tw3.css +2 -2
  4. package/dist/version.js +1 -1
  5. package/dist-types/version.d.ts +1 -1
  6. package/docs/README.md +33 -10
  7. package/docs/concepts/choose-your-setup.md +8 -9
  8. package/docs/concepts/modes.md +5 -3
  9. package/docs/customization/stylesheets.md +39 -0
  10. package/docs/frameworks/react/hooks.md +2 -1
  11. package/docs/frameworks/react/quickstart.md +3 -3
  12. package/docs/frameworks/react/upgrade-v3.md +2 -2
  13. package/docs/integrations/activecampaign.md +297 -0
  14. package/docs/integrations/ada.md +396 -0
  15. package/docs/integrations/adobe-target.md +460 -0
  16. package/docs/integrations/adroll.md +336 -0
  17. package/docs/integrations/amazon-ads.md +424 -0
  18. package/docs/integrations/appcues.md +368 -0
  19. package/docs/integrations/attentive.md +313 -0
  20. package/docs/integrations/building-integrations.md +29 -16
  21. package/docs/integrations/clearbit.md +1 -1
  22. package/docs/integrations/customer-io.md +369 -0
  23. package/docs/integrations/databuddy.md +139 -50
  24. package/docs/integrations/default-com.md +497 -0
  25. package/docs/integrations/dynamic-yield.md +373 -0
  26. package/docs/integrations/fullstory.md +298 -0
  27. package/docs/integrations/gainsight-px.md +418 -0
  28. package/docs/integrations/gorgias.md +365 -0
  29. package/docs/integrations/hubspot.md +529 -0
  30. package/docs/integrations/insider.md +550 -0
  31. package/docs/integrations/liveintent.md +327 -0
  32. package/docs/integrations/lucky-orange.md +336 -0
  33. package/docs/integrations/marketo.md +309 -0
  34. package/docs/integrations/optimizely.md +411 -0
  35. package/docs/integrations/oracle-eloqua.md +301 -0
  36. package/docs/integrations/overview.md +124 -111
  37. package/docs/integrations/pendo.md +339 -0
  38. package/docs/integrations/rb2b.md +363 -0
  39. package/docs/integrations/salesforce-pardot.md +342 -0
  40. package/docs/integrations/statable-analytics.md +345 -0
  41. package/docs/integrations/the-trade-desk.md +328 -0
  42. package/docs/integrations/vector.md +333 -0
  43. package/docs/integrations/wisepops.md +416 -0
  44. package/docs/integrations/zendesk.md +359 -0
  45. package/package.json +8 -8
  46. package/docs/integrations/other-ads-and-pixels.md +0 -94
  47. package/docs/integrations/other-analytics.md +0 -108
  48. package/docs/integrations/other-chat-and-support.md +0 -112
  49. package/docs/integrations/other-email-and-sms.md +0 -156
  50. package/docs/integrations/other-experience.md +0 -222
@@ -0,0 +1,365 @@
1
+ ---
2
+ title: Gorgias Chat
3
+ description: Load Gorgias Chat after functionality consent, disable its Segment
4
+ analytics when measurement is denied, and verify loading and revocation with
5
+ c15t.
6
+ seoTitle: Gorgias Chat cookie consent with c15t
7
+ seoDescription: Load Gorgias Chat with functionality consent. Disable Segment
8
+ tracking when measurement is denied and use a page reload to stop the running
9
+ widget.
10
+ icon: messages-square
11
+ group: integrations
12
+ ---
13
+
14
+ Gorgias Chat adds the Gorgias support chat widget to your store or site. The
15
+ c15t `gorgiasChat` helper waits for `functionality` consent before it adds the
16
+ Gorgias loader. When the widget is ready, the helper turns off its Segment
17
+ analytics unless `measurement` is also allowed.
18
+
19
+ Gorgias has no shutdown API, so the helper can't stop a running widget. By
20
+ default c15t reloads the page on withdrawal, and the reload stops it.
21
+
22
+ ## Configure Gorgias Chat
23
+
24
+ Copy the public app key from the v3 installation snippet in your Gorgias Chat
25
+ settings. The key is the last part of
26
+ `https://config.gorgias.chat/bundle-loader/YOUR_APP_KEY`. A v2 snippet uses an
27
+ `applicationId` instead. Pass that value as `appKey` with `version: 2`.
28
+
29
+ Remove any existing Gorgias snippet or automatic installation from your theme,
30
+ tag manager or store app. An installation outside c15t can load Gorgias before
31
+ consent, and the Gorgias loader skips duplicate installations.
32
+
33
+ | Package manager | Command |
34
+ | :-------------- | :------------------------------- |
35
+ | npm | `npm install @c15t/integrations` |
36
+ | pnpm | `pnpm add @c15t/integrations` |
37
+ | yarn | `yarn add @c15t/integrations` |
38
+ | bun | `bun add @c15t/integrations` |
39
+
40
+ ```ts title="src/consent-scripts.ts"
41
+ import { gorgiasChat } from '@c15t/integrations/gorgias';
42
+
43
+ export const scripts = [gorgiasChat({ appKey: 'YOUR_GORGIAS_APP_KEY' })];
44
+ ```
45
+
46
+ ## Register the scripts
47
+
48
+ Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
49
+ endpoint, policy, styles and consent UI. Remove the vendor's original script,
50
+ SDK initializer or tag-manager entry, so the vendor loads only through c15t.
51
+
52
+ The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
53
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
54
+ in the Next.js guide, add the helper to that array instead of creating a
55
+ second file.
56
+ The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
57
+ point for your framework below. These are edits to that provider, not a second
58
+ provider.
59
+
60
+ **Next.js**
61
+
62
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
63
+ `next.config.ts`:
64
+
65
+ ```ts title="c15t.config.ts"
66
+ import { defineConsentConfig } from 'c15t/next';
67
+ import { scripts } from './src/consent-scripts';
68
+
69
+ export default defineConsentConfig({ scripts });
70
+ ```
71
+
72
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
73
+ same call. `ConsentRoot` reads the config in the browser, so the layout
74
+ keeps passing only `state`. App Router, Pages Router and static export all
75
+ read the same file. See
76
+ [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
77
+
78
+ **TanStack Start**
79
+
80
+ Import the configuration into your root route and pass it to the existing
81
+ `ConsentRoot` as a top-level prop. Keep the loader from the
82
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
83
+
84
+ ```tsx title="src/routes/__root.tsx"
85
+ import { scripts } from '../consent-scripts';
86
+
87
+ <ConsentRoot state={consent} scripts={scripts}>
88
+ ```
89
+
90
+ Import vendor helpers in the root route module, not in a server function.
91
+ A server function's return value must be serializable, and script
92
+ configurations carry callbacks. See
93
+ [TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
94
+
95
+ **React**
96
+
97
+ Add the configuration to the existing `ConsentProvider` options, next to
98
+ `mode`:
99
+
100
+ ```tsx title="src/consent.tsx"
101
+ import { scripts } from './consent-scripts';
102
+
103
+ <ConsentProvider options={{ mode, scripts }}>
104
+ ```
105
+
106
+ `mode` is the `manifest()` value from the
107
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
108
+ dialog and preferences link inside the provider. See
109
+ [React scripts and embeds](../frameworks/react/scripts.md).
110
+
111
+ **Nuxt**
112
+
113
+ Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
114
+ relative import to where you created `consent-scripts.ts`:
115
+
116
+ ```ts title="app/app.config.ts"
117
+ import { scripts } from '../src/consent-scripts';
118
+
119
+ export default defineAppConfig({
120
+ c15t: { scripts },
121
+ });
122
+ ```
123
+
124
+ The Nuxt module merges this over its options in `nuxt.config.ts` and starts
125
+ one script loader in the browser after hydration, once it has applied the
126
+ visitor's stored choice and privacy signals. Keep `scripts` out of
127
+ `nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
128
+ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
129
+ [Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
130
+
131
+ **Vue**
132
+
133
+ Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
134
+
135
+ ```ts title="src/main.ts"
136
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
137
+ import { scripts } from './consent-scripts';
138
+
139
+ app.use(c15tVue, {
140
+ mode: manifest(),
141
+ scripts,
142
+ });
143
+ ```
144
+
145
+ Keep your existing `mode` and other options. The plugin starts one
146
+ script loader when the app mounts, after it has applied the visitor's stored
147
+ choice. Do not also call `createScriptLoader` from a component. See
148
+ [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
149
+
150
+ **Astro**
151
+
152
+ Add the scripts to the client entrypoint from the
153
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
154
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
155
+ If the module already exports scripts, combine the two arrays.
156
+
157
+ ```ts title="src/c15t.client.ts"
158
+ import type { C15tClientOptionsExtension } from 'c15t/astro';
159
+ import { scripts } from './consent-scripts';
160
+
161
+ export default { scripts } satisfies C15tClientOptionsExtension;
162
+ ```
163
+
164
+ Vendor helpers contain callbacks, and the integration options in
165
+ `astro.config.mjs` are serialized into the page, so do not put helpers in
166
+ the integration's `scripts` option. The integration passes the client
167
+ entrypoint to the one runtime every page shares, including across
168
+ `ClientRouter` navigation.
169
+
170
+ **Svelte**
171
+
172
+ Import the scripts in the component that owns your existing provider and
173
+ pass them as a top-level prop:
174
+
175
+ ```svelte title="src/App.svelte"
176
+ <script lang="ts">
177
+ import { ConsentProvider, manifest } from 'c15t/svelte';
178
+ import { scripts } from './consent-scripts';
179
+ </script>
180
+
181
+ <ConsentProvider mode={manifest()} {scripts}>
182
+ <!-- Keep your application, consent UI and preferences link here. -->
183
+ </ConsentProvider>
184
+ ```
185
+
186
+ Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
187
+ The provider owns the loader and disposes it on unmount.
188
+
189
+ **SvelteKit**
190
+
191
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
192
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
193
+
194
+ ```svelte title="src/routes/+layout.svelte"
195
+ <script lang="ts">
196
+ import { ConsentRoot } from 'c15t/svelte';
197
+ import { scripts } from '../consent-scripts';
198
+
199
+ let { children, data } = $props();
200
+ </script>
201
+
202
+ <ConsentRoot state={data.consent} {scripts}>
203
+ {@render children()}
204
+ <!-- Keep your consent UI and preferences link here. -->
205
+ </ConsentRoot>
206
+ ```
207
+
208
+ Import vendor helpers in the layout component, not in `+layout.server.ts`:
209
+ a server load cannot send functions to the browser. Prerendered, static and
210
+ SPA-mode pages use the same `scripts` prop. If you pass an externally owned
211
+ `runtime` to the provider, register scripts when creating that runtime instead.
212
+
213
+ **HTML**
214
+
215
+ The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
216
+ page that loads the c15t script tag, paste the vendor's own snippet instead
217
+ and keep it inert until its category is allowed:
218
+
219
+ ```html
220
+ <script type="text/plain" data-c15t-category="measurement">
221
+ // The vendor's snippet, unchanged
222
+ </script>
223
+ ```
224
+
225
+ Use the category this guide names for the vendor. c15t runs the snippet
226
+ once that category is allowed, and reloads the page when the visitor
227
+ withdraws it. Helper options on this page, such as `loadMode`, do not apply
228
+ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
229
+
230
+ **JavaScript**
231
+
232
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
233
+
234
+ ```ts
235
+ import { init, manifest } from '@c15t/browser';
236
+ import { scripts } from './consent-scripts';
237
+
238
+ const consent = init({
239
+ mode: manifest(),
240
+ scripts,
241
+ });
242
+ ```
243
+
244
+ Keep the mode from your quickstart. With
245
+ `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
246
+ A kernel you create yourself needs a loader from
247
+ `c15t/modules/script-loader`. Attach one loader per kernel. See
248
+ [JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
249
+
250
+ ## Options
251
+
252
+ | Option | Default | Behavior |
253
+ | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
+ | `appKey` | Required | Public v3 app key from the installation snippet, or the v2 `applicationId` with `version: 2`. Trimmed and URL-encoded. If it's missing or blank, c15t logs `gorgiasChat: missing or invalid appKey` and never loads Gorgias. |
255
+ | `version` | `3` | Installation snippet version, `2` or `3`. Version 3 loads `https://config.gorgias.chat/bundle-loader/<appKey>`. Version 2 loads `https://config.gorgias.chat/gorgias-chat-bundle-loader.js?applicationId=<appKey>`. |
256
+
257
+ ## Loading and revocation
258
+
259
+ Until its consent gate allows Gorgias, the helper adds no vendor script,
260
+ creates no vendor global and writes no vendor cookies or storage. The default
261
+ category is `functionality`. If you map the script to another category, that
262
+ category and the visitor's Gorgias vendor switch control the loader.
263
+
264
+ After consent, c15t appends the loader to `<body>`. Gorgias then starts the
265
+ widget asynchronously. The helper listens for `gorgias-widget-loaded` before
266
+ it appends the loader. If `window.GorgiasChat` exists when the loader finishes,
267
+ it also waits for `GorgiasChat.init()` to resolve, whichever comes first. When
268
+ the widget is ready, the helper reads the current measurement choice, not the
269
+ one from when the loader started.
270
+
271
+ Revocation, disposal or a loader error cancels the helper's pending readiness
272
+ work. It can't cancel Gorgias's own startup once the loader has run. If
273
+ `GorgiasChat.init()` rejects while consent still allows Gorgias, the helper
274
+ logs `gorgiasChat: chat initialization failed.` and stops waiting.
275
+
276
+ On revocation, c15t removes the loader. If the widget is already ready, the
277
+ helper also calls `disableSegment()`, even when measurement is still allowed.
278
+ Gorgias's `close()` and `hideChat(true)` methods only change the widget's
279
+ visibility. They don't stop its requests or clear its session, and Gorgias
280
+ documents no full shutdown API. Keep `reloadOnConsentRevoked` enabled.
281
+
282
+ ## Measurement consent and Segment
283
+
284
+ When the widget becomes ready without measurement consent, the helper calls
285
+ `GorgiasChat.disableSegment()` right away. It also calls it if the
286
+ visitor withdraws measurement while the widget stays allowed. This follows
287
+ Gorgias's
288
+ [documented analytics customization](https://docs.gorgias.com/en-US/html-snippets-for-chat-customization-460197).
289
+
290
+ Gorgias has no call to turn Segment back on. Once it's off, it stays off for
291
+ that page, even if the visitor then allows measurement. After a reload with
292
+ measurement allowed, the new widget uses its default analytics.
293
+
294
+ `disableSegment()` only works after the widget starts. It doesn't prove that
295
+ the widget sent no analytics request before its ready event. Check the requests
296
+ your own widget and account settings produce.
297
+
298
+ ## Cookies and storage
299
+
300
+ The Gorgias help pages don't list the widget's cookie names, storage keys or
301
+ lifetimes in full. A Chromium probe of the public Gorgias help-center
302
+ installation found the `_dd_s` cookie and these localStorage keys after
303
+ functionality consent: `gorgias.ai-agent-state`, `gorgias.version`,
304
+ `gorgias.storage-updated-at` and `gorgias.language-loaded`. They remained
305
+ after revocation. Account API and collection requests were blocked, so this is
306
+ a partial list, not a verified chat session. Names and lifetimes can change by
307
+ version and account.
308
+
309
+ A reload stops the running widget but doesn't delete cookies or storage that
310
+ Gorgias already created. Record the widget's storage after you grant consent
311
+ and again after you start a conversation, then add your own cleanup rules where
312
+ you need them. Gorgias's
313
+ [chat privacy disclosure](https://docs.gorgias.com/en-US/chat-add-a-privacy-disclosure-361578)
314
+ can describe how you handle chat data. It doesn't replace the consent gate.
315
+
316
+ ## Verify Gorgias Chat
317
+
318
+ Use your own app key in a private window with an opt-in policy. In DevTools,
319
+ filter Network by `gorgias` and check Application for cookies, localStorage
320
+ and sessionStorage.
321
+
322
+ 1. Before a choice, and after you reject functionality and reload, no Gorgias
323
+ script or request appears.
324
+ 2. Grant functionality. The loader requests your app key, and the widget
325
+ appears for an active Gorgias installation.
326
+ 3. Leave measurement denied and check the widget's Segment requests.
327
+ `disableSegment()` runs after the widget is ready, so check the first load
328
+ as well as later interactions.
329
+ 4. Revoke functionality. The page reloads, and the new page makes no Gorgias
330
+ request. Check stored data separately, because the reload doesn't remove it.
331
+
332
+ A placeholder or deleted app key still returns HTTP 200, with only a warning
333
+ that the installation is incorrect or deleted. That response doesn't prove the
334
+ widget works. Check that the widget appears.
335
+
336
+ Sources: [customize the chat widget with HTML and JavaScript](https://docs.gorgias.com/en-US/customize-the-chat-widget-with-HTML-and-JavaScript-286032),
337
+ [HTML snippets for chat customization](https://docs.gorgias.com/en-US/html-snippets-for-chat-customization-460197),
338
+ [add a privacy disclosure](https://docs.gorgias.com/en-US/chat-add-a-privacy-disclosure-361578),
339
+ and [Gorgias privacy notice](https://www.gorgias.com/legal/privacy).
340
+
341
+ Test in a private window with an opt-in policy. Open DevTools Network, disable
342
+ the cache and filter by the vendor's domain:
343
+
344
+ 1. Load the page. No request goes to the vendor before you choose.
345
+ 2. Click Reject, then reload. There is still no vendor request.
346
+ 3. Open Privacy settings and allow the helper's category. The vendor script
347
+ loads without a page reload.
348
+ 4. Turn the category off again and save. c15t reloads the page, and the new
349
+ page makes no vendor request.
350
+
351
+ c15t reloads on revocation because removing a script element does not stop
352
+ code that already ran. The vendor's listeners, timers and queued events stay
353
+ alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
354
+ the vendor yourself. Register a callback-only script whose `onConsentChange`
355
+ calls the vendor's opt-out API, as shown in
356
+ [custom integrations](./building-integrations.md), and check the
357
+ permission before each of your own event calls. The reload does not delete
358
+ cookies the vendor already set; see
359
+ [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
360
+
361
+ The helper lists its vendor by name in the preference dialog, so a visitor can
362
+ turn it off inside an allowed category. See
363
+ [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
364
+ [consent verification guide](../guides/verify-consent.md) covers navigation,
365
+ expiry and hosting checks.