@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,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.
|
|
@@ -166,7 +166,7 @@ pass them as a top-level prop:
|
|
|
166
166
|
|
|
167
167
|
```svelte title="src/App.svelte"
|
|
168
168
|
<script lang="ts">
|
|
169
|
-
import { ConsentProvider, manifest } from '
|
|
169
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
170
170
|
import { scripts } from './consent-scripts';
|
|
171
171
|
</script>
|
|
172
172
|
|
|
@@ -185,7 +185,7 @@ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs
|
|
|
185
185
|
|
|
186
186
|
```svelte title="src/routes/+layout.svelte"
|
|
187
187
|
<script lang="ts">
|
|
188
|
-
import { ConsentRoot } from '
|
|
188
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
189
189
|
import { scripts } from '../consent-scripts';
|
|
190
190
|
|
|
191
191
|
let { children, data } = $props();
|
|
@@ -164,7 +164,7 @@ pass them as a top-level prop:
|
|
|
164
164
|
|
|
165
165
|
```svelte title="src/App.svelte"
|
|
166
166
|
<script lang="ts">
|
|
167
|
-
import { ConsentProvider, manifest } from '
|
|
167
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
168
168
|
import { scripts } from './consent-scripts';
|
|
169
169
|
</script>
|
|
170
170
|
|
|
@@ -183,7 +183,7 @@ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs
|
|
|
183
183
|
|
|
184
184
|
```svelte title="src/routes/+layout.svelte"
|
|
185
185
|
<script lang="ts">
|
|
186
|
-
import { ConsentRoot } from '
|
|
186
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
187
187
|
import { scripts } from '../consent-scripts';
|
|
188
188
|
|
|
189
189
|
let { children, data } = $props();
|
|
@@ -10,16 +10,22 @@ icon: hotjar
|
|
|
10
10
|
group: integrations
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
consent.
|
|
15
|
-
|
|
16
|
-
c15t
|
|
17
|
-
|
|
13
|
+
Hotjar records what visitors do on your pages, so it should load only when
|
|
14
|
+
consent allows analytics. The c15t `hotjar` helper waits until the
|
|
15
|
+
`measurement` category is allowed before it adds the Hotjar loader. Until then,
|
|
16
|
+
c15t doesn't define `window._hjSettings` or `window.hj`, and it loads nothing
|
|
17
|
+
from Hotjar. Under an opt-in policy, that wait lasts until the visitor allows
|
|
18
|
+
analytics.
|
|
19
|
+
|
|
20
|
+
Withdrawal needs more care. c15t sends Hotjar no consent signal, so it can't
|
|
21
|
+
tell a running recording to stop. By default it reloads the page instead, and
|
|
22
|
+
the reload ends the recording.
|
|
18
23
|
|
|
19
24
|
## Configure Hotjar
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
Find your site ID in the Hotjar tracking code. It's the `hjid` value. Then
|
|
27
|
+
delete the tracking code from your app. c15t doesn't control that snippet, so
|
|
28
|
+
if it stays, Hotjar loads and records even after the visitor rejects analytics.
|
|
23
29
|
|
|
24
30
|
| Package manager | Command |
|
|
25
31
|
| :-------------- | :------------------------------- |
|
|
@@ -165,7 +171,7 @@ pass them as a top-level prop:
|
|
|
165
171
|
|
|
166
172
|
```svelte title="src/App.svelte"
|
|
167
173
|
<script lang="ts">
|
|
168
|
-
import { ConsentProvider, manifest } from '
|
|
174
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
169
175
|
import { scripts } from './consent-scripts';
|
|
170
176
|
</script>
|
|
171
177
|
|
|
@@ -184,7 +190,7 @@ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs
|
|
|
184
190
|
|
|
185
191
|
```svelte title="src/routes/+layout.svelte"
|
|
186
192
|
<script lang="ts">
|
|
187
|
-
import { ConsentRoot } from '
|
|
193
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
188
194
|
import { scripts } from '../consent-scripts';
|
|
189
195
|
|
|
190
196
|
let { children, data } = $props();
|
|
@@ -240,30 +246,38 @@ A kernel you create yourself needs a loader from
|
|
|
240
246
|
|
|
241
247
|
## Options
|
|
242
248
|
|
|
243
|
-
| Option | Default | Behavior
|
|
244
|
-
| ----------- | ------------------------------------------------------------- |
|
|
245
|
-
| `siteId` | Required | Site ID as a number or string. Set as `window._hjSettings.hjid` and used in the default loader URL.
|
|
246
|
-
| `version` | `6` | Script version, set as `window._hjSettings.hjsv` and the `sv` query parameter of the default loader URL.
|
|
247
|
-
| `scriptUrl` | `https://static.hotjar.com/c/hotjar-<siteId>.js?sv=<version>` | Loader URL override.
|
|
249
|
+
| Option | Default | Behavior |
|
|
250
|
+
| ----------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
251
|
+
| `siteId` | Required | Site ID as a number or string. Set as `window._hjSettings.hjid` and used in the default loader URL. If it's missing, empty or `0`, c15t logs an error and never loads Hotjar. |
|
|
252
|
+
| `version` | `6` | Script version, set as `window._hjSettings.hjsv` and the `sv` query parameter of the default loader URL. |
|
|
253
|
+
| `scriptUrl` | `https://static.hotjar.com/c/hotjar-<siteId>.js?sv=<version>` | Loader URL override. |
|
|
248
254
|
|
|
249
255
|
## Loading and revocation
|
|
250
256
|
|
|
251
|
-
`hotjar` uses the `measurement` category. When measurement
|
|
252
|
-
|
|
253
|
-
|
|
257
|
+
`hotjar` uses the `measurement` category. When `measurement` is allowed, the
|
|
258
|
+
helper sets `window._hjSettings` and a `window.hj` stub that queues calls, then
|
|
259
|
+
loads the Hotjar script. If your page already defines either global, the helper
|
|
260
|
+
leaves it alone.
|
|
254
261
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
262
|
+
When the visitor withdraws, the helper removes the script element. Hotjar is
|
|
263
|
+
already running by then, so removing the element doesn't stop it. The default
|
|
264
|
+
page reload does. If you set `reloadOnConsentRevoked: false`, Hotjar keeps
|
|
265
|
+
recording until the visitor leaves the page.
|
|
258
266
|
|
|
259
267
|
## Verify Hotjar
|
|
260
268
|
|
|
261
|
-
Filter DevTools Network by `hotjar`. After you allow measurement,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
269
|
+
Filter the DevTools Network panel by `hotjar`. After you allow measurement,
|
|
270
|
+
the loader appears and `window._hjSettings.hjid` holds your site ID. If it
|
|
271
|
+
holds a different ID, other code on the page set `_hjSettings` before c15t, and
|
|
272
|
+
the helper left it alone. Find and remove that code. By default
|
|
273
|
+
the loader is `hotjar-<siteId>.js` from `static.hotjar.com`. If you set
|
|
274
|
+
`scriptUrl`, look for that URL instead.
|
|
275
|
+
|
|
276
|
+
Then watch one recording of a real screen in your app. Hotjar decides what to
|
|
277
|
+
mask, not c15t, so check that it hides the fields you expect.
|
|
278
|
+
|
|
279
|
+
`window.hj` stays defined after withdrawal. If your own code calls `hj()`,
|
|
280
|
+
check the measurement permission first.
|
|
267
281
|
|
|
268
282
|
Test in a private window with an opt-in policy. Open DevTools Network, disable
|
|
269
283
|
the cache and filter by the vendor's domain:
|