@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,424 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Amazon Ads
|
|
3
|
+
description: Load Amazon Ads with c15t after marketing consent and verify its
|
|
4
|
+
loader, storage and revocation behavior.
|
|
5
|
+
seoTitle: Amazon Ads consent with c15t
|
|
6
|
+
seoDescription: Configure the c15t amazonAdsTag helper, gate vendor requests on
|
|
7
|
+
marketing consent and understand what happens when consent is withdrawn.
|
|
8
|
+
icon: radar
|
|
9
|
+
group: integrations
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
The `amazonAdsTag` helper keeps Amazon Ads off the page until `marketing` consent is granted.
|
|
13
|
+
Remove direct snippets and tag manager copies so they cannot bypass c15t.
|
|
14
|
+
|
|
15
|
+
## Configure Amazon Ads
|
|
16
|
+
|
|
17
|
+
| Package manager | Command |
|
|
18
|
+
| :-------------- | :------------------------------- |
|
|
19
|
+
| npm | `npm install @c15t/integrations` |
|
|
20
|
+
| pnpm | `pnpm add @c15t/integrations` |
|
|
21
|
+
| yarn | `yarn add @c15t/integrations` |
|
|
22
|
+
| bun | `bun add @c15t/integrations` |
|
|
23
|
+
|
|
24
|
+
```ts title="src/consent-scripts.ts"
|
|
25
|
+
import { amazonAdsTag } from '@c15t/integrations/amazon-ads';
|
|
26
|
+
|
|
27
|
+
export const scripts = [amazonAdsTag({ region: 'NA', tagId: 'YOUR_TAG_ID' })];
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Register the scripts
|
|
31
|
+
|
|
32
|
+
Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
|
|
33
|
+
endpoint, policy, styles and consent UI. Remove the vendor's original script,
|
|
34
|
+
SDK initializer or tag-manager entry, so the vendor loads only through c15t.
|
|
35
|
+
|
|
36
|
+
The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
|
|
37
|
+
quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
|
|
38
|
+
in the Next.js guide, add the helper to that array instead of creating a
|
|
39
|
+
second file.
|
|
40
|
+
The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
|
|
41
|
+
point for your framework below. These are edits to that provider, not a second
|
|
42
|
+
provider.
|
|
43
|
+
|
|
44
|
+
**Next.js**
|
|
45
|
+
|
|
46
|
+
Add the configuration to `scripts` in `c15t.config.ts`, next to
|
|
47
|
+
`next.config.ts`:
|
|
48
|
+
|
|
49
|
+
```ts title="c15t.config.ts"
|
|
50
|
+
import { defineConsentConfig } from 'c15t/next';
|
|
51
|
+
import { scripts } from './src/consent-scripts';
|
|
52
|
+
|
|
53
|
+
export default defineConsentConfig({ scripts });
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Keep the rest of your config, such as `mode` and `routePrefix`, in the
|
|
57
|
+
same call. `ConsentRoot` reads the config in the browser, so the layout
|
|
58
|
+
keeps passing only `state`. App Router, Pages Router and static export all
|
|
59
|
+
read the same file. See
|
|
60
|
+
[Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
|
|
61
|
+
|
|
62
|
+
**TanStack Start**
|
|
63
|
+
|
|
64
|
+
Import the configuration into your root route and pass it to the existing
|
|
65
|
+
`ConsentRoot` as a top-level prop. Keep the loader from the
|
|
66
|
+
[TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
|
|
67
|
+
|
|
68
|
+
```tsx title="src/routes/__root.tsx"
|
|
69
|
+
import { scripts } from '../consent-scripts';
|
|
70
|
+
|
|
71
|
+
<ConsentRoot state={consent} scripts={scripts}>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Import vendor helpers in the root route module, not in a server function.
|
|
75
|
+
A server function's return value must be serializable, and script
|
|
76
|
+
configurations carry callbacks. See
|
|
77
|
+
[TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
|
|
78
|
+
|
|
79
|
+
**React**
|
|
80
|
+
|
|
81
|
+
Add the configuration to the existing `ConsentProvider` options, next to
|
|
82
|
+
`mode`:
|
|
83
|
+
|
|
84
|
+
```tsx title="src/consent.tsx"
|
|
85
|
+
import { scripts } from './consent-scripts';
|
|
86
|
+
|
|
87
|
+
<ConsentProvider options={{ mode, scripts }}>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`mode` is the `manifest()` value from the
|
|
91
|
+
[React quickstart](../frameworks/react/quickstart.md). Keep the banner,
|
|
92
|
+
dialog and preferences link inside the provider. See
|
|
93
|
+
[React scripts and embeds](../frameworks/react/scripts.md).
|
|
94
|
+
|
|
95
|
+
**Nuxt**
|
|
96
|
+
|
|
97
|
+
Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
|
|
98
|
+
relative import to where you created `consent-scripts.ts`:
|
|
99
|
+
|
|
100
|
+
```ts title="app/app.config.ts"
|
|
101
|
+
import { scripts } from '../src/consent-scripts';
|
|
102
|
+
|
|
103
|
+
export default defineAppConfig({
|
|
104
|
+
c15t: { scripts },
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The Nuxt module merges this over its options in `nuxt.config.ts` and starts
|
|
109
|
+
one script loader in the browser after hydration, once it has applied the
|
|
110
|
+
visitor's stored choice and privacy signals. Keep `scripts` out of
|
|
111
|
+
`nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
|
|
112
|
+
callbacks. Write the vendor IDs into `consent-scripts.ts`. See
|
|
113
|
+
[Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
|
|
114
|
+
|
|
115
|
+
**Vue**
|
|
116
|
+
|
|
117
|
+
Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
|
|
118
|
+
|
|
119
|
+
```ts title="src/main.ts"
|
|
120
|
+
import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
|
|
121
|
+
import { scripts } from './consent-scripts';
|
|
122
|
+
|
|
123
|
+
app.use(c15tVue, {
|
|
124
|
+
mode: manifest(),
|
|
125
|
+
scripts,
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Keep your existing `mode` and other options. The plugin starts one
|
|
130
|
+
script loader when the app mounts, after it has applied the visitor's stored
|
|
131
|
+
choice. Do not also call `createScriptLoader` from a component. See
|
|
132
|
+
[Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
|
|
133
|
+
|
|
134
|
+
**Astro**
|
|
135
|
+
|
|
136
|
+
Add the scripts to the client entrypoint from the
|
|
137
|
+
[Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
|
|
138
|
+
which the integration finds on its own. Keep `astro.config.mjs` as it is.
|
|
139
|
+
If the module already exports scripts, combine the two arrays.
|
|
140
|
+
|
|
141
|
+
```ts title="src/c15t.client.ts"
|
|
142
|
+
import type { C15tClientOptionsExtension } from 'c15t/astro';
|
|
143
|
+
import { scripts } from './consent-scripts';
|
|
144
|
+
|
|
145
|
+
export default { scripts } satisfies C15tClientOptionsExtension;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Vendor helpers contain callbacks, and the integration options in
|
|
149
|
+
`astro.config.mjs` are serialized into the page, so do not put helpers in
|
|
150
|
+
the integration's `scripts` option. The integration passes the client
|
|
151
|
+
entrypoint to the one runtime every page shares, including across
|
|
152
|
+
`ClientRouter` navigation.
|
|
153
|
+
|
|
154
|
+
**Svelte**
|
|
155
|
+
|
|
156
|
+
Import the scripts in the component that owns your existing provider and
|
|
157
|
+
pass them as a top-level prop:
|
|
158
|
+
|
|
159
|
+
```svelte title="src/App.svelte"
|
|
160
|
+
<script lang="ts">
|
|
161
|
+
import { ConsentProvider, manifest } from 'c15t/svelte';
|
|
162
|
+
import { scripts } from './consent-scripts';
|
|
163
|
+
</script>
|
|
164
|
+
|
|
165
|
+
<ConsentProvider mode={manifest()} {scripts}>
|
|
166
|
+
<!-- Keep your application, consent UI and preferences link here. -->
|
|
167
|
+
</ConsentProvider>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
|
|
171
|
+
The provider owns the loader and disposes it on unmount.
|
|
172
|
+
|
|
173
|
+
**SvelteKit**
|
|
174
|
+
|
|
175
|
+
Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
|
|
176
|
+
handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
|
|
177
|
+
|
|
178
|
+
```svelte title="src/routes/+layout.svelte"
|
|
179
|
+
<script lang="ts">
|
|
180
|
+
import { ConsentRoot } from 'c15t/svelte';
|
|
181
|
+
import { scripts } from '../consent-scripts';
|
|
182
|
+
|
|
183
|
+
let { children, data } = $props();
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<ConsentRoot state={data.consent} {scripts}>
|
|
187
|
+
{@render children()}
|
|
188
|
+
<!-- Keep your consent UI and preferences link here. -->
|
|
189
|
+
</ConsentRoot>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Import vendor helpers in the layout component, not in `+layout.server.ts`:
|
|
193
|
+
a server load cannot send functions to the browser. Prerendered, static and
|
|
194
|
+
SPA-mode pages use the same `scripts` prop. If you pass an externally owned
|
|
195
|
+
`runtime` to the provider, register scripts when creating that runtime instead.
|
|
196
|
+
|
|
197
|
+
**HTML**
|
|
198
|
+
|
|
199
|
+
The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
|
|
200
|
+
page that loads the c15t script tag, paste the vendor's own snippet instead
|
|
201
|
+
and keep it inert until its category is allowed:
|
|
202
|
+
|
|
203
|
+
```html
|
|
204
|
+
<script type="text/plain" data-c15t-category="measurement">
|
|
205
|
+
// The vendor's snippet, unchanged
|
|
206
|
+
</script>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Use the category this guide names for the vendor. c15t runs the snippet
|
|
210
|
+
once that category is allowed, and reloads the page when the visitor
|
|
211
|
+
withdraws it. Helper options on this page, such as `loadMode`, do not apply
|
|
212
|
+
to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
|
|
213
|
+
|
|
214
|
+
**JavaScript**
|
|
215
|
+
|
|
216
|
+
Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
import { init, manifest } from '@c15t/browser';
|
|
220
|
+
import { scripts } from './consent-scripts';
|
|
221
|
+
|
|
222
|
+
const consent = init({
|
|
223
|
+
mode: manifest(),
|
|
224
|
+
scripts,
|
|
225
|
+
});
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Keep the mode from your quickstart. With
|
|
229
|
+
`createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
|
|
230
|
+
A kernel you create yourself needs a loader from
|
|
231
|
+
`c15t/modules/script-loader`. Attach one loader per kernel. See
|
|
232
|
+
[JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
|
|
233
|
+
|
|
234
|
+
The c15t `amazonAdsTag` helper loads Amazon's advertising tag after
|
|
235
|
+
`marketing` consent. It creates no Amazon queue or script before that grant.
|
|
236
|
+
When you supply the visitor's country, the helper also loads Amazon Consent
|
|
237
|
+
Signal, ACS, and forwards the current permission for ad storage and user data.
|
|
238
|
+
|
|
239
|
+
To enable ACS, pass `countryCode` with the actual visitor country from your
|
|
240
|
+
server or another trusted geography source. The helper trims and uppercases
|
|
241
|
+
that value. It never assumes `US`. The `region` option selects your Amazon
|
|
242
|
+
advertising account's region and does not identify the visitor's country.
|
|
243
|
+
|
|
244
|
+
Amazon's template requires a country code to process ACS data. If the country
|
|
245
|
+
is unknown, omit `countryCode`; c15t then loads only the main tag. Confirm
|
|
246
|
+
which signals your account and traffic require before deploying. Amazon's
|
|
247
|
+
template states that EEA traffic needs at least one of TCF, GPP or ACS.
|
|
248
|
+
Amazon's [consent-signal requirements](https://advertising.amazon.com/en-gb/resources/ad-policy/consent-signal-requirements)
|
|
249
|
+
require a valid consent signal when transmitting personal data from UK and
|
|
250
|
+
EEA users to Amazon Ads.
|
|
251
|
+
|
|
252
|
+
## Options
|
|
253
|
+
|
|
254
|
+
| Option | Default | Behavior |
|
|
255
|
+
| -------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
256
|
+
| `tagId` | Required | Amazon Ads tag ID passed to `amzn('addTag', ...)`. The helper trims it. A missing, empty or whitespace-only value logs an error and loads nothing. |
|
|
257
|
+
| `region` | `NA` | `NA` or `EU`, passed to `amzn('setRegion', ...)`. Use the region for your advertising account. Amazon's template groups North America, South America, Japan and Australia under `NA`. |
|
|
258
|
+
| `trackPageView` | `true` | Sends one initial `amzn('trackEvent', 'PageView', ...)`. Set `false` when your application owns the initial page view. |
|
|
259
|
+
| `pageViewAttributes` | `{}` | Attributes for that initial PageView, such as `value`, `currencyCode` or `clientDedupeId`. |
|
|
260
|
+
| `countryCode` | None | Actual visitor country, as a two-letter ISO 3166-1 code. Enables the consent helper. Blank values disable ACS. |
|
|
261
|
+
| `ipAddress` | None | Optional visitor IP address passed to ACS. Used only when `countryCode` enables ACS. |
|
|
262
|
+
| `gpp` | None | Existing IAB GPP consent string passed to ACS. Used only when `countryCode` enables ACS. The helper does not create or validate this string. |
|
|
263
|
+
| `scriptUrl` | `https://c.amazon-adsystem.com/aat/amzn.js` | Main loader URL override. A blank value falls back to the default. |
|
|
264
|
+
| `consentScriptUrl` | `https://c.amazon-adsystem.com/aat/amzn-consent.js` | ACS loader URL override. A blank value falls back to the default. |
|
|
265
|
+
|
|
266
|
+
The returned script uses `marketing` by default. A category override on that
|
|
267
|
+
script also changes the permission forwarded to ACS, including during
|
|
268
|
+
configuration replacement. Both `enableAdStorage`
|
|
269
|
+
and `enableUserData` follow the script's effective permission, including its
|
|
270
|
+
vendor switch. They are not independent configuration flags.
|
|
271
|
+
|
|
272
|
+
The helper does not set user data for advanced matching or create a TCF
|
|
273
|
+
consent string. Do not manufacture a TCF string to satisfy a tag's consent
|
|
274
|
+
checks. Use your existing IAB consent implementation when Amazon requires
|
|
275
|
+
TCF. Amazon's template says TCF takes priority when several signals are
|
|
276
|
+
present.
|
|
277
|
+
|
|
278
|
+
## Loading and revocation
|
|
279
|
+
|
|
280
|
+
Before the script's permission is granted, c15t creates no `window.amzn`,
|
|
281
|
+
`amzn.q` or `amznConsent`, loads neither Amazon library and sets no Amazon
|
|
282
|
+
cookie or browser storage. This guarantee covers the helper's own actions.
|
|
283
|
+
Remove other Amazon loaders to apply the same gate to the whole page.
|
|
284
|
+
|
|
285
|
+
After grant, the helper preserves an existing `amzn` function or creates
|
|
286
|
+
Amazon's nested command queue. Each entry contains the command arguments and
|
|
287
|
+
a timestamp, `[arguments, Date.now()]`.
|
|
288
|
+
|
|
289
|
+
When ACS is enabled, the helper inserts `amzn-consent.js` before the main
|
|
290
|
+
`amzn.js` element and uses ordered script execution. The downloads can
|
|
291
|
+
overlap. After the consent helper executes, c15t calls `amznConsent` with the
|
|
292
|
+
real country and both permissions set to `true`. It then queues `setRegion`,
|
|
293
|
+
`addTag` and the optional PageView before the main library executes. Without
|
|
294
|
+
ACS, it queues those commands before inserting the main tag. The helper
|
|
295
|
+
does not add automatic tracking for client-side navigation.
|
|
296
|
+
|
|
297
|
+
If consent is withdrawn while the consent helper is loading, its completion
|
|
298
|
+
forwards both permissions as `false` and skips initialization. An already
|
|
299
|
+
started helper can still execute after withdrawal. Amazon's helper writes a
|
|
300
|
+
cookie during evaluation, before the first explicit consent update.
|
|
301
|
+
|
|
302
|
+
If Amazon has not consumed c15t's queued initialization commands, withdrawal
|
|
303
|
+
removes those entries. Amazon can still be waiting to consume the queue after
|
|
304
|
+
the browser reports that `amzn.js` has loaded. The helper preserves commands
|
|
305
|
+
your application queued itself.
|
|
306
|
+
|
|
307
|
+
Both loaders stay on the page after revocation. When ACS is available, the
|
|
308
|
+
helper calls `amznConsent` with `enableAdStorage: false` and
|
|
309
|
+
`enableUserData: false`. This forwards withdrawal. Amazon documents no
|
|
310
|
+
shutdown or unload command for this tag, and ACS denial does not stop all
|
|
311
|
+
requests from the running runtime. Keep c15t's default reload on revocation
|
|
312
|
+
to stop that runtime. Removing script elements cannot undo executed code,
|
|
313
|
+
requests already sent or cookies already set.
|
|
314
|
+
|
|
315
|
+
If marketing is allowed again before a reload, the helper reuses both
|
|
316
|
+
loaders and the existing Amazon function. It restores ACS permission without
|
|
317
|
+
repeating a completed initialization or PageView. If withdrawal canceled
|
|
318
|
+
initialization before Amazon consumed the queue, it queues initialization
|
|
319
|
+
once for the new grant. Changes to unrelated consent categories do not
|
|
320
|
+
repeat these calls.
|
|
321
|
+
|
|
322
|
+
Full loader disposal or configuration replacement detaches that lifecycle's
|
|
323
|
+
load and error listeners. c15t removes its ACS element after the final
|
|
324
|
+
registration using that element releases it, including registrations with
|
|
325
|
+
different options that borrow the same helper.
|
|
326
|
+
c15t leaves externally supplied helper elements in place. A disposed helper's
|
|
327
|
+
late completion cannot initialize the tag or forward an old consent state.
|
|
328
|
+
ACS permission stays granted while at least one active distinct configuration
|
|
329
|
+
with `countryCode` passes its effective consent gate. Releasing or withdrawing
|
|
330
|
+
one configuration does not deny a surviving permitted configuration. Equivalent
|
|
331
|
+
configurations share their lifecycle and combine their registrations' gates.
|
|
332
|
+
Replacing options evaluates the incoming configuration before settling ACS, so
|
|
333
|
+
an unchanged grant does not produce a temporary denial. Removing `countryCode`,
|
|
334
|
+
removing the configuration or withdrawing consent forwards denial when no
|
|
335
|
+
permitted ACS configuration remains. This includes category overrides and
|
|
336
|
+
vendor restrictions.
|
|
337
|
+
Removing an element does not abort code already downloaded or stop a running
|
|
338
|
+
Amazon runtime. Keep the default revocation reload enabled.
|
|
339
|
+
|
|
340
|
+
If the ACS library fails to load, c15t reports the failure and withholds the
|
|
341
|
+
tag registration and initial PageView. The main library remains a normal
|
|
342
|
+
core script resource with its own load and error events. Reload to retry a
|
|
343
|
+
failed consent-helper download.
|
|
344
|
+
|
|
345
|
+
Guard every application-owned `amzn` event call with the current permission
|
|
346
|
+
for the category and vendor. The global function still exists after
|
|
347
|
+
revocation, so checking for that function alone does not check consent. If
|
|
348
|
+
you disable `reloadOnConsentRevoked`, queued application events and the
|
|
349
|
+
running Amazon library can still send requests.
|
|
350
|
+
|
|
351
|
+
## Cookies and storage
|
|
352
|
+
|
|
353
|
+
The following names come from the downloaded Amazon libraries reviewed on
|
|
354
|
+
21 October 2026. They are source-code findings, not a complete inventory from
|
|
355
|
+
a live browser session. Account configuration, downstream responses and
|
|
356
|
+
browser restrictions can change which cookies appear and how long they last.
|
|
357
|
+
|
|
358
|
+
| Name | Source | Lifetime in the reviewed code |
|
|
359
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
360
|
+
| `amzn_consent` | First-party ACS cookie written by `amzn-consent.js`. The library creates denied defaults during evaluation if the cookie is absent. It requests `Path=/`, `SameSite=Strict` and `Secure`. | 28 days |
|
|
361
|
+
| `amznAref` | First-party measurement-token cookie read, updated or removed by `amzn.js`. | 30-day token lifetime |
|
|
362
|
+
| `aatToken` | First-party token cookie managed by `amzn.js`. | Supplied by the token response |
|
|
363
|
+
| `AMZN-NoCookieConsent` | First-party cached no-consent cookie managed by `amzn.js`. | Supplied by the token response |
|
|
364
|
+
|
|
365
|
+
Neither reviewed library references `localStorage` or `sessionStorage`. That
|
|
366
|
+
does not establish which storage downstream Amazon resources use. A reload
|
|
367
|
+
does not delete existing cookies, and your site's JavaScript cannot delete
|
|
368
|
+
cookies on Amazon's domains.
|
|
369
|
+
|
|
370
|
+
## Verify Amazon Ads
|
|
371
|
+
|
|
372
|
+
1. Use a private window with an opt-in policy. In DevTools, filter requests
|
|
373
|
+
by `amazon-adsystem.com`. Before choosing, then after rejecting and
|
|
374
|
+
reloading, neither Amazon library nor any Amazon event request should
|
|
375
|
+
appear. Check cookies and browser storage too.
|
|
376
|
+
2. Allow marketing. Without ACS, check for one `amzn.js` load and the initial
|
|
377
|
+
PageView. With a real `countryCode`, also check that `amzn-consent.js`
|
|
378
|
+
executes first and ACS contains the supplied country and granted signals.
|
|
379
|
+
3. Change an unrelated consent category. There should be no second loader
|
|
380
|
+
or initial PageView.
|
|
381
|
+
4. Withdraw marketing. With ACS enabled, check that both signals become
|
|
382
|
+
denied. After c15t reloads the page, neither Amazon library should load.
|
|
383
|
+
If reload is disabled, test your application event guards and do not
|
|
384
|
+
treat ACS denial as proof that all Amazon traffic stopped.
|
|
385
|
+
|
|
386
|
+
Use your account's tag ID for an acceptance test. A fetched script or a
|
|
387
|
+
syntactically valid UUID does not establish that an advertiser account or
|
|
388
|
+
conversion endpoint accepted the event.
|
|
389
|
+
|
|
390
|
+
## Sources
|
|
391
|
+
|
|
392
|
+
* [Amazon's official Google Tag Manager template](https://github.com/amzn/ads-pao-amznjs-gtm-template), including its README, `template.tpl`, loader URLs, queue contract and ACS fields.
|
|
393
|
+
* [Amazon Ads consent signal requirements](https://advertising.amazon.com/resources/ad-policy/consent-signal-requirements).
|
|
394
|
+
* [The live Amazon tag library](https://c.amazon-adsystem.com/aat/amzn.js) and [consent helper](https://c.amazon-adsystem.com/aat/amzn-consent.js), used to check the queue parser, consent updates and storage names.
|
|
395
|
+
* [Amazon Ads product terms](https://advertising.amazon.com/legal/product-terms), which name Amazon Advertising LLC and its affiliates. The legal entity for an account can depend on its agreement and region.
|
|
396
|
+
|
|
397
|
+
The account-console installation snippet requires an Amazon Ads login. This
|
|
398
|
+
guide follows Amazon's public template and downloaded libraries.
|
|
399
|
+
|
|
400
|
+
Test in a private window with an opt-in policy. Open DevTools Network, disable
|
|
401
|
+
the cache and filter by the vendor's domain:
|
|
402
|
+
|
|
403
|
+
1. Load the page. No request goes to the vendor before you choose.
|
|
404
|
+
2. Click Reject, then reload. There is still no vendor request.
|
|
405
|
+
3. Open Privacy settings and allow the helper's category. The vendor script
|
|
406
|
+
loads without a page reload.
|
|
407
|
+
4. Turn the category off again and save. c15t reloads the page, and the new
|
|
408
|
+
page makes no vendor request.
|
|
409
|
+
|
|
410
|
+
c15t reloads on revocation because removing a script element does not stop
|
|
411
|
+
code that already ran. The vendor's listeners, timers and queued events stay
|
|
412
|
+
alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
|
|
413
|
+
the vendor yourself. Register a callback-only script whose `onConsentChange`
|
|
414
|
+
calls the vendor's opt-out API, as shown in
|
|
415
|
+
[custom integrations](./building-integrations.md), and check the
|
|
416
|
+
permission before each of your own event calls. The reload does not delete
|
|
417
|
+
cookies the vendor already set; see
|
|
418
|
+
[clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
|
|
419
|
+
|
|
420
|
+
The helper lists its vendor by name in the preference dialog, so a visitor can
|
|
421
|
+
turn it off inside an allowed category. See
|
|
422
|
+
[vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
|
|
423
|
+
[consent verification guide](../guides/verify-consent.md) covers navigation,
|
|
424
|
+
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();
|