@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
@@ -21,11 +21,11 @@ visitor's location from the request, so regional policies need no extra setup.
21
21
  [rendering](./rendering.md#react-router-remix-and-other-server-rendered-apps)
22
22
  for what that means for the first paint.
23
23
 
24
- You need an [Inth](https://inth.com) project. In the project, set the policy
24
+ You need an [Inth project](https://inth.com/dashboard/sign-up?framework=react). In the project, set the policy
25
25
  rules for your regions, add your site's origin to the trusted origins, and copy
26
26
  the backend URL.
27
- [Choose your setup](../../concepts/choose-your-setup.md#decide-who-runs-the-consent-backend)
28
- covers self-hosting and local mode.
27
+ [Choose your setup](../../concepts/choose-your-setup.md#set-up-the-consent-backend)
28
+ covers local mode for development and tests.
29
29
 
30
30
  The guide uses `hosted()` mode. Policy, translation and vendor edits in your
31
31
  project reach visitors on their next page load, without a rebuild.
@@ -34,7 +34,7 @@ When you finish, list the files you changed, anything you could not migrate, and
34
34
  client can't read a v2 backend. See
35
35
  [Upgrade a self-hosted backend](https://c15t.com/docs/self-host/upgrade-v3).
36
36
  Inth-hosted backends need no change.
37
- * Install the [Inth CLI](https://c15t.com/docs/cli/overview#install-the-inth-cli). The
37
+ * Install the [Inth CLI](https://inth.com/docs/cli/getting-started). The
38
38
  codemods run through `inth c15t codemods`.
39
39
 
40
40
  ## Replace the packages
@@ -632,7 +632,7 @@ React removes nothing besides the modes above. Import `manifest()` from
632
632
  ## Update the CLI
633
633
 
634
634
  * Setup moved to the Inth CLI.
635
- [Install the Inth CLI](https://c15t.com/docs/cli/overview#install-the-inth-cli), then run
635
+ [Install the Inth CLI](https://inth.com/docs/cli/getting-started), then run
636
636
  `inth c15t` in place of `c15t setup` and `inth c15t codemods` in place of
637
637
  `c15t codemods`.
638
638
  * Sign in with `inth login`. Sessions saved by the v2 CLI aren't read.
@@ -0,0 +1,297 @@
1
+ ---
2
+ title: ActiveCampaign
3
+ description: Load ActiveCampaign after marketing consent, configure its tracking
4
+ settings, and verify loading and withdrawal with c15t.
5
+ seoTitle: ActiveCampaign cookie consent with c15t
6
+ seoDescription: Gate ActiveCampaign on marketing consent with c15t. Configure
7
+ the loader, understand withdrawal limits, and verify vendor requests and
8
+ storage.
9
+ icon: chart-line
10
+ group: integrations
11
+ ---
12
+
13
+ `activeCampaignTracking` waits for `marketing` consent before creating vendor globals or downloading ActiveCampaign.
14
+
15
+ ## Configure ActiveCampaign
16
+
17
+ Copy the account ID from your ActiveCampaign site tracking snippet and remove the original snippet. Enable site tracking and authorize your site in ActiveCampaign.
18
+
19
+ | Package manager | Command |
20
+ | :-------------- | :------------------------------- |
21
+ | npm | `npm install @c15t/integrations` |
22
+ | pnpm | `pnpm add @c15t/integrations` |
23
+ | yarn | `yarn add @c15t/integrations` |
24
+ | bun | `bun add @c15t/integrations` |
25
+
26
+ ```ts title="src/consent-scripts.ts"
27
+ import { activeCampaignTracking } from '@c15t/integrations/activecampaign';
28
+
29
+ export const scripts = [
30
+ activeCampaignTracking({ accountId: 'YOUR_ACCOUNT_ID' }),
31
+ ];
32
+ ```
33
+
34
+ ## Register the scripts
35
+
36
+ Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
37
+ endpoint, policy, styles and consent UI. Remove the vendor's original script,
38
+ SDK initializer or tag-manager entry, so the vendor loads only through c15t.
39
+
40
+ The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
41
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
42
+ in the Next.js guide, add the helper to that array instead of creating a
43
+ second file.
44
+ The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
45
+ point for your framework below. These are edits to that provider, not a second
46
+ provider.
47
+
48
+ **Next.js**
49
+
50
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
51
+ `next.config.ts`:
52
+
53
+ ```ts title="c15t.config.ts"
54
+ import { defineConsentConfig } from 'c15t/next';
55
+ import { scripts } from './src/consent-scripts';
56
+
57
+ export default defineConsentConfig({ scripts });
58
+ ```
59
+
60
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
61
+ same call. `ConsentRoot` reads the config in the browser, so the layout
62
+ keeps passing only `state`. App Router, Pages Router and static export all
63
+ read the same file. See
64
+ [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
65
+
66
+ **TanStack Start**
67
+
68
+ Import the configuration into your root route and pass it to the existing
69
+ `ConsentRoot` as a top-level prop. Keep the loader from the
70
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
71
+
72
+ ```tsx title="src/routes/__root.tsx"
73
+ import { scripts } from '../consent-scripts';
74
+
75
+ <ConsentRoot state={consent} scripts={scripts}>
76
+ ```
77
+
78
+ Import vendor helpers in the root route module, not in a server function.
79
+ A server function's return value must be serializable, and script
80
+ configurations carry callbacks. See
81
+ [TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
82
+
83
+ **React**
84
+
85
+ Add the configuration to the existing `ConsentProvider` options, next to
86
+ `mode`:
87
+
88
+ ```tsx title="src/consent.tsx"
89
+ import { scripts } from './consent-scripts';
90
+
91
+ <ConsentProvider options={{ mode, scripts }}>
92
+ ```
93
+
94
+ `mode` is the `manifest()` value from the
95
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
96
+ dialog and preferences link inside the provider. See
97
+ [React scripts and embeds](../frameworks/react/scripts.md).
98
+
99
+ **Nuxt**
100
+
101
+ Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
102
+ relative import to where you created `consent-scripts.ts`:
103
+
104
+ ```ts title="app/app.config.ts"
105
+ import { scripts } from '../src/consent-scripts';
106
+
107
+ export default defineAppConfig({
108
+ c15t: { scripts },
109
+ });
110
+ ```
111
+
112
+ The Nuxt module merges this over its options in `nuxt.config.ts` and starts
113
+ one script loader in the browser after hydration, once it has applied the
114
+ visitor's stored choice and privacy signals. Keep `scripts` out of
115
+ `nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
116
+ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
117
+ [Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
118
+
119
+ **Vue**
120
+
121
+ Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
122
+
123
+ ```ts title="src/main.ts"
124
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
125
+ import { scripts } from './consent-scripts';
126
+
127
+ app.use(c15tVue, {
128
+ mode: manifest(),
129
+ scripts,
130
+ });
131
+ ```
132
+
133
+ Keep your existing `mode` and other options. The plugin starts one
134
+ script loader when the app mounts, after it has applied the visitor's stored
135
+ choice. Do not also call `createScriptLoader` from a component. See
136
+ [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
137
+
138
+ **Astro**
139
+
140
+ Add the scripts to the client entrypoint from the
141
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
142
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
143
+ If the module already exports scripts, combine the two arrays.
144
+
145
+ ```ts title="src/c15t.client.ts"
146
+ import type { C15tClientOptionsExtension } from 'c15t/astro';
147
+ import { scripts } from './consent-scripts';
148
+
149
+ export default { scripts } satisfies C15tClientOptionsExtension;
150
+ ```
151
+
152
+ Vendor helpers contain callbacks, and the integration options in
153
+ `astro.config.mjs` are serialized into the page, so do not put helpers in
154
+ the integration's `scripts` option. The integration passes the client
155
+ entrypoint to the one runtime every page shares, including across
156
+ `ClientRouter` navigation.
157
+
158
+ **Svelte**
159
+
160
+ Import the scripts in the component that owns your existing provider and
161
+ pass them as a top-level prop:
162
+
163
+ ```svelte title="src/App.svelte"
164
+ <script lang="ts">
165
+ import { ConsentProvider, manifest } from 'c15t/svelte';
166
+ import { scripts } from './consent-scripts';
167
+ </script>
168
+
169
+ <ConsentProvider mode={manifest()} {scripts}>
170
+ <!-- Keep your application, consent UI and preferences link here. -->
171
+ </ConsentProvider>
172
+ ```
173
+
174
+ Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
175
+ The provider owns the loader and disposes it on unmount.
176
+
177
+ **SvelteKit**
178
+
179
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
180
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
181
+
182
+ ```svelte title="src/routes/+layout.svelte"
183
+ <script lang="ts">
184
+ import { ConsentRoot } from 'c15t/svelte';
185
+ import { scripts } from '../consent-scripts';
186
+
187
+ let { children, data } = $props();
188
+ </script>
189
+
190
+ <ConsentRoot state={data.consent} {scripts}>
191
+ {@render children()}
192
+ <!-- Keep your consent UI and preferences link here. -->
193
+ </ConsentRoot>
194
+ ```
195
+
196
+ Import vendor helpers in the layout component, not in `+layout.server.ts`:
197
+ a server load cannot send functions to the browser. Prerendered, static and
198
+ SPA-mode pages use the same `scripts` prop. If you pass an externally owned
199
+ `runtime` to the provider, register scripts when creating that runtime instead.
200
+
201
+ **HTML**
202
+
203
+ The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
204
+ page that loads the c15t script tag, paste the vendor's own snippet instead
205
+ and keep it inert until its category is allowed:
206
+
207
+ ```html
208
+ <script type="text/plain" data-c15t-category="measurement">
209
+ // The vendor's snippet, unchanged
210
+ </script>
211
+ ```
212
+
213
+ Use the category this guide names for the vendor. c15t runs the snippet
214
+ once that category is allowed, and reloads the page when the visitor
215
+ withdraws it. Helper options on this page, such as `loadMode`, do not apply
216
+ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
217
+
218
+ **JavaScript**
219
+
220
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
221
+
222
+ ```ts
223
+ import { init, manifest } from '@c15t/browser';
224
+ import { scripts } from './consent-scripts';
225
+
226
+ const consent = init({
227
+ mode: manifest(),
228
+ scripts,
229
+ });
230
+ ```
231
+
232
+ Keep the mode from your quickstart. With
233
+ `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
234
+ A kernel you create yourself needs a loader from
235
+ `c15t/modules/script-loader`. Attach one loader per kernel. See
236
+ [JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
237
+
238
+ ## Options
239
+
240
+ | Option | Default | Behavior |
241
+ | ----------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
242
+ | `accountId` | Required | ActiveCampaign account ID. Fixed once loading starts on this page. |
243
+ | `email` | Unset | Email for future requests, updated through `setEmail` after consent. Removing or blanking it clears the runtime's email field. |
244
+ | `category` | `marketing` | Consent condition for the whole loader. |
245
+ | `scriptUrl` | `https://diffuser-cdn.app-us1.com/diffuser/diffuser.js` | Regional or proxied loader URL. Blank values use the default. Fixed once loading starts on this page. |
246
+
247
+ Missing or blank required values log an error and never load.
248
+
249
+ ## Loading and revocation
250
+
251
+ After consent, the helper creates the callable `pgo` queue, sets its alias and timestamp, configures the account, and sets `setTrackByDefault(false)`. After the SDK loads it calls `process('allowTracking')`, which sends the page request itself. The helper sends no duplicate `process` call at initial load. Once tracking starts, a settled denial reported by an active registration requires a page reload. The helper sends no further tracking or email commands on that page, even after a regrant.
252
+
253
+ Recreating the helper with the same options or a different `email` keeps the same SDK tag. After sign-in, register the helper with the contact's email. An email update changes future vendor requests and sends no additional page request. Omitting `email`, or passing a blank string, clears the runtime's email field after consent. This does not clear tracking cookies, reset the visitor ID, or erase identity already copied into vendor services.
254
+
255
+ If another script replaces the captured `pgo` dispatcher, the helper sends no further commands and requires a page reload.
256
+
257
+ Without a browser document, the script loader does not start ActiveCampaign. Replacing the helper or disposing its loader also requires no browser cleanup.
258
+
259
+ Use one account, loader URL and contact email across registrations on the page. Every active registration must have its mapped consent before the helper enables tracking. Conflicting registrations withhold further helper commands. Resolving a conflict or remounting a registration does not send another page request on an already activated runtime. Changing `accountId` or `scriptUrl` after loading starts requires a new page; the helper logs the conflict and keeps the original SDK. A `category` change updates c15t eligibility, not vendor configuration. Consent and option updates settle after the current JavaScript turn.
260
+
261
+ Keep `reloadOnConsentRevoked` enabled. The fetched runtime has no documented stop command. `setTrackByDefault(false)` does not stop services already started by `allowTracking`. Removing its script or registration cannot stop running code, clear stored identifiers or cancel requests. If a running helper changes to a denied category, reload the page as part of that configuration change. The helper logs that a reload is required; `reloadOnConsentRevoked` observes consent changes, not helper replacements. The permitted tag stays in the DOM across withdrawal and registration disposal to avoid installing a second runtime on remount. A pending download completed without consent or an active registration receives no `allowTracking` until a consenting registration exists and all active registrations agree on the configuration and have consent. An interrupted mount, failed download or externally detached SDK requires a page reload. The next denied page does not load the tag.
262
+
263
+ ActiveCampaign uses first-party tracking cookies. Cookie names and other storage can vary with the vendor runtime and account configuration. Inspect your own deployment after grant.
264
+
265
+ The default loads ActiveCampaign's Diffuser SDK directly from its vendor CDN. During verification, the `prism.js` URL from ActiveCampaign's tracking snippet redirected to `diffuser.js,?` and returned 403. The clean CDN URL returned JavaScript, accepted the same `pgo` queue, and initialized the tracker. The default bypasses that malformed redirect. Use `scriptUrl` for another region or a proxy and verify that it serves the matching ActiveCampaign runtime.
266
+
267
+ ## Verify ActiveCampaign
268
+
269
+ Check for no `diffuser.js`, `pgo`, `prismGlobalObjectAlias`, cookies or browser storage before consent and after unrelated consent. Grant marketing and confirm the vendor runtime replaces the queue. Verify the page request with your own configured account. Revoke and check that the next denied page does not load the tracker.
270
+
271
+ Sources: [tracking snippet](https://developers.activecampaign.com/reference/retrieve-site-tracking-code), [GDPR flow](https://help.activecampaign.com/hc/en-us/articles/360000872064-Site-tracking-and-the-GDPR), and [site tracking setup](https://help.activecampaign.com/hc/en-us/articles/20315300118044-How-to-set-up-Site-Tracking).
272
+
273
+ Test in a private window with an opt-in policy. Open DevTools Network, disable
274
+ the cache and filter by the vendor's domain:
275
+
276
+ 1. Load the page. No request goes to the vendor before you choose.
277
+ 2. Click Reject, then reload. There is still no vendor request.
278
+ 3. Open Privacy settings and allow the helper's category. The vendor script
279
+ loads without a page reload.
280
+ 4. Turn the category off again and save. c15t reloads the page, and the new
281
+ page makes no vendor request.
282
+
283
+ c15t reloads on revocation because removing a script element does not stop
284
+ code that already ran. The vendor's listeners, timers and queued events stay
285
+ alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
286
+ the vendor yourself. Register a callback-only script whose `onConsentChange`
287
+ calls the vendor's opt-out API, as shown in
288
+ [custom integrations](./building-integrations.md), and check the
289
+ permission before each of your own event calls. The reload does not delete
290
+ cookies the vendor already set; see
291
+ [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
292
+
293
+ The helper lists its vendor by name in the preference dialog, so a visitor can
294
+ turn it off inside an allowed category. See
295
+ [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
296
+ [consent verification guide](../guides/verify-consent.md) covers navigation,
297
+ expiry and hosting checks.