@c15t/nextjs 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +155 -0
- package/README.md +31 -15
- package/client/components/integrations.js +3 -0
- package/dist/components/integrations/index.cjs +1 -0
- package/dist/components/integrations/index.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/libs/browser-initial-data.cjs +1 -1
- package/dist/libs/initial-data.cjs +1 -1
- package/dist/styles.tw3.css +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist-types/components/integrations/index.d.ts +1 -0
- package/dist-types/libs/browser-initial-data.d.ts +1 -1
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +155 -73
- package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
- package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
- package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
- package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
- package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
- package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
- package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
- package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
- package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
- package/docs/{components → frameworks/next/components}/frame.md +8 -9
- package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
- package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
- package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
- package/docs/{headless.md → frameworks/next/headless.md} +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
- package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
- package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
- package/docs/frameworks/next/hooks/use-translations.md +55 -0
- package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
- package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
- package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
- package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
- package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
- package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
- package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
- package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
- package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
- package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
- package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
- package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
- package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
- package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
- package/docs/frameworks/next/styling/css-variables.md +53 -0
- package/docs/frameworks/next/styling/overview.md +299 -0
- package/docs/frameworks/next/styling/slots.md +94 -0
- package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
- package/docs/frameworks/next/styling/tokens.md +156 -0
- package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +15 -82
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +15 -181
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +15 -83
- package/docs/integrations/crisp.md +13 -87
- package/docs/integrations/databuddy.md +16 -85
- package/docs/integrations/fathom-analytics.md +15 -86
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +18 -86
- package/docs/integrations/google-tag.md +15 -84
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +15 -83
- package/docs/integrations/intercom.md +13 -83
- package/docs/integrations/linkedin-insights.md +15 -82
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +13 -88
- package/docs/integrations/meta-pixel.md +33 -316
- package/docs/integrations/microsoft-clarity.md +15 -83
- package/docs/integrations/microsoft-uet.md +16 -83
- package/docs/integrations/mixpanel-analytics.md +15 -83
- package/docs/integrations/overview.md +55 -6
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +14 -97
- package/docs/integrations/posthog.md +26 -98
- package/docs/integrations/promptwatch.md +16 -82
- package/docs/integrations/reddit-pixel.md +27 -122
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +15 -94
- package/docs/integrations/segment.md +15 -82
- package/docs/integrations/snapchat-pixel.md +21 -102
- package/docs/integrations/tiktok-pixel.md +13 -81
- package/docs/integrations/umami-analytics.md +16 -88
- package/docs/integrations/vercel-analytics.md +13 -85
- package/docs/integrations/x-pixel.md +27 -102
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/concepts/client-modes.md +103 -0
- package/docs/shared/concepts/consent-categories.md +41 -0
- package/docs/shared/concepts/consent-models.md +72 -0
- package/docs/shared/concepts/cookie-management.md +88 -0
- package/docs/shared/concepts/glossary.md +24 -0
- package/docs/shared/concepts/initialization-flow.md +105 -0
- package/docs/shared/concepts/policy-packs.md +225 -0
- package/docs/shared/react/components/consent-banner.md +242 -0
- package/docs/shared/react/components/consent-dialog-link.md +45 -0
- package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
- package/docs/shared/react/components/consent-dialog.md +119 -0
- package/docs/shared/react/components/consent-manager-provider.md +225 -0
- package/docs/shared/react/components/consent-widget.md +121 -0
- package/docs/shared/react/components/dev-tools.md +81 -0
- package/docs/shared/react/components/frame.md +52 -0
- package/docs/shared/react/guides/building-headless-components.md +110 -0
- package/docs/shared/react/guides/callbacks.md +89 -0
- package/docs/shared/react/guides/headless.md +31 -0
- package/docs/shared/react/guides/iframe-blocking.md +65 -0
- package/docs/shared/react/guides/internationalization.md +123 -0
- package/docs/shared/react/guides/network-blocker.md +72 -0
- package/docs/shared/react/guides/optimization.md +44 -0
- package/docs/shared/react/guides/policy-packs.md +173 -0
- package/docs/shared/react/guides/script-loader.md +311 -0
- package/docs/shared/react/hooks/use-color-scheme.md +31 -0
- package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
- package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
- package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
- package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
- package/docs/shared/react/hooks/use-draggable.md +30 -0
- package/docs/shared/react/hooks/use-focus-trap.md +20 -0
- package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
- package/docs/shared/react/hooks/use-ssr-status.md +16 -0
- package/docs/shared/react/hooks/use-text-direction.md +38 -0
- package/docs/shared/react/hooks/use-translations.md +15 -0
- package/docs/shared/react/iab/consent-banner.md +60 -0
- package/docs/shared/react/iab/consent-dialog.md +76 -0
- package/docs/shared/react/iab/overview.md +80 -0
- package/docs/shared/react/iab/use-gvl-data.md +21 -0
- package/docs/shared/react/styling/classnames.md +93 -0
- package/docs/shared/react/styling/color-scheme.md +35 -0
- package/docs/shared/react/styling/css-variables.md +53 -0
- package/docs/shared/react/styling/overview.md +261 -0
- package/docs/shared/react/styling/slots.md +93 -0
- package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
- package/docs/shared/react/styling/tailwind.md +88 -0
- package/docs/shared/react/styling/tokens.md +155 -0
- package/docs/shared/troubleshooting.md +82 -0
- package/package.json +19 -10
- package/readme.json +14 -8
- package/docs/ai-agents.md +0 -111
- package/docs/components/consent-dialog-trigger.md +0 -103
- package/docs/components/consent-manager-provider.md +0 -425
- package/docs/hooks/use-consent-manager/overview.md +0 -420
- package/docs/hooks/use-translations.md +0 -118
- package/docs/styling/css-variables.md +0 -92
- package/docs/styling/overview.md +0 -457
- package/docs/styling/slots.md +0 -128
- package/docs/styling/tokens.md +0 -216
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: RudderStack
|
|
3
|
+
description: Load RudderStack's JavaScript SDK with c15t and gate the browser
|
|
4
|
+
SDK behind measurement consent.
|
|
5
|
+
group: integrations
|
|
6
|
+
icon: rudderstack
|
|
7
|
+
---
|
|
8
|
+
[RudderStack](https://www.rudderstack.com/) collects customer data from websites and routes it through your RudderStack data plane to downstream destinations. The `rudderstack()` helper creates RudderStack's `window.rudderanalytics` v3 queue, queues the required `load()` call with your write key and data plane URL, optionally queues the initial `page()` call, and loads the browser SDK when `measurement` consent is available.
|
|
9
|
+
|
|
10
|
+
## Integrate with c15t
|
|
11
|
+
|
|
12
|
+
**React**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import { ConsentManagerProvider } from '@c15t/react';
|
|
17
|
+
import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
18
|
+
|
|
19
|
+
const scripts = [
|
|
20
|
+
rudderstack({
|
|
21
|
+
writeKey: 'WRITE_KEY',
|
|
22
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
23
|
+
}),
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export function ConsentProvider({ children }: { children: ReactNode }) {
|
|
27
|
+
return (
|
|
28
|
+
<ConsentManagerProvider
|
|
29
|
+
options={{
|
|
30
|
+
mode: 'hosted',
|
|
31
|
+
backendURL: 'https://your-instance.c15t.dev',
|
|
32
|
+
scripts,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</ConsentManagerProvider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Next.js**
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
'use client';
|
|
45
|
+
|
|
46
|
+
import { type ReactNode } from 'react';
|
|
47
|
+
import { ConsentManagerProvider } from '@c15t/nextjs';
|
|
48
|
+
import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
49
|
+
|
|
50
|
+
const scripts = [
|
|
51
|
+
rudderstack({
|
|
52
|
+
writeKey: 'WRITE_KEY',
|
|
53
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
54
|
+
}),
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export function ConsentProvider({ children }: { children: ReactNode }) {
|
|
58
|
+
return (
|
|
59
|
+
<ConsentManagerProvider
|
|
60
|
+
options={{
|
|
61
|
+
mode: 'hosted',
|
|
62
|
+
backendURL: '/api/c15t',
|
|
63
|
+
scripts,
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</ConsentManagerProvider>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**JavaScript**
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { getOrCreateConsentRuntime } from 'c15t';
|
|
76
|
+
import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
77
|
+
|
|
78
|
+
getOrCreateConsentRuntime({
|
|
79
|
+
mode: 'hosted',
|
|
80
|
+
backendURL: 'https://your-instance.c15t.dev',
|
|
81
|
+
scripts: [
|
|
82
|
+
rudderstack({
|
|
83
|
+
writeKey: 'WRITE_KEY',
|
|
84
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## How c15t loads it
|
|
91
|
+
|
|
92
|
+
* **Category:** `measurement` (Analytics)
|
|
93
|
+
* **Loads when:** measurement consent is granted
|
|
94
|
+
* **On revocation:** unloaded - c15t removes the script element from the DOM and clears RudderStack globals until consent is granted again.
|
|
95
|
+
|
|
96
|
+
The helper maps RudderStack's v3 browser snippet into the manifest engine:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
rudderstack({
|
|
100
|
+
writeKey: 'WRITE_KEY',
|
|
101
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
It creates `window.rudderanalytics`, defines the v3 snippet queue methods, queues:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
window.rudderanalytics.load(
|
|
109
|
+
'WRITE_KEY',
|
|
110
|
+
'https://example.dataplane.rudderstack.com',
|
|
111
|
+
{}
|
|
112
|
+
);
|
|
113
|
+
window.rudderanalytics.page();
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
and loads:
|
|
117
|
+
|
|
118
|
+
```txt
|
|
119
|
+
https://cdn.rudderlabs.com/v3/modern/rsa.min.js
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`writeKey` and `dataPlaneUrl` are both required and must be non-empty strings after trimming. `dataPlaneUrl` must be a valid HTTPS URL.
|
|
123
|
+
|
|
124
|
+
## Configure load options
|
|
125
|
+
|
|
126
|
+
Pass `loadOptions` to provide RudderStack SDK options as the third `load()` argument. Values must be JSON-serializable: plain objects, arrays, strings, numbers, booleans, and `null`.
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
130
|
+
|
|
131
|
+
rudderstack({
|
|
132
|
+
writeKey: 'WRITE_KEY',
|
|
133
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
134
|
+
loadOptions: {
|
|
135
|
+
useBeacon: true,
|
|
136
|
+
plugins: ['BeaconQueue'],
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Do not pass functions, Dates, Maps, Sets, class instances, symbols, or other non-JSON values in `loadOptions`.
|
|
142
|
+
|
|
143
|
+
## Configure page tracking
|
|
144
|
+
|
|
145
|
+
By default the helper queues `rudderanalytics.page()` before the vendor bundle loads. If you want to handle page views yourself, set `trackPageView` to `false`.
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
rudderstack({
|
|
149
|
+
writeKey: 'WRITE_KEY',
|
|
150
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
151
|
+
trackPageView: false,
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
To proxy or self-host the loader, pass a custom URL:
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
rudderstack({
|
|
159
|
+
writeKey: 'WRITE_KEY',
|
|
160
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
161
|
+
scriptUrl: 'https://analytics.example.com/rsa.min.js',
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Consent behavior
|
|
166
|
+
|
|
167
|
+
RudderStack exposes a `consent()` API for its own consent-management flow and pre-consent event handling. That API is not a simple runtime opt-out or revocation API for c15t to call after a user withdraws `measurement` consent.
|
|
168
|
+
|
|
169
|
+
c15t therefore uses the post-consent model recommended by RudderStack's docs: it does not load the SDK until `measurement` consent is granted, and it unloads the script if that consent is later revoked.
|
|
170
|
+
|
|
171
|
+
### Why c15t blocks the load instead of mapping consent into RudderStack
|
|
172
|
+
|
|
173
|
+
Some integrations — Google Tag Manager is the clearest example — load immediately and receive c15t's consent state through the vendor's own consent API (Google Consent Mode v2). That model is only safe when the vendor API provides denied-by-default semantics where **nothing identifying is stored or transmitted before consent**.
|
|
174
|
+
|
|
175
|
+
Loading the RudderStack SDK does not provide that guarantee on its own: once loaded normally it writes its `anonymousId` cookie and delivers events to your data plane, and the `consent()` API filters which downstream *destinations* receive those events rather than preventing collection. Even RudderStack's pre-consent mode defaults to `events.delivery: 'immediate'`, which still sends pre-decision events. "Loaded but consent-filtered" is still collection, so c15t treats blocking the load as the only default that reliably honors a missing or denied `measurement` consent.
|
|
176
|
+
|
|
177
|
+
RudderStack v3 does offer a pre-consent mode (`preConsent` load options with storage disabled and buffered delivery) designed for CMP integrations, which allows a GTM-style flow. c15t supports it as an explicit opt-in — see below. It is not the default because it runs vendor code before consent and depends on vendor-side configuration (consent IDs on every destination) that c15t cannot verify from the browser.
|
|
178
|
+
|
|
179
|
+
The same reasoning applies to the other customer-data-platform helpers (Segment, Hightouch): their consent surfaces are destination filters, not collection gates, so those helpers block the load too.
|
|
180
|
+
|
|
181
|
+
### Opt-in: pre-consent mode with consent ID mapping
|
|
182
|
+
|
|
183
|
+
Pass `consentManagement` to make c15t the consent provider for RudderStack's pre-consent flow:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
187
|
+
|
|
188
|
+
rudderstack({
|
|
189
|
+
writeKey: 'WRITE_KEY',
|
|
190
|
+
dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
191
|
+
consentManagement: {
|
|
192
|
+
// c15t category → RudderStack consent IDs (from your destination settings)
|
|
193
|
+
mapping: {
|
|
194
|
+
measurement: ['product-analytics'],
|
|
195
|
+
marketing: ['ad-destinations'],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
In this mode:
|
|
202
|
+
|
|
203
|
+
* The SDK loads immediately for every visitor, but **inert**: `preConsent` is enabled with storage strategy `none` (no cookies, no localStorage) and buffered event delivery — nothing reaches your data plane before a consent decision.
|
|
204
|
+
* On every consent decision and change, c15t calls `rudderanalytics.consent()` with `allowedConsentIds`/`deniedConsentIds` partitioned from your mapping. The initial signal is queued before the SDK loads, so consent state is known the moment the SDK initializes.
|
|
205
|
+
* Consent revocation re-signals with the denied IDs instead of unloading the script.
|
|
206
|
+
|
|
207
|
+
**Event attribution.** This is the reason to opt in: events fired before the user interacts with the consent banner (the initial `page()` call, early product events) are buffered and delivered once consent is granted, so consenting users keep their full journey. In the default blocked-load mode those pre-consent events are simply lost. If you want session stitching across the consent boundary as well, pass your own `preConsent` in `loadOptions` with storage strategy `'session'` — c15t keeps your storage choice but always forces `preConsent.enabled`, buffered event delivery, and the `custom` consent provider, since any of those falling back to SDK defaults would leak pre-consent events.
|
|
208
|
+
|
|
209
|
+
**Requirements and caveats:**
|
|
210
|
+
|
|
211
|
+
* Every destination in your RudderStack workspace must be assigned the consent IDs used in the mapping. Destinations without consent IDs receive events regardless of consent — that is RudderStack behavior c15t cannot detect or prevent from the browser.
|
|
212
|
+
* Users who never consent have their buffered events discarded; nothing is persisted for them.
|
|
213
|
+
* The daily [script vendor monitor](https://github.com/c15t/c15t/issues/899) probes this mode against the live SDK: it loads RudderStack with denied consent in a real browser and asserts zero data plane requests and zero `rl_*` storage, so a vendor-side change to pre-consent semantics is caught automatically.
|
|
214
|
+
|
|
215
|
+
### Choosing a consent model for CDPs
|
|
216
|
+
|
|
217
|
+
* **Default (blocked load)** — strictest interpretation of consent; no vendor code runs pre-consent. Pre-consent events are lost. Right when compliance posture outweighs attribution.
|
|
218
|
+
* **Pre-consent mode (`consentManagement`)** — vendor-sanctioned CMP flow; pre-consent events are buffered and attributed for consenting users. Requires disciplined destination consent-ID configuration and accepts vendor code running before consent, with the live monitor verifying its inertness daily.
|
|
219
|
+
|
|
220
|
+
## Tracking events in your app
|
|
221
|
+
|
|
222
|
+
c15t gates the RudderStack browser SDK from loading until `measurement` consent is granted. Your application code that calls RudderStack's runtime API (`window.rudderanalytics.track`, `identify`, etc.) is **not** automatically gated - `window.rudderanalytics` does not exist until the script is loaded, so unguarded calls before consent throw.
|
|
223
|
+
|
|
224
|
+
Guard event calls by checking consent state. From React:
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import { useCallback } from 'react';
|
|
228
|
+
import { useConsentManager } from '@c15t/react';
|
|
229
|
+
|
|
230
|
+
function SignupExample() {
|
|
231
|
+
const { has } = useConsentManager();
|
|
232
|
+
|
|
233
|
+
const trackSignup = useCallback(() => {
|
|
234
|
+
if (has('measurement')) {
|
|
235
|
+
window.rudderanalytics?.track('Signup Completed', { plan: 'pro' });
|
|
236
|
+
}
|
|
237
|
+
}, [has]);
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
From plain JavaScript:
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
import { getOrCreateConsentRuntime } from 'c15t';
|
|
245
|
+
|
|
246
|
+
const { consentStore } = getOrCreateConsentRuntime();
|
|
247
|
+
|
|
248
|
+
if (consentStore.getState().has('measurement')) {
|
|
249
|
+
window.rudderanalytics?.track('Signup Completed', { plan: 'pro' });
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Types
|
|
254
|
+
|
|
255
|
+
### RudderStackOptions
|
|
256
|
+
|
|
257
|
+
|Property|Value|
|
|
258
|
+
|:--|:--|
|
|
259
|
+
|Type Name|\`RudderStackOptions\`|
|
|
260
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/rudderstack.ts\`|
|
|
261
|
+
|
|
262
|
+
\*ExtractedTypeTable: Could not extract "RudderStackOptions" from "./packages/scripts/src/vendors/analytics/rudderstack.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
263
|
+
|
|
264
|
+
### Script
|
|
265
|
+
|
|
266
|
+
|Property|Value|
|
|
267
|
+
|:--|:--|
|
|
268
|
+
|Type Name|\`Script\`|
|
|
269
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
270
|
+
|
|
271
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Rybbit Analytics
|
|
3
|
-
description: Privacy-friendly analytics with script-tag configuration via
|
|
4
|
-
|
|
3
|
+
description: Privacy-friendly analytics with script-tag configuration via
|
|
4
|
+
Rybbit's data attributes.
|
|
5
|
+
group: integrations
|
|
5
6
|
icon: rybbit-analytics
|
|
6
7
|
---
|
|
7
8
|
Rybbit Analytics loads through `@c15t/scripts` and configures tracking behavior via `data-*` attributes on the script element.
|
|
@@ -125,98 +126,18 @@ if (consentStore.getState().has('measurement')) {
|
|
|
125
126
|
|
|
126
127
|
### RybbitAnalyticsOptions
|
|
127
128
|
|
|
128
|
-
|Property|
|
|
129
|
-
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|trackOutbound|boolean \|undefined|Track outbound link clicks.|-|Optional|
|
|
135
|
-
|trackErrors|boolean \|undefined|Track JavaScript errors.|-|Optional|
|
|
136
|
-
|sessionReplay|boolean \|undefined|Enable session replay.|-|Optional|
|
|
137
|
-
|webVitals|boolean \|undefined|Enable Web Vitals tracking.|-|Optional|
|
|
138
|
-
|skipPatterns|string\[] \|undefined|URL patterns to skip from tracking.|-|Optional|
|
|
139
|
-
|maskPatterns|string\[] \|undefined|URL patterns to mask in tracked data.|-|Optional|
|
|
140
|
-
|debounce|number \|undefined|Debounce interval for pageview tracking.|-|Optional|
|
|
141
|
-
|apiKey|string \|undefined|API key for authenticated tracking.|-|Optional|
|
|
142
|
-
|analyticsHost|string \|undefined|Override the analytics host URL.|-|Optional|
|
|
143
|
-
|scriptUrl|string \|undefined|Custom loader URL.|-|Optional|
|
|
129
|
+
|Property|Value|
|
|
130
|
+
|:--|:--|
|
|
131
|
+
|Type Name|\`RybbitAnalyticsOptions\`|
|
|
132
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/rybbit-analytics.ts\`|
|
|
133
|
+
|
|
134
|
+
\*ExtractedTypeTable: Could not extract "RybbitAnalyticsOptions" from "./packages/scripts/src/vendors/analytics/rybbit-analytics.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
144
135
|
|
|
145
136
|
### Script
|
|
146
137
|
|
|
147
|
-
|Property|
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|src
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
154
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
155
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
156
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
157
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
158
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
159
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
160
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
161
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
162
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
163
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
164
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
165
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
166
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
167
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
168
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
169
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
170
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
171
|
-
|
|
172
|
-
#### `onBeforeLoad`
|
|
173
|
-
|
|
174
|
-
Callback executed before the script is loaded
|
|
175
|
-
|
|
176
|
-
|Property|Type|Description|Default|Required|
|
|
177
|
-
|:--|:--|:--|:--|:--:|
|
|
178
|
-
|id|string|The original script ID|-|✅ Required|
|
|
179
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
180
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
181
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
182
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
183
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
184
|
-
|
|
185
|
-
#### `onLoad`
|
|
186
|
-
|
|
187
|
-
Callback executed when the script loads successfully
|
|
188
|
-
|
|
189
|
-
|Property|Type|Description|Default|Required|
|
|
190
|
-
|:--|:--|:--|:--|:--:|
|
|
191
|
-
|id|string|The original script ID|-|✅ Required|
|
|
192
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
193
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
194
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
195
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
196
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
197
|
-
|
|
198
|
-
#### `onError`
|
|
199
|
-
|
|
200
|
-
Callback executed if the script fails to load
|
|
201
|
-
|
|
202
|
-
|Property|Type|Description|Default|Required|
|
|
203
|
-
|:--|:--|:--|:--|:--:|
|
|
204
|
-
|id|string|The original script ID|-|✅ Required|
|
|
205
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
206
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
207
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
208
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
209
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
210
|
-
|
|
211
|
-
#### `onConsentChange`
|
|
212
|
-
|
|
213
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
214
|
-
|
|
215
|
-
|Property|Type|Description|Default|Required|
|
|
216
|
-
|:--|:--|:--|:--|:--:|
|
|
217
|
-
|id|string|The original script ID|-|✅ Required|
|
|
218
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
219
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
220
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
221
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
222
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
138
|
+
|Property|Value|
|
|
139
|
+
|:--|:--|
|
|
140
|
+
|Type Name|\`Script\`|
|
|
141
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
142
|
+
|
|
143
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Segment
|
|
3
3
|
description: Load Segment Analytics.js with c15t and gate it behind measurement consent.
|
|
4
|
-
|
|
4
|
+
group: integrations
|
|
5
5
|
icon: segment
|
|
6
6
|
---
|
|
7
7
|
Segment lets you collect analytics events in one place and forward them to downstream destinations. The `segment()` helper creates Segment's standard `window.analytics` queue, optionally queues the initial `page()` call, and loads Analytics.js when `measurement` consent is available.
|
|
@@ -77,6 +77,8 @@ getOrCreateConsentRuntime({
|
|
|
77
77
|
* **Loads when:** measurement consent is granted
|
|
78
78
|
* **On revocation:** unloaded - c15t removes the script from the DOM and clears Segment globals until consent is granted again.
|
|
79
79
|
|
|
80
|
+
c15t deliberately blocks the load rather than mapping consent into Segment's consent tooling: Segment's consent object and consent wrappers control which downstream destinations receive events, but Analytics.js itself still writes identifiers and delivers events to Segment once loaded. Gating the load is the only default that reliably honors missing or denied `measurement` consent. See the [RudderStack consent notes](/docs/integrations/rudderstack#consent-behavior) for the full reasoning behind this model versus vendor consent-API mapping (as used for Google Tag Manager).
|
|
81
|
+
|
|
80
82
|
## Configure the integration
|
|
81
83
|
|
|
82
84
|
By default the helper queues `analytics.page()` before the vendor bundle loads. If you want to handle page views yourself, set `trackPageView` to `false`.
|
|
@@ -127,87 +129,18 @@ if (consentStore.getState().has('measurement')) {
|
|
|
127
129
|
|
|
128
130
|
### SegmentOptions
|
|
129
131
|
|
|
130
|
-
|Property|
|
|
131
|
-
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
132
|
+
|Property|Value|
|
|
133
|
+
|:--|:--|
|
|
134
|
+
|Type Name|\`SegmentOptions\`|
|
|
135
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/segment.ts\`|
|
|
136
|
+
|
|
137
|
+
\*ExtractedTypeTable: Could not extract "SegmentOptions" from "./packages/scripts/src/vendors/analytics/segment.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
135
138
|
|
|
136
139
|
### Script
|
|
137
140
|
|
|
138
|
-
|Property|
|
|
139
|
-
|
|
140
|
-
|
|
|
141
|
-
|src
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
145
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
146
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
147
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
148
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
149
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
150
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
151
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
152
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
153
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
154
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
155
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
156
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
157
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
158
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
159
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
160
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
161
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
162
|
-
|
|
163
|
-
#### `onBeforeLoad`
|
|
164
|
-
|
|
165
|
-
Callback executed before the script is loaded
|
|
166
|
-
|
|
167
|
-
|Property|Type|Description|Default|Required|
|
|
168
|
-
|:--|:--|:--|:--|:--:|
|
|
169
|
-
|id|string|The original script ID|-|✅ Required|
|
|
170
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
171
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
172
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
173
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
174
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
175
|
-
|
|
176
|
-
#### `onLoad`
|
|
177
|
-
|
|
178
|
-
Callback executed when the script loads successfully
|
|
179
|
-
|
|
180
|
-
|Property|Type|Description|Default|Required|
|
|
181
|
-
|:--|:--|:--|:--|:--:|
|
|
182
|
-
|id|string|The original script ID|-|✅ Required|
|
|
183
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
184
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
185
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
186
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
187
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
188
|
-
|
|
189
|
-
#### `onError`
|
|
190
|
-
|
|
191
|
-
Callback executed if the script fails to load
|
|
192
|
-
|
|
193
|
-
|Property|Type|Description|Default|Required|
|
|
194
|
-
|:--|:--|:--|:--|:--:|
|
|
195
|
-
|id|string|The original script ID|-|✅ Required|
|
|
196
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
197
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
198
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
199
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
200
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
201
|
-
|
|
202
|
-
#### `onConsentChange`
|
|
203
|
-
|
|
204
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
205
|
-
|
|
206
|
-
|Property|Type|Description|Default|Required|
|
|
207
|
-
|:--|:--|:--|:--|:--:|
|
|
208
|
-
|id|string|The original script ID|-|✅ Required|
|
|
209
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
210
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
211
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
212
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
213
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
141
|
+
|Property|Value|
|
|
142
|
+
|:--|:--|
|
|
143
|
+
|Type Name|\`Script\`|
|
|
144
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
145
|
+
|
|
146
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Snapchat Pixel
|
|
3
|
-
description: Measure Snapchat ad performance and build remarketing audiences
|
|
4
|
-
|
|
3
|
+
description: Measure Snapchat ad performance and build remarketing audiences
|
|
4
|
+
with a prebuilt pixel helper.
|
|
5
|
+
group: integrations
|
|
5
6
|
icon: snapchat
|
|
6
7
|
---
|
|
7
8
|
Snapchat Pixel is Snapchat's website conversion tracking and audience-building tool. The `snapchatPixel()` helper seeds the `snaptr` queue, initializes your pixel, and by default tracks a `PAGE_VIEW` event as soon as `marketing` consent is available.
|
|
@@ -136,109 +137,27 @@ if (consentStore.getState().has('marketing')) {
|
|
|
136
137
|
|
|
137
138
|
### SnapchatPixelOptions
|
|
138
139
|
|
|
139
|
-
|Property|
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
|Property|Value|
|
|
141
|
+
|:--|:--|
|
|
142
|
+
|Type Name|\`SnapchatPixelOptions\`|
|
|
143
|
+
|Source Path|\`./packages/scripts/src/vendors/ads-and-pixels/snapchat-pixel.ts\`|
|
|
144
|
+
|
|
145
|
+
\*ExtractedTypeTable: Could not extract "SnapchatPixelOptions" from "./packages/scripts/src/vendors/ads-and-pixels/snapchat-pixel.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
145
146
|
|
|
146
147
|
### SnapchatPixelEventProperties
|
|
147
148
|
|
|
148
|
-
|Property|
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|item\_ids|string\[] \|undefined|Product, SKU, or content identifiers associated with the event.|-|Optional|
|
|
155
|
-
|item\_category|string \|undefined|Product or content category associated with the event.|-|Optional|
|
|
156
|
-
|description|string \|undefined|Free-form description for the event.|-|Optional|
|
|
157
|
-
|search\_string|string \|undefined|Query text for \`SEARCH\` events.|-|Optional|
|
|
158
|
-
|number\_items|number \|undefined|Number of items represented by the event.|-|Optional|
|
|
159
|
-
|payment\_info\_available|0 \|1 \|undefined|Whether payment information was available, represented as \`0\` or \`1\`.|-|Optional|
|
|
160
|
-
|sign\_up\_method|string \|undefined|Signup method for \`SIGN\_UP\` events.|-|Optional|
|
|
161
|
-
|success|0 \|1 \|undefined|Whether the action succeeded, represented as \`0\` or \`1\`.|-|Optional|
|
|
162
|
-
|brands|string\[] \|undefined|Brand names associated with the event contents.|-|Optional|
|
|
163
|
-
|delivery\_method|"in\_store" \|"curbside" \|"delivery" \|undefined|Fulfillment method for commerce events.|-|Optional|
|
|
164
|
-
|customer\_status|"new" \|"returning" \|"reactivated" \|undefined|Customer lifecycle status associated with the event.|-|Optional|
|
|
165
|
-
|event\_tag|string \|undefined|Optional custom tag for event segmentation in Snapchat.|-|Optional|
|
|
149
|
+
|Property|Value|
|
|
150
|
+
|:--|:--|
|
|
151
|
+
|Type Name|\`SnapchatPixelEventProperties\`|
|
|
152
|
+
|Source Path|\`./packages/scripts/src/vendors/ads-and-pixels/snapchat-pixel.ts\`|
|
|
153
|
+
|
|
154
|
+
\*ExtractedTypeTable: Could not extract "SnapchatPixelEventProperties" from "./packages/scripts/src/vendors/ads-and-pixels/snapchat-pixel.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
166
155
|
|
|
167
156
|
### Script
|
|
168
157
|
|
|
169
|
-
|Property|
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|src
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
176
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
177
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
178
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
179
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
180
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
181
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
182
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
183
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
184
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
185
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
186
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
187
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
188
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
189
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
190
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
191
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
192
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
193
|
-
|
|
194
|
-
#### `onBeforeLoad`
|
|
195
|
-
|
|
196
|
-
Callback executed before the script is loaded
|
|
197
|
-
|
|
198
|
-
|Property|Type|Description|Default|Required|
|
|
199
|
-
|:--|:--|:--|:--|:--:|
|
|
200
|
-
|id|string|The original script ID|-|✅ Required|
|
|
201
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
202
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
203
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
204
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
205
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
206
|
-
|
|
207
|
-
#### `onLoad`
|
|
208
|
-
|
|
209
|
-
Callback executed when the script loads successfully
|
|
210
|
-
|
|
211
|
-
|Property|Type|Description|Default|Required|
|
|
212
|
-
|:--|:--|:--|:--|:--:|
|
|
213
|
-
|id|string|The original script ID|-|✅ Required|
|
|
214
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
215
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
216
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
217
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
218
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
219
|
-
|
|
220
|
-
#### `onError`
|
|
221
|
-
|
|
222
|
-
Callback executed if the script fails to load
|
|
223
|
-
|
|
224
|
-
|Property|Type|Description|Default|Required|
|
|
225
|
-
|:--|:--|:--|:--|:--:|
|
|
226
|
-
|id|string|The original script ID|-|✅ Required|
|
|
227
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
228
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
229
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
230
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
231
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
232
|
-
|
|
233
|
-
#### `onConsentChange`
|
|
234
|
-
|
|
235
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
236
|
-
|
|
237
|
-
|Property|Type|Description|Default|Required|
|
|
238
|
-
|:--|:--|:--|:--|:--:|
|
|
239
|
-
|id|string|The original script ID|-|✅ Required|
|
|
240
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
241
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
242
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
243
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
244
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
158
|
+
|Property|Value|
|
|
159
|
+
|:--|:--|
|
|
160
|
+
|Type Name|\`Script\`|
|
|
161
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
162
|
+
|
|
163
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|