@c15t/react 3.2.0-canary.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 (48) hide show
  1. package/AGENTS.md +30 -7
  2. package/dist/styles.tw3.css +2 -2
  3. package/dist/version.js +1 -1
  4. package/dist-types/version.d.ts +1 -1
  5. package/docs/README.md +30 -7
  6. package/docs/concepts/modes.md +5 -3
  7. package/docs/customization/stylesheets.md +39 -0
  8. package/docs/frameworks/react/hooks.md +2 -1
  9. package/docs/frameworks/react/quickstart.md +1 -1
  10. package/docs/frameworks/react/upgrade-v3.md +2 -2
  11. package/docs/integrations/activecampaign.md +297 -0
  12. package/docs/integrations/ada.md +396 -0
  13. package/docs/integrations/adobe-target.md +460 -0
  14. package/docs/integrations/adroll.md +336 -0
  15. package/docs/integrations/amazon-ads.md +424 -0
  16. package/docs/integrations/appcues.md +368 -0
  17. package/docs/integrations/attentive.md +313 -0
  18. package/docs/integrations/building-integrations.md +29 -16
  19. package/docs/integrations/clearbit.md +1 -1
  20. package/docs/integrations/customer-io.md +369 -0
  21. package/docs/integrations/databuddy.md +125 -50
  22. package/docs/integrations/default-com.md +497 -0
  23. package/docs/integrations/dynamic-yield.md +373 -0
  24. package/docs/integrations/fullstory.md +298 -0
  25. package/docs/integrations/gainsight-px.md +418 -0
  26. package/docs/integrations/gorgias.md +365 -0
  27. package/docs/integrations/hubspot.md +529 -0
  28. package/docs/integrations/insider.md +550 -0
  29. package/docs/integrations/liveintent.md +327 -0
  30. package/docs/integrations/lucky-orange.md +336 -0
  31. package/docs/integrations/marketo.md +309 -0
  32. package/docs/integrations/optimizely.md +411 -0
  33. package/docs/integrations/oracle-eloqua.md +301 -0
  34. package/docs/integrations/overview.md +124 -111
  35. package/docs/integrations/pendo.md +339 -0
  36. package/docs/integrations/rb2b.md +363 -0
  37. package/docs/integrations/salesforce-pardot.md +342 -0
  38. package/docs/integrations/statable-analytics.md +345 -0
  39. package/docs/integrations/the-trade-desk.md +328 -0
  40. package/docs/integrations/vector.md +333 -0
  41. package/docs/integrations/wisepops.md +416 -0
  42. package/docs/integrations/zendesk.md +359 -0
  43. package/package.json +8 -8
  44. package/docs/integrations/other-ads-and-pixels.md +0 -94
  45. package/docs/integrations/other-analytics.md +0 -108
  46. package/docs/integrations/other-chat-and-support.md +0 -112
  47. package/docs/integrations/other-email-and-sms.md +0 -156
  48. package/docs/integrations/other-experience.md +0 -222
@@ -0,0 +1,309 @@
1
+ ---
2
+ title: Marketo Munchkin
3
+ description: Load Adobe Marketo Munchkin after marketing consent, configure its
4
+ account and cookie options, and verify tracking and revocation with c15t.
5
+ seoTitle: Marketo Munchkin cookie consent with c15t
6
+ seoDescription: Wait for marketing consent before loading Marketo Munchkin. Set
7
+ your account ID, configure cookies and check revocation with c15t.
8
+ icon: chart-line
9
+ group: integrations
10
+ ---
11
+
12
+ Munchkin is Adobe Marketo's script for tracking known and anonymous leads on
13
+ your site. The c15t `marketoMunchkin` helper waits for `marketing` consent
14
+ before it requests Munchkin or initializes tracking. Until then, it creates no
15
+ Munchkin global, cookie or browser storage.
16
+
17
+ Munchkin has no API to stop tracking. When the visitor withdraws, c15t removes
18
+ the loader and reloads the page, and the reload ends tracking.
19
+
20
+ ## Configure Marketo Munchkin
21
+
22
+ Copy your Munchkin account ID from Marketo's installation snippet. Then remove
23
+ the Munchkin tag from your site, so that c15t controls when it loads.
24
+
25
+ | Package manager | Command |
26
+ | :-------------- | :------------------------------- |
27
+ | npm | `npm install @c15t/integrations` |
28
+ | pnpm | `pnpm add @c15t/integrations` |
29
+ | yarn | `yarn add @c15t/integrations` |
30
+ | bun | `bun add @c15t/integrations` |
31
+
32
+ ```ts title="src/consent-scripts.ts"
33
+ import { marketoMunchkin } from '@c15t/integrations/marketo';
34
+
35
+ export const scripts = [marketoMunchkin({ munchkinId: 'AAA-BBB-CCC' })];
36
+ ```
37
+
38
+ ## Register the scripts
39
+
40
+ Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
41
+ endpoint, policy, styles and consent UI. Remove the vendor's original script,
42
+ SDK initializer or tag-manager entry, so the vendor loads only through c15t.
43
+
44
+ The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
45
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
46
+ in the Next.js guide, add the helper to that array instead of creating a
47
+ second file.
48
+ The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
49
+ point for your framework below. These are edits to that provider, not a second
50
+ provider.
51
+
52
+ **Next.js**
53
+
54
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
55
+ `next.config.ts`:
56
+
57
+ ```ts title="c15t.config.ts"
58
+ import { defineConsentConfig } from 'c15t/next';
59
+ import { scripts } from './src/consent-scripts';
60
+
61
+ export default defineConsentConfig({ scripts });
62
+ ```
63
+
64
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
65
+ same call. `ConsentRoot` reads the config in the browser, so the layout
66
+ keeps passing only `state`. App Router, Pages Router and static export all
67
+ read the same file. See
68
+ [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
69
+
70
+ **TanStack Start**
71
+
72
+ Import the configuration into your root route and pass it to the existing
73
+ `ConsentRoot` as a top-level prop. Keep the loader from the
74
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
75
+
76
+ ```tsx title="src/routes/__root.tsx"
77
+ import { scripts } from '../consent-scripts';
78
+
79
+ <ConsentRoot state={consent} scripts={scripts}>
80
+ ```
81
+
82
+ Import vendor helpers in the root route module, not in a server function.
83
+ A server function's return value must be serializable, and script
84
+ configurations carry callbacks. See
85
+ [TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
86
+
87
+ **React**
88
+
89
+ Add the configuration to the existing `ConsentProvider` options, next to
90
+ `mode`:
91
+
92
+ ```tsx title="src/consent.tsx"
93
+ import { scripts } from './consent-scripts';
94
+
95
+ <ConsentProvider options={{ mode, scripts }}>
96
+ ```
97
+
98
+ `mode` is the `manifest()` value from the
99
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
100
+ dialog and preferences link inside the provider. See
101
+ [React scripts and embeds](../frameworks/react/scripts.md).
102
+
103
+ **Nuxt**
104
+
105
+ Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
106
+ relative import to where you created `consent-scripts.ts`:
107
+
108
+ ```ts title="app/app.config.ts"
109
+ import { scripts } from '../src/consent-scripts';
110
+
111
+ export default defineAppConfig({
112
+ c15t: { scripts },
113
+ });
114
+ ```
115
+
116
+ The Nuxt module merges this over its options in `nuxt.config.ts` and starts
117
+ one script loader in the browser after hydration, once it has applied the
118
+ visitor's stored choice and privacy signals. Keep `scripts` out of
119
+ `nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
120
+ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
121
+ [Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
122
+
123
+ **Vue**
124
+
125
+ Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
126
+
127
+ ```ts title="src/main.ts"
128
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
129
+ import { scripts } from './consent-scripts';
130
+
131
+ app.use(c15tVue, {
132
+ mode: manifest(),
133
+ scripts,
134
+ });
135
+ ```
136
+
137
+ Keep your existing `mode` and other options. The plugin starts one
138
+ script loader when the app mounts, after it has applied the visitor's stored
139
+ choice. Do not also call `createScriptLoader` from a component. See
140
+ [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
141
+
142
+ **Astro**
143
+
144
+ Add the scripts to the client entrypoint from the
145
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
146
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
147
+ If the module already exports scripts, combine the two arrays.
148
+
149
+ ```ts title="src/c15t.client.ts"
150
+ import type { C15tClientOptionsExtension } from 'c15t/astro';
151
+ import { scripts } from './consent-scripts';
152
+
153
+ export default { scripts } satisfies C15tClientOptionsExtension;
154
+ ```
155
+
156
+ Vendor helpers contain callbacks, and the integration options in
157
+ `astro.config.mjs` are serialized into the page, so do not put helpers in
158
+ the integration's `scripts` option. The integration passes the client
159
+ entrypoint to the one runtime every page shares, including across
160
+ `ClientRouter` navigation.
161
+
162
+ **Svelte**
163
+
164
+ Import the scripts in the component that owns your existing provider and
165
+ pass them as a top-level prop:
166
+
167
+ ```svelte title="src/App.svelte"
168
+ <script lang="ts">
169
+ import { ConsentProvider, manifest } from 'c15t/svelte';
170
+ import { scripts } from './consent-scripts';
171
+ </script>
172
+
173
+ <ConsentProvider mode={manifest()} {scripts}>
174
+ <!-- Keep your application, consent UI and preferences link here. -->
175
+ </ConsentProvider>
176
+ ```
177
+
178
+ Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
179
+ The provider owns the loader and disposes it on unmount.
180
+
181
+ **SvelteKit**
182
+
183
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
184
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
185
+
186
+ ```svelte title="src/routes/+layout.svelte"
187
+ <script lang="ts">
188
+ import { ConsentRoot } from 'c15t/svelte';
189
+ import { scripts } from '../consent-scripts';
190
+
191
+ let { children, data } = $props();
192
+ </script>
193
+
194
+ <ConsentRoot state={data.consent} {scripts}>
195
+ {@render children()}
196
+ <!-- Keep your consent UI and preferences link here. -->
197
+ </ConsentRoot>
198
+ ```
199
+
200
+ Import vendor helpers in the layout component, not in `+layout.server.ts`:
201
+ a server load cannot send functions to the browser. Prerendered, static and
202
+ SPA-mode pages use the same `scripts` prop. If you pass an externally owned
203
+ `runtime` to the provider, register scripts when creating that runtime instead.
204
+
205
+ **HTML**
206
+
207
+ The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
208
+ page that loads the c15t script tag, paste the vendor's own snippet instead
209
+ and keep it inert until its category is allowed:
210
+
211
+ ```html
212
+ <script type="text/plain" data-c15t-category="measurement">
213
+ // The vendor's snippet, unchanged
214
+ </script>
215
+ ```
216
+
217
+ Use the category this guide names for the vendor. c15t runs the snippet
218
+ once that category is allowed, and reloads the page when the visitor
219
+ withdraws it. Helper options on this page, such as `loadMode`, do not apply
220
+ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
221
+
222
+ **JavaScript**
223
+
224
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
225
+
226
+ ```ts
227
+ import { init, manifest } from '@c15t/browser';
228
+ import { scripts } from './consent-scripts';
229
+
230
+ const consent = init({
231
+ mode: manifest(),
232
+ scripts,
233
+ });
234
+ ```
235
+
236
+ Keep the mode from your quickstart. With
237
+ `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
238
+ A kernel you create yourself needs a loader from
239
+ `c15t/modules/script-loader`. Attach one loader per kernel. See
240
+ [JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
241
+
242
+ ## Options
243
+
244
+ | Option | Default | Behavior |
245
+ | ------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
246
+ | `munchkinId` | Required | Public account ID. Whitespace is trimmed. If it's missing or blank, c15t logs an error and never loads Munchkin. |
247
+ | `initOptions` | `{}` | Passed to `Munchkin.init`, for example `cookieAnon`, `anonymizeIP`, `apiOnly` and `cookieLifeDays`. |
248
+ | `category` | `marketing` | Consent condition that gates the whole loader. |
249
+ | `scriptUrl` | `https://munchkin.marketo.net/munchkin.js` | Custom or proxied loader URL. Blank values use the default. Other Munchkin requests need their own proxy configuration. |
250
+
251
+ `cookieAnon: false` stops Munchkin from creating cookies for new anonymous
252
+ visitors and tracking them. It is not a consent switch. Visitors who already
253
+ have a tracking cookie are still tracked.
254
+
255
+ ## Loading and revocation
256
+
257
+ After consent, c15t downloads the SDK and calls `Munchkin.init` once with the
258
+ account ID and `initOptions`. If the visitor withdraws while the SDK
259
+ downloads, the helper skips initialization. Changes to other categories don't
260
+ initialize Munchkin again.
261
+
262
+ Keep `reloadOnConsentRevoked` enabled. Removing the loader doesn't stop the
263
+ running SDK or its listeners. The next page doesn't load Munchkin while its
264
+ consent is denied.
265
+
266
+ ## Cookies and storage
267
+
268
+ Munchkin can set `_mkto_trk` for two years by default. The reload doesn't
269
+ remove it. Marketo's separate `marketo_opt_out=true` URL flow sets
270
+ `mkto_opt_out` and turns tracking off. The helper doesn't set that opt-out,
271
+ because it would also block tracking after a later consent grant.
272
+
273
+ ## Verify Marketo Munchkin
274
+
275
+ Filter the Network panel by `munchkin.marketo.net`. Before consent, check that
276
+ there is no loader request, no `window.Munchkin`, no `_mkto_trk` cookie and no
277
+ vendor browser storage. Allow the category set in `category`, which defaults
278
+ to `marketing`, and check that the SDK loads and initializes. Reject that
279
+ category again and check that the reloaded page makes no Munchkin request. For
280
+ example, with `category: 'experience'`, allow and reject `experience`.
281
+
282
+ Sources: Adobe's [async installation snippet](https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/javascriptapi/leadtracking/lead-tracking)
283
+ and [configuration reference](https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/javascriptapi/leadtracking/configuration).
284
+
285
+ Test in a private window with an opt-in policy. Open DevTools Network, disable
286
+ the cache and filter by the vendor's domain:
287
+
288
+ 1. Load the page. No request goes to the vendor before you choose.
289
+ 2. Click Reject, then reload. There is still no vendor request.
290
+ 3. Open Privacy settings and allow the helper's category. The vendor script
291
+ loads without a page reload.
292
+ 4. Turn the category off again and save. c15t reloads the page, and the new
293
+ page makes no vendor request.
294
+
295
+ c15t reloads on revocation because removing a script element does not stop
296
+ code that already ran. The vendor's listeners, timers and queued events stay
297
+ alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
298
+ the vendor yourself. Register a callback-only script whose `onConsentChange`
299
+ calls the vendor's opt-out API, as shown in
300
+ [custom integrations](./building-integrations.md), and check the
301
+ permission before each of your own event calls. The reload does not delete
302
+ cookies the vendor already set; see
303
+ [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
304
+
305
+ The helper lists its vendor by name in the preference dialog, so a visitor can
306
+ turn it off inside an allowed category. See
307
+ [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
308
+ [consent verification guide](../guides/verify-consent.md) covers navigation,
309
+ expiry and hosting checks.