@c15t/react 3.2.0-canary.0 → 3.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.
Files changed (50) hide show
  1. package/AGENTS.md +33 -10
  2. package/README.md +5 -7
  3. package/dist/styles.tw3.css +2 -2
  4. package/dist/version.js +1 -1
  5. package/dist-types/version.d.ts +1 -1
  6. package/docs/README.md +33 -10
  7. package/docs/concepts/choose-your-setup.md +8 -9
  8. package/docs/concepts/modes.md +5 -3
  9. package/docs/customization/stylesheets.md +39 -0
  10. package/docs/frameworks/react/hooks.md +2 -1
  11. package/docs/frameworks/react/quickstart.md +3 -3
  12. package/docs/frameworks/react/upgrade-v3.md +2 -2
  13. package/docs/integrations/activecampaign.md +297 -0
  14. package/docs/integrations/ada.md +396 -0
  15. package/docs/integrations/adobe-target.md +460 -0
  16. package/docs/integrations/adroll.md +336 -0
  17. package/docs/integrations/amazon-ads.md +424 -0
  18. package/docs/integrations/appcues.md +368 -0
  19. package/docs/integrations/attentive.md +313 -0
  20. package/docs/integrations/building-integrations.md +29 -16
  21. package/docs/integrations/clearbit.md +1 -1
  22. package/docs/integrations/customer-io.md +369 -0
  23. package/docs/integrations/databuddy.md +139 -50
  24. package/docs/integrations/default-com.md +497 -0
  25. package/docs/integrations/dynamic-yield.md +373 -0
  26. package/docs/integrations/fullstory.md +298 -0
  27. package/docs/integrations/gainsight-px.md +418 -0
  28. package/docs/integrations/gorgias.md +365 -0
  29. package/docs/integrations/hubspot.md +529 -0
  30. package/docs/integrations/insider.md +550 -0
  31. package/docs/integrations/liveintent.md +327 -0
  32. package/docs/integrations/lucky-orange.md +336 -0
  33. package/docs/integrations/marketo.md +309 -0
  34. package/docs/integrations/optimizely.md +411 -0
  35. package/docs/integrations/oracle-eloqua.md +301 -0
  36. package/docs/integrations/overview.md +124 -111
  37. package/docs/integrations/pendo.md +339 -0
  38. package/docs/integrations/rb2b.md +363 -0
  39. package/docs/integrations/salesforce-pardot.md +342 -0
  40. package/docs/integrations/statable-analytics.md +345 -0
  41. package/docs/integrations/the-trade-desk.md +328 -0
  42. package/docs/integrations/vector.md +333 -0
  43. package/docs/integrations/wisepops.md +416 -0
  44. package/docs/integrations/zendesk.md +359 -0
  45. package/package.json +8 -8
  46. package/docs/integrations/other-ads-and-pixels.md +0 -94
  47. package/docs/integrations/other-analytics.md +0 -108
  48. package/docs/integrations/other-chat-and-support.md +0 -112
  49. package/docs/integrations/other-email-and-sms.md +0 -156
  50. package/docs/integrations/other-experience.md +0 -222
@@ -1,112 +0,0 @@
1
- ---
2
- title: Other chat and support tools
3
- description: Consent-gated helpers for chat and support tools that don't need a full guide.
4
- icon: messages-square
5
- group: integrations
6
- ---
7
-
8
- Each helper below loads its vendor only after the visitor allows the listed consent category. For setup, see [Integrations overview](./overview.md).
9
-
10
- ## Ada
11
-
12
- Ada Messaging adds an Ada AI Agent chat widget to your site. Waits for
13
- `functionality` consent.
14
-
15
- ```ts title="src/consent-scripts.ts"
16
- import { ada } from '@c15t/integrations/ada';
17
-
18
- export const scripts = [ada({ handle: 'YOUR_ADA_HANDLE' })];
19
- ```
20
-
21
- | Option | Type | Required | Description |
22
- | --------- | -------- | -------- | -------------------------------------------------------------------------------------------------- |
23
- | `handle` | `string` | Yes | Your AI Agent's public handle, from your Ada team. A blank handle logs an error and nothing loads. |
24
- | `cluster` | `string` | No | Regional cluster, such as `eu`, `us2` or `maple`. Set it only when Ada gives you one. |
25
- | `domain` | `string` | No | Ada base-domain override. Set it only when Ada gives you one. |
26
-
27
- The helper imports Ada's Messaging Web SDK from
28
- `https://messaging-assets.ada.support/sdk.js` and keeps its interface private,
29
- so `window.adaEmbed` stays unset. Remove any other Ada snippet or `embed2.js`
30
- tag. Ada allows only one Messaging interface per page.
31
-
32
- **When consent is withdrawn:** the helper calls Ada's `stop()`, which removes
33
- the widget's frames. c15t then reloads the page to end any SDK work still
34
- running.
35
-
36
- * Use one Ada configuration per page.
37
- * Ada has no consent API. The helper can only start and stop the widget.
38
- * `stop()` doesn't erase stored conversations, tokens or cookies. The visitor's
39
- conversation can still be there after a reload.
40
- * An SDK import that has already started can't be cancelled. The helper skips
41
- starting the widget when it finishes, but the SDK can still write its own
42
- storage. Keep `reloadOnConsentRevoked` enabled.
43
-
44
- ## Gorgias Chat
45
-
46
- Gorgias Chat adds the Gorgias support chat widget to your store or site. Waits
47
- for `functionality` consent.
48
-
49
- ```ts title="src/consent-scripts.ts"
50
- import { gorgiasChat } from '@c15t/integrations/gorgias';
51
-
52
- export const scripts = [gorgiasChat({ appKey: 'YOUR_GORGIAS_APP_KEY' })];
53
- ```
54
-
55
- | Option | Type | Required | Description |
56
- | --------- | ---------- | -------- | --------------------------------------------------------------------------------------------------- |
57
- | `appKey` | `string` | Yes | Public app key from your Gorgias installation snippet. A blank key logs an error and nothing loads. |
58
- | `version` | `2` or `3` | No | Installation snippet version. Defaults to `3`. |
59
-
60
- Remove any other Gorgias snippet or store app installation, or Gorgias can load
61
- before consent. Without `measurement` consent, the helper calls
62
- `GorgiasChat.disableSegment()` when the widget is ready.
63
-
64
- **When consent is withdrawn:** c15t removes the loader and calls
65
- `disableSegment()` if the widget is ready. Gorgias has no shutdown API, so keep
66
- `reloadOnConsentRevoked` enabled. The page reload stops the widget.
67
-
68
- * Segment stays off for the rest of the page after `disableSegment()`, even if
69
- the visitor then grants `measurement`. Gorgias has no call to turn it back on.
70
- A reload with `measurement` allowed turns it back on.
71
- * The v3 snippet has the key at the end of
72
- `https://config.gorgias.chat/bundle-loader/YOUR_APP_KEY`. A v2 snippet uses
73
- `applicationId` instead. Pass that value as `appKey` with `version: 2`.
74
- * A placeholder or deleted key still returns HTTP 200, with only a warning
75
- that the installation is incorrect. Check that the widget appears to confirm
76
- the key works.
77
-
78
- ## Zendesk Messaging
79
-
80
- Zendesk Messaging adds the Zendesk support chat widget to your site. It doesn't
81
- cover Web Widget Classic. Waits for `functionality` consent.
82
-
83
- ```ts title="src/consent-scripts.ts"
84
- import { zendeskWidget } from '@c15t/integrations/zendesk';
85
-
86
- export const scripts = [zendeskWidget({ key: 'YOUR_ZENDESK_WIDGET_KEY' })];
87
- ```
88
-
89
- | Option | Type | Required | Description |
90
- | ---------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
91
- | `key` | `string` | Yes | Widget key from **Admin Center > Channels > Messaging and social > Messaging**, on the widget's **Installation** page. A blank key logs an error and nothing loads. |
92
- | `category` | Consent condition | No | Consent needed to load the widget. Defaults to `functionality`. |
93
-
94
- The helper passes consent to Zendesk's
95
- [cookie setting](https://developer.zendesk.com/api-reference/widget-messaging/web/core/#set-cookies)
96
- before the widget loads, and again on every consent change:
97
-
98
- | Consent | Zendesk cookie setting |
99
- | --------------------------------- | ---------------------- |
100
- | `functionality` and `measurement` | `all` |
101
- | `functionality` only | `functional` |
102
- | `functionality` withdrawn | `none` |
103
-
104
- **When consent is withdrawn:** the helper sends `none`. Zendesk hides the
105
- widget and deletes its local and session storage. c15t then reloads the page to
106
- stop the widget code that already ran.
107
-
108
- * Use one widget key per page. Zendesk has one global `zE` API, so two widgets
109
- on the same page control each other.
110
- * Removing the helper from your configuration doesn't clear the conversation.
111
- It sends no `none`. Revoke consent first if you need the widget storage
112
- cleared.
@@ -1,156 +0,0 @@
1
- ---
2
- title: Other email, SMS and marketing automation tools
3
- description: Consent-gated helpers for email, SMS and marketing automation tools
4
- that don't need a full guide.
5
- icon: mail
6
- group: integrations
7
- ---
8
-
9
- Each helper below loads its vendor only after the visitor allows the listed consent category. For setup, see [Integrations overview](./overview.md).
10
-
11
- ## Attentive
12
-
13
- Attentive shows SMS and email signup units and tracks on-site events for its marketing messages. Waits for `marketing` consent.
14
-
15
- ```ts title="src/consent-scripts.ts"
16
- import { attentiveTag } from '@c15t/integrations/attentive';
17
-
18
- export const scripts = [attentiveTag({ siteSlug: 'YOUR_SITE' })];
19
- ```
20
-
21
- | Option | Type | Required | Description |
22
- | ----------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
23
- | `siteSlug` | `string` | Yes | Site slug from your Attentive tag URL, `https://cdn.attn.tv/<siteSlug>/dtag.js`. Ask your Attentive contact if you don't have it. |
24
- | `scriptUrl` | `string` | No | Exact tag URL from Attentive or your proxy. |
25
-
26
- **When consent is withdrawn:** c15t reloads the page, and the next page does not load the tag. Attentive has no supported way to stop a running tag, so keep `reloadOnConsentRevoked` on.
27
-
28
- * Some Attentive identifiers, such as `__attentive_id`, last up to 390 days. The reload does not delete them.
29
-
30
- ## Customer.io
31
-
32
- Customer.io collects events and visitor identity on your site through its Data Pipelines JavaScript source, for use in its messaging. Waits for `marketing` consent.
33
-
34
- ```ts title="src/customer-io.ts"
35
- import { customerIo } from '@c15t/integrations/customer-io';
36
-
37
- export const scripts = [customerIo({ writeKey: 'YOUR_WRITE_KEY' })];
38
- ```
39
-
40
- | Option | Type | Required | Description |
41
- | ------------- | ------------------------- | -------- | ----------------------------------------------------------------- |
42
- | `writeKey` | `string` | Yes | Write key of your Data Pipelines JavaScript source. |
43
- | `region` | `'us'` or `'eu'` | No | Region of the source. Defaults to `us`. |
44
- | `loadOptions` | `Record<string, unknown>` | No | Options for the Customer.io loader, such as destination settings. |
45
- | `cdnUrl` | `string` | No | Origin of a proxy for the loader, source settings and SDK files. |
46
-
47
- **When consent is withdrawn:** the helper calls `cioanalytics.reset()` to clear the stored identity, and c15t reloads the page. `reset()` is not an opt-out. It does not stop the SDK or destination SDKs from sending, so keep `reloadOnConsentRevoked` on.
48
-
49
- * The helper sends the first `page()` call itself. It always sets `initialPageview` to `false`, even if you pass `true`.
50
- * `cdnUrl` moves only the loader, settings and SDK files to your proxy. To proxy collected events too, set `apiHost` for the `Customer.io Data Pipelines` integration in `loadOptions`:
51
-
52
- ```ts title="src/customer-io-proxy.ts"
53
- import { customerIo } from '@c15t/integrations/customer-io';
54
-
55
- export const proxiedScripts = [
56
- customerIo({
57
- cdnUrl: 'https://analytics.example.com',
58
- loadOptions: {
59
- integrations: {
60
- 'Customer.io Data Pipelines': {
61
- apiHost: 'collect.example.com/v1',
62
- protocol: 'https',
63
- },
64
- },
65
- },
66
- writeKey: 'YOUR_WRITE_KEY',
67
- }),
68
- ];
69
- ```
70
-
71
- ## Insider One
72
-
73
- Insider One runs personalized web campaigns and builds customer profiles from on-site behavior. Waits for `marketing` consent.
74
-
75
- ```ts title="src/consent-scripts.ts"
76
- import { insiderTag } from '@c15t/integrations/insider';
77
-
78
- export const scripts = [
79
- insiderTag({
80
- currency: 'GBP',
81
- pageType: {
82
- type: 'category',
83
- value: { breadcrumb: ['Clothing', 'Dresses'] },
84
- },
85
- partnerId: 'YOUR_PARTNER_ID',
86
- partnerName: 'yourpartner',
87
- }),
88
- ];
89
- ```
90
-
91
- | Option | Type | Required | Description |
92
- | ------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
93
- | `partnerName` | `string` | Yes | Public partner name from Insider. |
94
- | `partnerId` | `string` | Yes | Public partner ID from Insider. |
95
- | `user` | `Record<string, unknown>` | No | Current user attributes, such as `email`, `phone_number` and `custom`. Must be JSON-serializable. |
96
- | `currency` | `string` | No | Current currency, such as `'GBP'`. Set it on multi-currency sites. |
97
- | `pageType` | `InsiderPageType` | No | Page definition from Insider's Web SDK guide. Defaults to `{ type: 'other' }`. |
98
-
99
- **When consent is withdrawn:** the helper pushes `gdpr_optin: false`, a neutral `other` page and `init`, then c15t reloads the page. Insider has no unload method, so keep `reloadOnConsentRevoked` on.
100
-
101
- * The helper sets `gdpr_optin` from consent and overrides any value in `user`. If you push `user` data to `InsiderQueue` yourself, set `gdpr_optin` too, because Insider treats a missing value as `true`.
102
- * The helper does not deduplicate purchases. Set `pageType: { type: 'purchase', ... }` only when your backend claims that order ID for the first time. Use `{ type: 'other' }` when the confirmation page reloads or opens again.
103
-
104
- ## Marketo Munchkin
105
-
106
- Munchkin is Adobe Marketo's script for tracking known and anonymous leads on your site. Waits for `marketing` consent.
107
-
108
- ```ts title="src/marketo.ts"
109
- import { marketoMunchkin } from '@c15t/integrations/marketo';
110
-
111
- export const scripts = [marketoMunchkin({ munchkinId: 'AAA-BBB-CCC' })];
112
- ```
113
-
114
- | Option | Type | Required | Description |
115
- | ------------- | ------------------------- | -------- | --------------------------------------------------------------------- |
116
- | `munchkinId` | `string` | Yes | Account ID from Marketo's installation snippet. |
117
- | `initOptions` | `Record<string, unknown>` | No | Passed to `Munchkin.init`, for example `cookieAnon` or `anonymizeIP`. |
118
- | `category` | consent condition | No | Replaces the default `marketing` condition. |
119
- | `scriptUrl` | `string` | No | Custom or proxied loader URL. |
120
-
121
- **When consent is withdrawn:** c15t removes the loader and reloads the page. Munchkin has no API to stop tracking, so keep `reloadOnConsentRevoked` on.
122
-
123
- * `cookieAnon: false` stops Munchkin from creating cookies for new anonymous visitors. It is not a consent switch: visitors who already have a cookie are still tracked.
124
- * The `_mkto_trk` cookie lasts two years by default and survives the reload. The next page does not load Munchkin while consent is denied.
125
-
126
- ## Salesforce Account Engagement
127
-
128
- Account Engagement, formerly Pardot, tracks visitors and prospects for Salesforce B2B marketing. Waits for `marketing` consent.
129
-
130
- ```ts title="src/consent-scripts.ts"
131
- import { pardotTracking } from '@c15t/integrations/salesforce-pardot';
132
-
133
- export const scripts = [
134
- pardotTracking({
135
- piAId: '123456',
136
- piCId: '654321',
137
- piDomain: 'pi.pardot.com',
138
- }),
139
- ];
140
- ```
141
-
142
- Replace `pi.pardot.com` in the example with your verified tracker domain.
143
-
144
- | Option | Type | Required | Description |
145
- | ------------ | -------------------------- | --------------- | ----------------------------------------------------------------------------------------------------- |
146
- | `piAId` | `string` or `number` | Yes | Account ID from the tracking snippet. |
147
- | `piCId` | `string` or `number` | Yes | Campaign ID from the tracking snippet. |
148
- | `piDomain` | `string` | In consent mode | Verified tracker domain, without a scheme or path. |
149
- | `mode` | `'consent'` or `'classic'` | No | `consent`, the default, uses the Tracking and Consent API. `classic` loads the older `pd.js` snippet. |
150
- | `piHostname` | `string` | No | Tracker hostname in classic mode. Defaults to `pi.pardot.com`. |
151
-
152
- **When consent is withdrawn:** in consent mode, the helper calls `pdt('revokeConsent')`. Classic mode has no revoke call. Keep `reloadOnConsentRevoked` on in both modes, because the reload is what stops the running tracker.
153
-
154
- * Turn on the Tracking and Consent API in Account Engagement before you use consent mode.
155
- * Copy `piAId` and `piCId` from the generated snippet as they are. They already include Salesforce's +1000 offset, and the helper does not add it again.
156
- * Do not call `clearTrackingCookies` after `revokeConsent`. It also deletes the cookie that records the refusal, so later page views can be tracked.
@@ -1,222 +0,0 @@
1
- ---
2
- title: Experimentation and personalization tools
3
- description: Consent-gated helpers for experimentation and personalization tools
4
- that don't need a full guide.
5
- icon: flask-conical
6
- group: integrations
7
- ---
8
-
9
- Each helper below loads its vendor only after the visitor allows the listed consent category. For setup, see [Integrations overview](./overview.md).
10
-
11
- ## Adobe Target
12
-
13
- Adobe Target runs A/B tests and personalizes page content. Waits for
14
- `experience` consent. Pick one mode per page: your self-hosted at.js file, or
15
- Adobe Experience Platform Web SDK.
16
-
17
- ```ts title="src/consent-scripts.ts"
18
- import { adobeTarget } from '@c15t/integrations/adobe-target';
19
-
20
- export const scripts = [
21
- adobeTarget({
22
- mode: 'atjs',
23
- scriptUrl: '/scripts/at.js',
24
- targetGlobalSettings: { secureOnly: true },
25
- }),
26
- ];
27
- ```
28
-
29
- ```ts title="src/consent-scripts.ts"
30
- import { adobeTarget } from '@c15t/integrations/adobe-target';
31
-
32
- export const scripts = [
33
- adobeTarget({
34
- datastreamId: 'YOUR_DATASTREAM_ID',
35
- mode: 'websdk',
36
- orgId: 'YOUR_ORG_ID@AdobeOrg',
37
- version: '2.30.0',
38
- }),
39
- ];
40
- ```
41
-
42
- | Option | Type | Required | Description |
43
- | ---------------------- | ------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
44
- | `mode` | `'atjs' \|'websdk'` | Yes | Which Adobe SDK to load. |
45
- | `scriptUrl` | `string` | at.js | URL of your self-hosted at.js file. |
46
- | `targetGlobalSettings` | `object` | No | at.js settings such as `cookieDomain`, `secureOnly`, `bodyHidingEnabled` and `bodyHiddenStyle`. The helper always sets `optinEnabled: true`. |
47
- | `datastreamId` | `string` | Web SDK | ID of a Target-enabled datastream. |
48
- | `orgId` | `string` | Web SDK | Organization ID, including `@AdobeOrg`. |
49
- | `version` | `string` | Web SDK | Exact Web SDK version, `2.21.0` or later. |
50
- | `category` | `HasCondition` | No | Consent condition to wait for. Defaults to `'experience'`. |
51
-
52
- **When consent is withdrawn:** with at.js, the helper calls
53
- `adobe.optIn.deny(adobe.OptInCategories.TARGET)` if the Opt-in service is on
54
- the page. With Web SDK, it sends `setConsent` with `'out'`. Neither undoes
55
- content Target already changed, so keep `reloadOnConsentRevoked` on.
56
-
57
- Remove Adobe's prehiding snippet when you use this helper. Without it, visitors
58
- see the original page first, then Target's changes once consent allows the
59
- SDK to load.
60
-
61
- * at.js has no Adobe CDN, so host the file yourself. Its opt-in API comes from
62
- the Experience Cloud ID (ECID) Opt-in service, which the helper doesn't load.
63
- Without it, only the page reload stops at.js.
64
- * Web SDK needs version 2.21 or later. The helper configures the SDK and sends
65
- consent but never calls `sendEvent`. Gate your own `sendEvent` calls behind
66
- the same consent.
67
- * Web SDK can be configured only once per page. Reload the page before you
68
- mount the helper again or change its IDs, version or mode.
69
-
70
- ## Appcues
71
-
72
- Appcues shows onboarding flows, tooltips and checklists inside your app. Waits
73
- for `experience` consent.
74
-
75
- ```ts title="src/consent-scripts.ts"
76
- import { appcues } from '@c15t/integrations/appcues';
77
-
78
- export const scripts = [
79
- appcues({
80
- accountId: 'YOUR_APPCUES_ID',
81
- onReady: () => {
82
- // Read the signed-in visitor from your auth state here.
83
- // Enable only with their real, unique, stable ID; skip if signed out.
84
- // window.Appcues?.identify?.('CURRENT_USER_ID');
85
- // After identify, enable with the visitor's real group ID if needed.
86
- // window.Appcues?.group?.('CURRENT_GROUP_ID');
87
- // After identify, track only an event that actually happened.
88
- // window.Appcues?.track?.('Started onboarding');
89
- },
90
- }),
91
- ];
92
- ```
93
-
94
- | Option | Type | Required | Description |
95
- | ----------- | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
- | `accountId` | `string` | Yes | Account ID from your [Appcues install snippet](https://docs.appcues.com/install-appcues-web/install-the-appcues-sdk). A blank ID logs an error and skips loading. |
97
- | `region` | `'us' \|'eu'` | No | Account region. Defaults to `'us'`. |
98
- | `settings` | `object` | No | `AppcuesSettings` to set before the SDK loads. Defaults to `{ enableURLDetection: true }`. |
99
- | `onReady` | `() => void` | No | Runs once after the SDK loads, while consent still allows it. Call `identify`, `group` and `track` here. |
100
-
101
- **When consent is withdrawn:** the helper calls `Appcues.reset()` and removes
102
- the loader, then c15t reloads the page. Keep `reloadOnConsentRevoked` on.
103
- `reset()` clears the user and any flow in progress, but the SDK keeps running
104
- until the reload.
105
-
106
- * Set `region: 'eu'` for an EU account. The SDK then loads from
107
- `fast.eu.appcues.com` instead of `fast.appcues.com`.
108
- * Call `identify` from `onReady`, using the signed-in user's real, stable ID.
109
- If the user signs in later, call `identify` from your auth handler, but first
110
- check that `window.Appcues` exists and consent still allows Appcues.
111
-
112
- ## Dynamic Yield
113
-
114
- Dynamic Yield personalizes pages and serves product recommendations. Waits for
115
- `experience` consent.
116
-
117
- ```ts title="src/consent-scripts.ts"
118
- import { dynamicYield } from '@c15t/integrations/dynamic-yield';
119
-
120
- export const scripts = [
121
- dynamicYield({
122
- recommendationContext: { lng: 'en_GB', type: 'HOMEPAGE' },
123
- region: 'eu',
124
- sectionId: 'YOUR_SECTION_ID',
125
- }),
126
- ];
127
- ```
128
-
129
- | Option | Type | Required | Description |
130
- | ----------------------- | -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
131
- | `sectionId` | `string` | Yes | Section ID from your [installation snippet](https://dy.dev/docs/implement-script). A blank ID logs an error and skips loading. |
132
- | `region` | `'us' \|'eu'` | No | Data center for the section. Defaults to `'us'`. |
133
- | `recommendationContext` | `object` | No | [Page context](https://dy.dev/docs/page-context) set before the scripts load, such as `{ type: 'PRODUCT', data: ['SKU-1'] }`. Your app updates it on client-side navigation. |
134
- | `category` | `HasCondition` | No | Consent condition to wait for. Defaults to `'experience'`. |
135
-
136
- After consent, the helper sets `DY.userActiveConsent = { accepted: true }`,
137
- loads `api_dynamic.js`, then loads `api_static.js`.
138
-
139
- **When consent is withdrawn:** the helper removes both scripts and sets
140
- `DY.userActiveConsent = { accepted: false }`. The SDK that already ran stays
141
- loaded, so keep `reloadOnConsentRevoked` on.
142
-
143
- * Ask Dynamic Yield Support to enable
144
- [Active Cookie Consent](https://dy.dev/docs/active-cookie-consent) for your
145
- section. Until they do, Dynamic Yield ignores the consent signal.
146
- * Use one section and region per page. Dynamic Yield keeps its consent and page
147
- context on the page-wide `window.DY`.
148
- * Expect flicker. Dynamic Yield wants synchronous scripts in `<head>`. Loading
149
- after consent, one script after the other, can show the original page before
150
- a campaign applies.
151
-
152
- ## Optimizely Web Experimentation
153
-
154
- Optimizely Web runs A/B tests and personalization by changing the page in the
155
- browser. Waits for `experience` consent.
156
-
157
- ```ts title="src/consent-scripts.ts"
158
- import { optimizelyWeb } from '@c15t/integrations/optimizely';
159
-
160
- export const scripts = [optimizelyWeb({ projectId: '12345678' })];
161
- ```
162
-
163
- | Option | Type | Required | Description |
164
- | ----------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
165
- | `projectId` | `string \|number` | Yes | The number before `.js` in your snippet URL, from **Settings > Implementation**. Invalid IDs log an error and skip loading. |
166
- | `category` | `HasCondition` | No | Consent condition to wait for. Defaults to `'experience'`. |
167
- | `scriptSrc` | `string` | No | Custom or proxied snippet URL. Defaults to `https://cdn.optimizely.com/js/<projectId>.js`. |
168
-
169
- **When consent is withdrawn:** c15t removes the snippet and reloads the page.
170
- Keep `reloadOnConsentRevoked` on. The running SDK can't be unloaded, so
171
- without the reload it keeps changing the page and sending events.
172
-
173
- * Expect flicker. Optimizely wants a parser-blocking snippet at the top of
174
- `<head>`. c15t injects it with `async: false` after consent, which doesn't
175
- block the parser, so visitors can see the original page before a variation
176
- applies.
177
- * `optOutOptimizely()` from `@c15t/integrations/optimizely` sets Optimizely's
178
- `optimizelyOptOut` cookie for ten years. Granting consent later in c15t
179
- doesn't clear it, so the helper never calls it on revoke. Call it only for a
180
- deliberate permanent opt-out, and clear the cookie yourself to undo it.
181
-
182
- ## Wisepops
183
-
184
- Wisepops shows popups, bars, embeds and notification feeds on your site. Waits
185
- for `marketing` consent. The `experienceScripts` export below shows the
186
- `experience` alternative; register one of the two arrays.
187
-
188
- ```ts title="src/consent-scripts.ts"
189
- import { wisepops } from '@c15t/integrations/wisepops';
190
-
191
- export const scripts = [wisepops({ siteId: 'YOUR_WISEPOPS_SITE_ID' })];
192
-
193
- export const experienceScripts = [
194
- wisepops({
195
- category: 'experience',
196
- options: { browserStorage: true },
197
- siteId: 'YOUR_WISEPOPS_SITE_ID',
198
- }),
199
- ];
200
- ```
201
-
202
- | Option | Type | Required | Description |
203
- | ------------------------ | ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------- |
204
- | `siteId` | `string` | Yes | The `h` value in the loader URL from **Settings > Install Wisepops**. A blank ID logs an error and skips loading. |
205
- | `category` | `HasCondition` | No | Consent condition to wait for. Defaults to `'marketing'`. Use `'experience'` if that fits your campaigns. |
206
- | `options.autoPageview` | `'url' \|'init' \|false` | No | When Wisepops checks for campaigns. Defaults to `'url'`, which follows client-side navigation. |
207
- | `options.browserStorage` | `boolean` | No | `true` stores visitor data in localStorage instead of cookies. |
208
-
209
- The helper queues `defaultConsent: 'denied'`, loads Wisepops, then calls
210
- `wisepops('consent', 'granted')`.
211
-
212
- **When consent is withdrawn:** c15t removes the loader and reloads the page.
213
- Keep `reloadOnConsentRevoked` on. Wisepops has no way to revoke consent or shut
214
- down from code, so the reload is the only way to stop it.
215
-
216
- * Wisepops' own `denied` mode still shows campaigns, with session-only
217
- cookies. This helper doesn't use it. It keeps Wisepops off the page until
218
- consent, so don't install Wisepops a second time to get denied mode.
219
- * Wisepops integrates with Shopify Customer Privacy on its own, and this helper
220
- doesn't sync c15t choices to Shopify. On a Shopify store, check Wisepops'
221
- [consent mode](https://support.wisepops.com/en/articles/12679556-cookie-consent-mode)
222
- settings and make sure a Shopify app doesn't load Wisepops outside c15t.