@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.
Files changed (146) hide show
  1. package/AGENTS.md +35 -5
  2. package/README.md +2 -2
  3. package/dist/component-hooks/use-consent-gate.js +2 -0
  4. package/dist/component-hooks/use-consent-labels.js +2 -0
  5. package/dist/component-hooks/use-consent-text-direction.js +2 -0
  6. package/dist/component-hooks/use-vendors-listed-under.js +2 -0
  7. package/dist/components/consent-gate/atoms.js +1 -1
  8. package/dist/components/consent-gate/consent-gate.js +1 -1
  9. package/dist/components/iab-prompt/atoms/root.js +1 -1
  10. package/dist/components/panel-trigger/atoms/toolbar.js +1 -1
  11. package/dist/components/preferences/atoms/button.js +1 -1
  12. package/dist/components/preferences/atoms/vendor-list.js +1 -1
  13. package/dist/components/prompt/atoms/root.js +1 -1
  14. package/dist/components/prompt/components.js +1 -1
  15. package/dist/components/prompt/policy-actions.js +1 -1
  16. package/dist/components/prompt/prompt.js +1 -1
  17. package/dist/components/prompt/surface-context.js +1 -1
  18. package/dist/components/prompt/use-banner-copy.js +1 -1
  19. package/dist/components/shared/streamed-surface.js +1 -1
  20. package/dist/headless.js +1 -1
  21. package/dist/index-parts/offline.js +1 -1
  22. package/dist/modes.js +1 -1
  23. package/dist/styles.tw3.css +2 -2
  24. package/dist/transports/offline.js +1 -1
  25. package/dist/version.js +1 -1
  26. package/dist-types/component-hooks/use-consent-gate.d.ts +102 -0
  27. package/dist-types/component-hooks/use-consent-labels.d.ts +32 -0
  28. package/dist-types/component-hooks/use-consent-text-direction.d.ts +22 -0
  29. package/dist-types/component-hooks/use-vendors-listed-under.d.ts +30 -0
  30. package/dist-types/components/prompt/atoms/root.d.ts +3 -3
  31. package/dist-types/components/prompt/prompt.d.ts +4 -3
  32. package/dist-types/components/prompt/surface-context.d.ts +1 -14
  33. package/dist-types/components/prompt/use-banner-copy.d.ts +8 -3
  34. package/dist-types/components/shared/streamed-surface.d.ts +47 -10
  35. package/dist-types/headless.d.ts +10 -1
  36. package/dist-types/hooks/use-iab-policy-guard.d.ts +17 -1
  37. package/dist-types/hooks/use-scroll-lock.d.ts +16 -2
  38. package/dist-types/index-parts/offline.d.ts +1 -1
  39. package/dist-types/modes.d.ts +1 -1
  40. package/dist-types/module-hooks/script-loader.d.ts +9 -0
  41. package/dist-types/provider.d.ts +3 -3
  42. package/dist-types/transports/offline.d.ts +2 -2
  43. package/dist-types/version.d.ts +1 -1
  44. package/docs/README.md +35 -5
  45. package/docs/concepts/choose-your-setup.md +9 -9
  46. package/docs/concepts/consent-state.md +81 -9
  47. package/docs/concepts/data-fetching.md +30 -23
  48. package/docs/concepts/modes.md +87 -35
  49. package/docs/customization/recipes.md +4 -4
  50. package/docs/customization/stylesheets.md +42 -3
  51. package/docs/customization/tailwind.md +17 -34
  52. package/docs/customization/translations.md +18 -12
  53. package/docs/frameworks/react/clear-on-revocation.md +3 -2
  54. package/docs/frameworks/react/components/consent-banner.md +3 -3
  55. package/docs/frameworks/react/components/consent-provider.md +29 -29
  56. package/docs/frameworks/react/gpp.md +1 -1
  57. package/docs/frameworks/react/headless.md +146 -19
  58. package/docs/frameworks/react/hooks.md +2 -1
  59. package/docs/frameworks/react/iab.md +8 -1
  60. package/docs/frameworks/react/quickstart.md +2 -2
  61. package/docs/frameworks/react/rendering.md +1 -1
  62. package/docs/frameworks/react/translations.md +9 -9
  63. package/docs/frameworks/react/troubleshooting.md +1 -1
  64. package/docs/frameworks/react/upgrade-v3.md +39 -32
  65. package/docs/frameworks/react/vendor-consent.md +5 -0
  66. package/docs/guides/banner-experiments.md +3 -3
  67. package/docs/guides/troubleshooting.md +3 -2
  68. package/docs/integrations/activecampaign.md +297 -0
  69. package/docs/integrations/ada.md +396 -0
  70. package/docs/integrations/adobe-analytics.md +2 -2
  71. package/docs/integrations/adobe-target.md +460 -0
  72. package/docs/integrations/adroll.md +336 -0
  73. package/docs/integrations/ahrefs-analytics.md +2 -2
  74. package/docs/integrations/amazon-ads.md +424 -0
  75. package/docs/integrations/amplitude.md +2 -2
  76. package/docs/integrations/appcues.md +368 -0
  77. package/docs/integrations/attentive.md +313 -0
  78. package/docs/integrations/building-integrations.md +29 -16
  79. package/docs/integrations/clay.md +305 -0
  80. package/docs/integrations/clearbit.md +3 -3
  81. package/docs/integrations/cloudflare-web-analytics.md +2 -2
  82. package/docs/integrations/cloudflare-zaraz.md +2 -2
  83. package/docs/integrations/crisp.md +2 -2
  84. package/docs/integrations/customer-io.md +369 -0
  85. package/docs/integrations/databuddy.md +127 -52
  86. package/docs/integrations/default-com.md +497 -0
  87. package/docs/integrations/dynamic-yield.md +373 -0
  88. package/docs/integrations/fathom-analytics.md +2 -2
  89. package/docs/integrations/front-chat.md +2 -2
  90. package/docs/integrations/fullstory.md +298 -0
  91. package/docs/integrations/gainsight-px.md +418 -0
  92. package/docs/integrations/google-maps.md +2 -2
  93. package/docs/integrations/google-tag-manager.md +59 -2
  94. package/docs/integrations/google-tag.md +2 -2
  95. package/docs/integrations/gorgias.md +365 -0
  96. package/docs/integrations/heap.md +2 -2
  97. package/docs/integrations/hightouch.md +2 -2
  98. package/docs/integrations/hotjar.md +40 -26
  99. package/docs/integrations/hubspot.md +529 -0
  100. package/docs/integrations/insider.md +550 -0
  101. package/docs/integrations/intercom.md +2 -2
  102. package/docs/integrations/klaviyo.md +2 -2
  103. package/docs/integrations/linkedin-insights.md +2 -2
  104. package/docs/integrations/liveintent.md +327 -0
  105. package/docs/integrations/logrocket.md +2 -2
  106. package/docs/integrations/lucky-orange.md +336 -0
  107. package/docs/integrations/marketo.md +309 -0
  108. package/docs/integrations/matomo-analytics.md +2 -2
  109. package/docs/integrations/meta-pixel.md +2 -2
  110. package/docs/integrations/microsoft-clarity.md +2 -2
  111. package/docs/integrations/microsoft-uet.md +2 -2
  112. package/docs/integrations/mixpanel-analytics.md +2 -2
  113. package/docs/integrations/one-dollar-stats.md +2 -2
  114. package/docs/integrations/openai-pixel.md +2 -2
  115. package/docs/integrations/optimizely.md +411 -0
  116. package/docs/integrations/oracle-eloqua.md +301 -0
  117. package/docs/integrations/overview.md +128 -81
  118. package/docs/integrations/pendo.md +339 -0
  119. package/docs/integrations/pinterest-tag.md +2 -2
  120. package/docs/integrations/pirsch.md +2 -2
  121. package/docs/integrations/plausible-analytics.md +2 -2
  122. package/docs/integrations/posthog.md +2 -2
  123. package/docs/integrations/promptwatch.md +2 -2
  124. package/docs/integrations/rb2b.md +363 -0
  125. package/docs/integrations/reddit-pixel.md +2 -2
  126. package/docs/integrations/rudderstack.md +2 -2
  127. package/docs/integrations/rybbit-analytics.md +2 -2
  128. package/docs/integrations/salesforce-pardot.md +342 -0
  129. package/docs/integrations/segment.md +2 -2
  130. package/docs/integrations/sentry.md +2 -2
  131. package/docs/integrations/shopify.md +323 -0
  132. package/docs/integrations/snapchat-pixel.md +2 -2
  133. package/docs/integrations/statable-analytics.md +345 -0
  134. package/docs/integrations/the-trade-desk.md +328 -0
  135. package/docs/integrations/tiktok-pixel.md +2 -2
  136. package/docs/integrations/umami-analytics.md +2 -2
  137. package/docs/integrations/vector.md +333 -0
  138. package/docs/integrations/vercel-analytics.md +2 -2
  139. package/docs/integrations/vercel-speed-insights.md +7 -2
  140. package/docs/integrations/wisepops.md +416 -0
  141. package/docs/integrations/x-pixel.md +2 -2
  142. package/docs/integrations/youtube.md +2 -2
  143. package/docs/integrations/zendesk.md +359 -0
  144. package/package.json +10 -32
  145. package/dist/components/prompt/resolve-banner-primary-actions.js +0 -1
  146. package/dist-types/components/prompt/resolve-banner-primary-actions.d.ts +0 -14
@@ -157,6 +157,11 @@ const xPixelAllowed = useVendorAllowed('x-pixel');
157
157
  or the vendor list changed under the edit. Call `reset()` to start again.
158
158
  `useDeclaredVendors()` returns the declared vendors, and `useVendorChoice()`
159
159
  returns the recorded vendor decision, or `null` before the visitor made one.
160
+ To list vendors under each category in your own preference center, call
161
+ `useVendorsListedUnder(category)` from `c15t/react/headless`. It returns the
162
+ vendors the stock dialog lists in that category's row, in declared order. A
163
+ vendor known only from a script's `vendor` slug stays listed after the
164
+ visitor turns it off, so they can turn it back on.
160
165
 
161
166
  A vendor reads as allowed only when it is declared, its category is allowed
162
167
  and the visitor has not switched it off. An id that nothing declares, in
@@ -138,7 +138,7 @@ sends it with `/init`, and records it on the choices of visitors the banner
138
138
  showed it to, so you can compare opt-in rate and time to decision per arm.
139
139
 
140
140
  The same option exists in `c15t/next` (`ConsentRoot` `options`), `c15t/vue`,
141
- `@c15t/svelte`, the `c15t()` Astro integration from `c15t/astro`, and
141
+ `c15t/svelte`, the `c15t()` Astro integration from `c15t/astro`, and
142
142
  `@c15t/browser`. On a server-rendered page in Next.js, TanStack Start or
143
143
  SvelteKit, pass it to `resolveConsent` instead, which counts the arm and hands
144
144
  it to the client; see [Vercel Flags SDK](#vercel-flags-sdk).
@@ -292,7 +292,7 @@ from [send the events to your own analytics](#send-the-events-to-your-own-analyt
292
292
  in `options`. The layout awaits consent inside `<Suspense>`, as in
293
293
  [render the banner in the server HTML](https://c15t.com/docs/frameworks/next/app-router#render-the-banner-in-the-server-html),
294
294
  so the banner is in the server HTML already showing the visitor's arm.
295
- `resolveConsent` in `c15t/tanstack-start/server` and `@c15t/svelte/server`
295
+ `resolveConsent` in `c15t/tanstack-start/server` and `c15t/svelte/server`
296
296
  takes the same `experiment`.
297
297
 
298
298
  If you pass `resolveConsent()` to `ConsentRoot` without awaiting it (the
@@ -520,7 +520,7 @@ server has to know the arm. Pass the experiment to `resolveConsent`, as in
520
520
  [Vercel Flags SDK](#vercel-flags-sdk): it sends only `{ id, arm }` to the
521
521
  backend and hands the full experiment to the client in its state.
522
522
  `resolveConsent` takes `experiment` in `c15t/next/server`,
523
- `c15t/tanstack-start/server` and `@c15t/svelte/server`; Astro and Nuxt pass
523
+ `c15t/tanstack-start/server` and `c15t/svelte/server`; Astro and Nuxt pass
524
524
  the arm they rendered on their own. When c15t picks the arm in the browser,
525
525
  the browser's own `/init` carries it, so a server-rendered page that skips
526
526
  the client `/init` has no count for built-in assignment. Resolve the arm with
@@ -53,7 +53,7 @@ No banner is sometimes correct. Find out which case you have:
53
53
  | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
54
54
  | The backend request failed or has a CORS error | Wrong backend URL, or your origin is not trusted | Copy the URL from your Inth project exactly, including any path. Add the site's origin, such as `https://www.example.com` or `http://localhost:3000`, to the project's trusted origins. |
55
55
  | Requests go to `your-project.inth.app` and fail | The placeholder backend URL from the guides is still in your code | Replace `https://your-project.inth.app` with the URL from your Inth project, including any path prefix. |
56
- | No backend request at all | No provider mounted, the provider runs in offline mode, or the page resolved from a bundled manifest | Check `window.c15t`. `mode: 'manifest'` with no request is expected for a policy that does not depend on location. Otherwise confirm your framework's backend URL variable is set, as [consent modes](../concepts/modes.md#set-the-backend-url) lists. |
56
+ | No backend request at all | No provider mounted, the provider runs in local mode, or the page resolved from a bundled manifest | Check `window.c15t`. `mode: 'manifest'` with no request is expected for a policy that does not depend on location. Otherwise confirm your framework's backend URL variable is set, as [consent modes](../concepts/modes.md#set-the-backend-url) lists. |
57
57
  | The policy resolved and no prompt is needed | The visitor's location maps to a policy without a prompt, such as a US state without a privacy law in the recommended rules | Expected. Test from a location that needs a prompt. Server helpers such as Next.js `resolveConsent` accept a `country` override for testing; remove it before you deploy. |
58
58
  | The policy resolved and a choice is stored | A returning visitor | Expected. Clear site data or use a private window. |
59
59
  | The banner is in the DOM but invisible or unstyled | c15t's rules are missing: `styles: false` without an imported stylesheet, a Content Security Policy that blocks c15t's `<style>` elements, Tailwind CSS 3's preflight, or a SvelteKit app without `c15tHandle` | See [stylesheets and CSS layers](../customization/stylesheets.md) for how your framework loads c15t's rules. |
@@ -135,6 +135,7 @@ messages, prefixed with the integration's name, such as
135
135
  | `could not fetch the consent manifest from <url> during the build (fetch failed: ...)`, with `ENOTFOUND`, `ECONNREFUSED` or another network error | The build cannot reach the backend | Build where the backend is reachable, or deploy with `C15T_ON_BUILD_ERROR=runtime` |
136
136
  | `... (no response within 10 seconds)` | The backend did not answer in time | Check the backend, or build where it is reachable |
137
137
  | `... (/manifest responded 404 Not Found)`, or another status | The URL is not your project's backend, such as the `https://your-project.inth.app` placeholder or a URL missing its path prefix | Copy the backend URL exactly as Inth shows it |
138
+ | `... (/manifest responded 402: <message> (<CODE>))`, or another status followed by a message | The backend refused the request and said why, such as an account out of its usage allowance | Follow the backend's message |
138
139
  | `... (/manifest returned an invalid consent manifest.)` | The URL answered with something other than a consent manifest, such as an HTML page | Point the backend URL at the backend itself, not your site or a dashboard page |
139
140
  | `no backend URL is set, so the build cannot fetch the consent manifest. Pass backendURL or set ...` | No `backendURL` option and no backend URL variable | Set the variable your framework reads; see [consent modes](../concepts/modes.md#set-the-backend-url) |
140
141
  | `skipped the consent manifest fetch because "/api/c15t" is not an absolute http(s) URL, so the server fetches the policy at runtime.` | A relative backend URL. A notice, not an error. | Pass the absolute backend URL. With `onBuildError: 'fail'`, this stops the build with `build-time manifests require an absolute upstream URL.` |
@@ -176,7 +177,7 @@ instead of a factory:
176
177
  | Message | Fix |
177
178
  | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178
179
  | ``@c15t/react ConsentProvider: `mode` is required. Use manifest() or hosted().`` | Pass `mode`, such as `manifest()` from the same package. The start of the message names the package and the API that got no mode, such as `@c15t/svelte ConsentProvider` or `@c15t/core createConsentRuntime()`. Production builds name the package only: ``@c15t/react: `mode` is required.`` |
179
- | ``@c15t/browser: `mode` must be a factory, such as manifest(), hosted() or offline() from @c15t/browser. Mode names like "hosted" work only in the script-tag builds.`` | Import the factory and call it: `init({ mode: hosted() })`. |
180
+ | ``@c15t/browser: `mode` must be a factory, such as manifest(), hosted() or local() from @c15t/browser. Mode names like "hosted" work only in the script-tag builds.`` | Import the factory and call it: `init({ mode: hosted() })`. |
180
181
  | ``c15t: hosted() needs `backendURL`. Pass it, or add consentManifest() from c15t/build to your Vite config and set VITE_C15T_BACKEND_URL (or VITE_INTH_PROJECT_URL).`` | The React `hosted()` found no backend URL. `@c15t/browser` throws the same message prefixed `@c15t/browser:`. A production build prints only the first sentence. |
181
182
  | ``c15t: `mode` is the hosted() transport itself, so its code ships in the client bundle. Pass the hosted() your framework package exports instead: it is plain data, and the root loads the code only when it runs.`` | A warning outside production. A server-rendered root got a transport from `c15t/react`. Import the mode from your framework package. Next.js has its own wording; see [Next.js troubleshooting](https://c15t.com/docs/frameworks/next/troubleshooting). |
182
183
 
@@ -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.