@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,342 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Salesforce Account Engagement
|
|
3
|
+
description: Gate Salesforce Account Engagement tracking on marketing consent,
|
|
4
|
+
configure its consent API or classic Pardot snippet, and verify revocation
|
|
5
|
+
with c15t.
|
|
6
|
+
seoTitle: Salesforce Pardot cookie consent with c15t
|
|
7
|
+
seoDescription: Load Account Engagement only after marketing consent. Configure
|
|
8
|
+
Pardot tracking, revoke consent and verify vendor requests with c15t.
|
|
9
|
+
icon: chart-line
|
|
10
|
+
group: integrations
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Account Engagement, formerly Pardot, tracks visitors and prospects for
|
|
14
|
+
Salesforce B2B marketing. The c15t `pardotTracking` helper waits for
|
|
15
|
+
`marketing` consent before it creates Pardot globals or downloads the tracker.
|
|
16
|
+
The default mode uses Account Engagement's Tracking and Consent API. The
|
|
17
|
+
helper also supports the classic `pd.js` snippet.
|
|
18
|
+
|
|
19
|
+
When the visitor withdraws, consent mode calls `pdt('revokeConsent')`. Classic
|
|
20
|
+
mode has no revoke call. In both modes, c15t reloads the page, and the reload
|
|
21
|
+
stops the running tracker.
|
|
22
|
+
|
|
23
|
+
## Configure Salesforce Account Engagement
|
|
24
|
+
|
|
25
|
+
Turn on the Tracking and Consent API in Account Engagement before you use
|
|
26
|
+
consent mode, and use its verified tracker domain. Copy `piAId` and `piCId`
|
|
27
|
+
from the generated tracking snippet as they are. They already include
|
|
28
|
+
Salesforce's +1000 offset, and the helper doesn't add it again. Then remove
|
|
29
|
+
the original tracking snippet.
|
|
30
|
+
|
|
31
|
+
| Package manager | Command |
|
|
32
|
+
| :-------------- | :------------------------------- |
|
|
33
|
+
| npm | `npm install @c15t/integrations` |
|
|
34
|
+
| pnpm | `pnpm add @c15t/integrations` |
|
|
35
|
+
| yarn | `yarn add @c15t/integrations` |
|
|
36
|
+
| bun | `bun add @c15t/integrations` |
|
|
37
|
+
|
|
38
|
+
```ts title="src/consent-scripts.ts"
|
|
39
|
+
import { pardotTracking } from '@c15t/integrations/salesforce-pardot';
|
|
40
|
+
|
|
41
|
+
export const scripts = [
|
|
42
|
+
pardotTracking({
|
|
43
|
+
piAId: '123456',
|
|
44
|
+
piCId: '654321',
|
|
45
|
+
piDomain: 'pi.pardot.com',
|
|
46
|
+
}),
|
|
47
|
+
];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Replace `pi.pardot.com` in the example with your verified tracker domain.
|
|
51
|
+
|
|
52
|
+
## Register the scripts
|
|
53
|
+
|
|
54
|
+
Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
|
|
55
|
+
endpoint, policy, styles and consent UI. Remove the vendor's original script,
|
|
56
|
+
SDK initializer or tag-manager entry, so the vendor loads only through c15t.
|
|
57
|
+
|
|
58
|
+
The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
|
|
59
|
+
quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
|
|
60
|
+
in the Next.js guide, add the helper to that array instead of creating a
|
|
61
|
+
second file.
|
|
62
|
+
The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
|
|
63
|
+
point for your framework below. These are edits to that provider, not a second
|
|
64
|
+
provider.
|
|
65
|
+
|
|
66
|
+
**Next.js**
|
|
67
|
+
|
|
68
|
+
Add the configuration to `scripts` in `c15t.config.ts`, next to
|
|
69
|
+
`next.config.ts`:
|
|
70
|
+
|
|
71
|
+
```ts title="c15t.config.ts"
|
|
72
|
+
import { defineConsentConfig } from 'c15t/next';
|
|
73
|
+
import { scripts } from './src/consent-scripts';
|
|
74
|
+
|
|
75
|
+
export default defineConsentConfig({ scripts });
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Keep the rest of your config, such as `mode` and `routePrefix`, in the
|
|
79
|
+
same call. `ConsentRoot` reads the config in the browser, so the layout
|
|
80
|
+
keeps passing only `state`. App Router, Pages Router and static export all
|
|
81
|
+
read the same file. See
|
|
82
|
+
[Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
|
|
83
|
+
|
|
84
|
+
**TanStack Start**
|
|
85
|
+
|
|
86
|
+
Import the configuration into your root route and pass it to the existing
|
|
87
|
+
`ConsentRoot` as a top-level prop. Keep the loader from the
|
|
88
|
+
[TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
|
|
89
|
+
|
|
90
|
+
```tsx title="src/routes/__root.tsx"
|
|
91
|
+
import { scripts } from '../consent-scripts';
|
|
92
|
+
|
|
93
|
+
<ConsentRoot state={consent} scripts={scripts}>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Import vendor helpers in the root route module, not in a server function.
|
|
97
|
+
A server function's return value must be serializable, and script
|
|
98
|
+
configurations carry callbacks. See
|
|
99
|
+
[TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
|
|
100
|
+
|
|
101
|
+
**React**
|
|
102
|
+
|
|
103
|
+
Add the configuration to the existing `ConsentProvider` options, next to
|
|
104
|
+
`mode`:
|
|
105
|
+
|
|
106
|
+
```tsx title="src/consent.tsx"
|
|
107
|
+
import { scripts } from './consent-scripts';
|
|
108
|
+
|
|
109
|
+
<ConsentProvider options={{ mode, scripts }}>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`mode` is the `manifest()` value from the
|
|
113
|
+
[React quickstart](../frameworks/react/quickstart.md). Keep the banner,
|
|
114
|
+
dialog and preferences link inside the provider. See
|
|
115
|
+
[React scripts and embeds](../frameworks/react/scripts.md).
|
|
116
|
+
|
|
117
|
+
**Nuxt**
|
|
118
|
+
|
|
119
|
+
Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
|
|
120
|
+
relative import to where you created `consent-scripts.ts`:
|
|
121
|
+
|
|
122
|
+
```ts title="app/app.config.ts"
|
|
123
|
+
import { scripts } from '../src/consent-scripts';
|
|
124
|
+
|
|
125
|
+
export default defineAppConfig({
|
|
126
|
+
c15t: { scripts },
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The Nuxt module merges this over its options in `nuxt.config.ts` and starts
|
|
131
|
+
one script loader in the browser after hydration, once it has applied the
|
|
132
|
+
visitor's stored choice and privacy signals. Keep `scripts` out of
|
|
133
|
+
`nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
|
|
134
|
+
callbacks. Write the vendor IDs into `consent-scripts.ts`. See
|
|
135
|
+
[Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
|
|
136
|
+
|
|
137
|
+
**Vue**
|
|
138
|
+
|
|
139
|
+
Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
|
|
140
|
+
|
|
141
|
+
```ts title="src/main.ts"
|
|
142
|
+
import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
|
|
143
|
+
import { scripts } from './consent-scripts';
|
|
144
|
+
|
|
145
|
+
app.use(c15tVue, {
|
|
146
|
+
mode: manifest(),
|
|
147
|
+
scripts,
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Keep your existing `mode` and other options. The plugin starts one
|
|
152
|
+
script loader when the app mounts, after it has applied the visitor's stored
|
|
153
|
+
choice. Do not also call `createScriptLoader` from a component. See
|
|
154
|
+
[Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
|
|
155
|
+
|
|
156
|
+
**Astro**
|
|
157
|
+
|
|
158
|
+
Add the scripts to the client entrypoint from the
|
|
159
|
+
[Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
|
|
160
|
+
which the integration finds on its own. Keep `astro.config.mjs` as it is.
|
|
161
|
+
If the module already exports scripts, combine the two arrays.
|
|
162
|
+
|
|
163
|
+
```ts title="src/c15t.client.ts"
|
|
164
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
165
|
+
import { scripts } from './consent-scripts';
|
|
166
|
+
|
|
167
|
+
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Vendor helpers contain callbacks, and the integration options in
|
|
171
|
+
`astro.config.mjs` are serialized into the page, so do not put helpers in
|
|
172
|
+
the integration's `scripts` option. The integration passes the client
|
|
173
|
+
entrypoint to the one runtime every page shares, including across
|
|
174
|
+
`ClientRouter` navigation.
|
|
175
|
+
|
|
176
|
+
**Svelte**
|
|
177
|
+
|
|
178
|
+
Import the scripts in the component that owns your existing provider and
|
|
179
|
+
pass them as a top-level prop:
|
|
180
|
+
|
|
181
|
+
```svelte title="src/App.svelte"
|
|
182
|
+
<script lang="ts">
|
|
183
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
184
|
+
import { scripts } from './consent-scripts';
|
|
185
|
+
</script>
|
|
186
|
+
|
|
187
|
+
<ConsentProvider mode={manifest()} {scripts}>
|
|
188
|
+
<!-- Keep your application, consent UI and preferences link here. -->
|
|
189
|
+
</ConsentProvider>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
|
|
193
|
+
The provider owns the loader and disposes it on unmount.
|
|
194
|
+
|
|
195
|
+
**SvelteKit**
|
|
196
|
+
|
|
197
|
+
Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
|
|
198
|
+
handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
|
|
199
|
+
|
|
200
|
+
```svelte title="src/routes/+layout.svelte"
|
|
201
|
+
<script lang="ts">
|
|
202
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
203
|
+
import { scripts } from '../consent-scripts';
|
|
204
|
+
|
|
205
|
+
let { children, data } = $props();
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<ConsentRoot state={data.consent} {scripts}>
|
|
209
|
+
{@render children()}
|
|
210
|
+
<!-- Keep your consent UI and preferences link here. -->
|
|
211
|
+
</ConsentRoot>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Import vendor helpers in the layout component, not in `+layout.server.ts`:
|
|
215
|
+
a server load cannot send functions to the browser. Prerendered, static and
|
|
216
|
+
SPA-mode pages use the same `scripts` prop. If you pass an externally owned
|
|
217
|
+
`runtime` to the provider, register scripts when creating that runtime instead.
|
|
218
|
+
|
|
219
|
+
**HTML**
|
|
220
|
+
|
|
221
|
+
The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
|
|
222
|
+
page that loads the c15t script tag, paste the vendor's own snippet instead
|
|
223
|
+
and keep it inert until its category is allowed:
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<script type="text/plain" data-c15t-category="measurement">
|
|
227
|
+
// The vendor's snippet, unchanged
|
|
228
|
+
</script>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Use the category this guide names for the vendor. c15t runs the snippet
|
|
232
|
+
once that category is allowed, and reloads the page when the visitor
|
|
233
|
+
withdraws it. Helper options on this page, such as `loadMode`, do not apply
|
|
234
|
+
to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
|
|
235
|
+
|
|
236
|
+
**JavaScript**
|
|
237
|
+
|
|
238
|
+
Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
import { init, manifest } from '@c15t/browser';
|
|
242
|
+
import { scripts } from './consent-scripts';
|
|
243
|
+
|
|
244
|
+
const consent = init({
|
|
245
|
+
mode: manifest(),
|
|
246
|
+
scripts,
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Keep the mode from your quickstart. With
|
|
251
|
+
`createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
|
|
252
|
+
A kernel you create yourself needs a loader from
|
|
253
|
+
`c15t/modules/script-loader`. Attach one loader per kernel. See
|
|
254
|
+
[JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
|
|
255
|
+
|
|
256
|
+
## Options
|
|
257
|
+
|
|
258
|
+
| Option | Default | Behavior |
|
|
259
|
+
| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
260
|
+
| `piAId` | Required | Account ID from the tracking snippet, as a string or number. Must be a positive integer. |
|
|
261
|
+
| `piCId` | Required | Campaign ID from the tracking snippet, as a string or number. Must be a positive integer. |
|
|
262
|
+
| `piDomain` | Required in consent mode | Verified tracker hostname, without a scheme or path. |
|
|
263
|
+
| `mode` | `consent` | `consent` uses the Tracking and Consent API. `classic` loads the older `pd.js` snippet, which has no revoke call. |
|
|
264
|
+
| `piHostname` | `pi.pardot.com` | Tracker hostname in classic mode, set as `window.piHostname`. |
|
|
265
|
+
| `category` | `marketing` | Consent condition for the whole loader. |
|
|
266
|
+
| `scriptUrl` | `https://<piDomain>/pdt.js?aid=<piAId>` | Loader override. Classic mode defaults to `https://pi.pardot.com/pd.js`. Blank overrides use the default. |
|
|
267
|
+
|
|
268
|
+
The helper logs an error and never loads the tracker when a required value is
|
|
269
|
+
missing or blank, when an ID isn't a safe positive integer, when a tracker
|
|
270
|
+
domain isn't a hostname, or when `mode` isn't `consent` or `classic`.
|
|
271
|
+
|
|
272
|
+
## Loading and revocation
|
|
273
|
+
|
|
274
|
+
Consent mode starts after hydration, even when the visitor allowed marketing
|
|
275
|
+
on an earlier visit. It waits for the client loader to confirm the SDK is
|
|
276
|
+
ready before it turns tracking on. Classic mode can start from the
|
|
277
|
+
server-rendered HTML.
|
|
278
|
+
|
|
279
|
+
After consent, the helper creates the `pdt.cq` queue and configures the
|
|
280
|
+
tracker with numeric IDs. It hides Salesforce's own consent banner without
|
|
281
|
+
changing consent, and starts with `setOptIn(false)`. After the SDK loads, it
|
|
282
|
+
calls `setOptIn(true)` and sends one page view. Changes to other categories
|
|
283
|
+
don't send another view. A detached in-flight load can't turn tracking on.
|
|
284
|
+
|
|
285
|
+
On withdrawal, the helper calls `pdt('revokeConsent')`. It doesn't call
|
|
286
|
+
`clearTrackingCookies`, because that also deletes the cookie that records the
|
|
287
|
+
refusal, so later page views could be tracked. On a new grant, the helper
|
|
288
|
+
reuses the tracker configuration and sends a new page view through the loaded
|
|
289
|
+
SDK. The consent-mode loader stays in the DOM, because downloading `pdt.js`
|
|
290
|
+
again replaces its configured dispatcher. If you call `pardotTracking` again
|
|
291
|
+
with the same options, the helper keeps the tracker configuration across the
|
|
292
|
+
new grant. Classic mode can't stop its running SDK through this helper.
|
|
293
|
+
|
|
294
|
+
Keep `reloadOnConsentRevoked` enabled in both modes. Clearing consent makes
|
|
295
|
+
vendor requests, and late in-flight responses can restore cookies. Removing a
|
|
296
|
+
script doesn't stop pending requests. The next page doesn't load Pardot while
|
|
297
|
+
its consent is denied.
|
|
298
|
+
|
|
299
|
+
## Cookies and storage
|
|
300
|
+
|
|
301
|
+
Pardot can set `visitor_id<id>`, `visitor_id<id>-hash`, `pi_opt_in<id>`,
|
|
302
|
+
`lpv<id>` and `pardot` cookies. A cookie suffix can be the account ID minus
|
|
303
|
+
1000\. The reload doesn't erase vendor cookies.
|
|
304
|
+
|
|
305
|
+
## Verify Salesforce Account Engagement
|
|
306
|
+
|
|
307
|
+
Before consent, check that there is no `pdt.js` or `pd.js` request, no `pdt` or
|
|
308
|
+
`piAId` global, and no vendor cookies or browser storage. Allow an unrelated
|
|
309
|
+
category and check again. Allow marketing to load the consent dispatcher, then
|
|
310
|
+
withdraw it. Confirm that the refusal cookie stays until your own cleanup or
|
|
311
|
+
its expiry. Allow marketing again and check for one new page view with your
|
|
312
|
+
own account.
|
|
313
|
+
|
|
314
|
+
Sources: Salesforce's [setup guide](https://developer.salesforce.com/docs/marketing/pardot/guide/tracking-and-consent-getting-started.html),
|
|
315
|
+
[consent functions](https://developer.salesforce.com/docs/marketing/pardot/guide/tracking-and-consent-functions.html)
|
|
316
|
+
and [classic snippet](https://help.salesforce.com/s/articleView?id=000381476\&language=en_US\&type=1).
|
|
317
|
+
|
|
318
|
+
Test in a private window with an opt-in policy. Open DevTools Network, disable
|
|
319
|
+
the cache and filter by the vendor's domain:
|
|
320
|
+
|
|
321
|
+
1. Load the page. No request goes to the vendor before you choose.
|
|
322
|
+
2. Click Reject, then reload. There is still no vendor request.
|
|
323
|
+
3. Open Privacy settings and allow the helper's category. The vendor script
|
|
324
|
+
loads without a page reload.
|
|
325
|
+
4. Turn the category off again and save. c15t reloads the page, and the new
|
|
326
|
+
page makes no vendor request.
|
|
327
|
+
|
|
328
|
+
c15t reloads on revocation because removing a script element does not stop
|
|
329
|
+
code that already ran. The vendor's listeners, timers and queued events stay
|
|
330
|
+
alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
|
|
331
|
+
the vendor yourself. Register a callback-only script whose `onConsentChange`
|
|
332
|
+
calls the vendor's opt-out API, as shown in
|
|
333
|
+
[custom integrations](./building-integrations.md), and check the
|
|
334
|
+
permission before each of your own event calls. The reload does not delete
|
|
335
|
+
cookies the vendor already set; see
|
|
336
|
+
[clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
|
|
337
|
+
|
|
338
|
+
The helper lists its vendor by name in the preference dialog, so a visitor can
|
|
339
|
+
turn it off inside an allowed category. See
|
|
340
|
+
[vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
|
|
341
|
+
[consent verification guide](../guides/verify-consent.md) covers navigation,
|
|
342
|
+
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();
|
|
@@ -184,7 +184,7 @@ pass them as a top-level prop:
|
|
|
184
184
|
|
|
185
185
|
```svelte title="src/App.svelte"
|
|
186
186
|
<script lang="ts">
|
|
187
|
-
import { ConsentProvider, manifest } from '
|
|
187
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
188
188
|
import { scripts } from './consent-scripts';
|
|
189
189
|
</script>
|
|
190
190
|
|
|
@@ -203,7 +203,7 @@ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs
|
|
|
203
203
|
|
|
204
204
|
```svelte title="src/routes/+layout.svelte"
|
|
205
205
|
<script lang="ts">
|
|
206
|
-
import { ConsentRoot } from '
|
|
206
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
207
207
|
import { scripts } from '../consent-scripts';
|
|
208
208
|
|
|
209
209
|
let { children, data } = $props();
|