@c15t/scripts 2.0.1 → 2.2.0-canary-20260727202135
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 +62 -0
- package/README.md +41 -29
- package/dist/e2e-test-utils.cjs +51 -10
- package/dist/e2e-test-utils.js +37 -3
- package/dist/engine/compile.cjs +9 -5
- package/dist/engine/runtime.cjs +111 -17
- package/dist/engine/runtime.js +102 -12
- package/dist/registry.cjs +423 -0
- package/dist/registry.js +372 -0
- package/dist/resolve.cjs +9 -5
- package/dist/types.cjs +32 -10
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +55 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +69 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +59 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +78 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +11 -7
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +206 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +42 -21
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +151 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +131 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +11 -7
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +15 -8
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
- package/dist/vendors/analytics/adobe-analytics.js +49 -0
- package/dist/vendors/analytics/ahrefs-analytics.cjs +68 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/amplitude.cjs +193 -0
- package/dist/vendors/analytics/amplitude.js +134 -0
- package/dist/vendors/analytics/clearbit.cjs +69 -0
- package/dist/vendors/analytics/clearbit.js +28 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +73 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +14 -10
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +76 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +18 -35
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/heap.cjs +181 -0
- package/dist/vendors/analytics/heap.js +134 -0
- package/dist/vendors/analytics/hightouch.cjs +153 -0
- package/dist/vendors/analytics/hightouch.js +109 -0
- package/dist/vendors/analytics/hotjar.cjs +85 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/logrocket.cjs +99 -0
- package/dist/vendors/analytics/logrocket.js +58 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +232 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +138 -0
- package/dist/vendors/analytics/microsoft-clarity.js +97 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +134 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +93 -0
- package/dist/vendors/analytics/pirsch.cjs +108 -0
- package/dist/vendors/analytics/pirsch.js +67 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +122 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/vendors/analytics/posthog.cjs +204 -0
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +70 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rudderstack.cjs +227 -0
- package/dist/vendors/analytics/rudderstack.js +183 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +104 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +97 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +80 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +94 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +143 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +89 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +17 -34
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +440 -0
- package/dist-types/types.d.ts +53 -2
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +92 -0
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +45 -34
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +48 -33
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +34 -17
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
- package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +25 -25
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +21 -24
- package/dist-types/vendors/analytics/heap.d.ts +316 -0
- package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +98 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +113 -0
- package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/vendors/analytics/posthog.d.ts +154 -0
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +22 -25
- package/docs/README.md +62 -0
- package/docs/frameworks/javascript/script-loader.md +354 -0
- package/docs/frameworks/next/script-loader.md +499 -0
- package/docs/frameworks/react/script-loader.md +553 -0
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +157 -0
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +239 -0
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +126 -0
- package/docs/integrations/crisp.md +140 -0
- package/docs/integrations/databuddy.md +205 -0
- package/docs/integrations/fathom-analytics.md +150 -0
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +154 -0
- package/docs/integrations/google-tag.md +134 -0
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +143 -0
- package/docs/integrations/intercom.md +144 -0
- package/docs/integrations/linkedin-insights.md +161 -0
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +171 -0
- package/docs/integrations/meta-pixel.md +412 -0
- package/docs/integrations/microsoft-clarity.md +173 -0
- package/docs/integrations/microsoft-uet.md +156 -0
- package/docs/integrations/mixpanel-analytics.md +130 -0
- package/docs/integrations/overview.md +149 -0
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +154 -0
- package/docs/integrations/posthog.md +258 -0
- package/docs/integrations/promptwatch.md +121 -0
- package/docs/integrations/reddit-pixel.md +241 -0
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +143 -0
- package/docs/integrations/segment.md +146 -0
- package/docs/integrations/snapchat-pixel.md +163 -0
- package/docs/integrations/tiktok-pixel.md +123 -0
- package/docs/integrations/umami-analytics.md +148 -0
- package/docs/integrations/vercel-analytics.md +141 -0
- package/docs/integrations/x-pixel.md +157 -0
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/react/guides/script-loader.md +309 -0
- package/package.json +223 -8
- package/readme.json +8 -4
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.cjs +0 -137
- package/dist/posthog.js +0 -100
- package/dist-types/linkedin-insights.d.ts +0 -79
- package/dist-types/meta-pixel.d.ts +0 -185
- package/dist-types/posthog.d.ts +0 -112
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
export type VercelAnalyticsMode = 'auto' | 'development' | 'production';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
va?: (event: string, properties?: unknown) => void;
|
|
6
|
+
vaq?: [string, unknown?][];
|
|
7
|
+
vam?: 'development' | 'production';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Vercel Analytics vendor manifest.
|
|
12
|
+
*
|
|
13
|
+
* Seeds Vercel's event queue before loading the tracker bundle.
|
|
14
|
+
*/
|
|
15
|
+
export declare const vercelAnalyticsManifest: {
|
|
16
|
+
readonly kind: "c15t.vendor-manifest";
|
|
17
|
+
readonly schemaVersion: 1;
|
|
18
|
+
readonly vendor: 'vercel-analytics';
|
|
19
|
+
readonly category: 'measurement';
|
|
20
|
+
readonly bootstrap: [{
|
|
21
|
+
readonly type: 'setGlobal';
|
|
22
|
+
readonly name: 'vaq';
|
|
23
|
+
readonly value: readonly [];
|
|
24
|
+
readonly ifUndefined: true;
|
|
25
|
+
}, {
|
|
26
|
+
readonly type: 'defineStubFunction';
|
|
27
|
+
readonly name: 'va';
|
|
28
|
+
readonly queue: {
|
|
29
|
+
readonly global: 'vaq';
|
|
30
|
+
};
|
|
31
|
+
readonly queueFormat: 'array';
|
|
32
|
+
readonly ifUndefined: true;
|
|
33
|
+
}];
|
|
34
|
+
readonly install: [{
|
|
35
|
+
readonly type: 'loadScript';
|
|
36
|
+
readonly src: '{{scriptUrl}}';
|
|
37
|
+
readonly defer: true;
|
|
38
|
+
readonly attributes: {
|
|
39
|
+
readonly 'data-sdkn': 'c15t';
|
|
40
|
+
readonly 'data-dsn': '{{dsn}}';
|
|
41
|
+
readonly 'data-disable-auto-track': '{{disableAutoTrackAttribute}}';
|
|
42
|
+
readonly 'data-endpoint': '{{endpoint}}';
|
|
43
|
+
};
|
|
44
|
+
}];
|
|
45
|
+
};
|
|
46
|
+
export interface VercelAnalyticsOptions {
|
|
47
|
+
/** Project DSN for self-hosted or non-Vercel deployments. */
|
|
48
|
+
dsn?: string;
|
|
49
|
+
/** Disable automatic pageview tracking. */
|
|
50
|
+
disableAutoTrack?: boolean;
|
|
51
|
+
/** Preferred script mode. */
|
|
52
|
+
mode?: VercelAnalyticsMode;
|
|
53
|
+
/** Load Vercel's debug bundle when set to `true`. */
|
|
54
|
+
debug?: boolean;
|
|
55
|
+
/** Custom ingestion endpoint. */
|
|
56
|
+
endpoint?: string;
|
|
57
|
+
/** Custom loader URL. */
|
|
58
|
+
scriptUrl?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates a Vercel Analytics script.
|
|
62
|
+
*
|
|
63
|
+
* @param options - The options for the Vercel Analytics script.
|
|
64
|
+
* @returns The Vercel Analytics script.
|
|
65
|
+
*/
|
|
66
|
+
export declare function vercelAnalytics(options?: VercelAnalyticsOptions): Script;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
$crisp: unknown[][];
|
|
5
|
+
CRISP_WEBSITE_ID: string;
|
|
6
|
+
CRISP_RUNTIME_CONFIG?: {
|
|
7
|
+
locale?: string;
|
|
8
|
+
session_merge?: boolean;
|
|
9
|
+
};
|
|
10
|
+
CRISP_COOKIE_DOMAIN?: string;
|
|
11
|
+
CRISP_COOKIE_EXPIRE?: number;
|
|
12
|
+
CRISP_TOKEN_ID?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Crisp vendor manifest.
|
|
17
|
+
*
|
|
18
|
+
* Seeds the Crisp queue and website ID before loading the chat client.
|
|
19
|
+
* Optional runtime globals are added when provided by the helper options.
|
|
20
|
+
*/
|
|
21
|
+
export declare const crispManifest: {
|
|
22
|
+
readonly kind: "c15t.vendor-manifest";
|
|
23
|
+
readonly schemaVersion: 1;
|
|
24
|
+
readonly vendor: 'crisp';
|
|
25
|
+
readonly category: 'functionality';
|
|
26
|
+
readonly install: [{
|
|
27
|
+
readonly type: 'setGlobal';
|
|
28
|
+
readonly name: '$crisp';
|
|
29
|
+
readonly value: readonly [];
|
|
30
|
+
readonly ifUndefined: false;
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: 'setGlobal';
|
|
33
|
+
readonly name: 'CRISP_WEBSITE_ID';
|
|
34
|
+
readonly value: '{{websiteId}}';
|
|
35
|
+
readonly ifUndefined: false;
|
|
36
|
+
}, {
|
|
37
|
+
readonly type: 'loadScript';
|
|
38
|
+
readonly src: '{{scriptSrc}}';
|
|
39
|
+
readonly async: true;
|
|
40
|
+
}];
|
|
41
|
+
};
|
|
42
|
+
export interface CrispOptions {
|
|
43
|
+
/** Your Crisp website ID. */
|
|
44
|
+
websiteId: string;
|
|
45
|
+
/** Optional locale passed through `window.CRISP_RUNTIME_CONFIG`. */
|
|
46
|
+
locale?: string;
|
|
47
|
+
/** Optional cookie domain override for Crisp. */
|
|
48
|
+
cookieDomain?: string;
|
|
49
|
+
/** Optional cookie expiration in seconds. */
|
|
50
|
+
cookieExpiry?: number;
|
|
51
|
+
/** Optional Crisp token ID for session continuity. */
|
|
52
|
+
tokenId?: string;
|
|
53
|
+
/** Whether to merge anonymous sessions into token-backed sessions. */
|
|
54
|
+
sessionMerge?: boolean;
|
|
55
|
+
/** Whether to enable `$crisp` safe mode before other queued calls. */
|
|
56
|
+
safeMode?: boolean;
|
|
57
|
+
/** Crisp loader URL. */
|
|
58
|
+
scriptSrc?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates a Crisp chat script.
|
|
62
|
+
*
|
|
63
|
+
* This manifest-based helper keeps the serializable queue/bootstrap globals and
|
|
64
|
+
* omits the upstream ready callback wrapper.
|
|
65
|
+
*
|
|
66
|
+
* @param options - The options for the Crisp script.
|
|
67
|
+
* @returns The Crisp script configuration.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const crispScript = crisp({
|
|
72
|
+
* websiteId: '1234-abcd',
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @see {@link https://help.crisp.chat/en/article/how-do-i-install-crisp-live-chat-on-my-website-10wcj3l/} Crisp installation documentation.
|
|
77
|
+
*/
|
|
78
|
+
export declare function crisp(options: CrispOptions): Script;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
export declare const INTERCOM_API_BASES: {
|
|
3
|
+
readonly us: 'https://api-iam.intercom.io';
|
|
4
|
+
readonly eu: 'https://api-iam.eu.intercom.io';
|
|
5
|
+
readonly au: 'https://api-iam.au.intercom.io';
|
|
6
|
+
};
|
|
7
|
+
export type IntercomApiBase = (typeof INTERCOM_API_BASES)[keyof typeof INTERCOM_API_BASES] | (string & {});
|
|
8
|
+
export type IntercomThemeMode = 'light' | 'dark' | 'system';
|
|
9
|
+
export interface IntercomAvatar {
|
|
10
|
+
type: 'avatar';
|
|
11
|
+
image_url: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IntercomCompany {
|
|
14
|
+
id?: string;
|
|
15
|
+
company_id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
created_at?: number;
|
|
18
|
+
remote_created_at?: number;
|
|
19
|
+
plan?: string;
|
|
20
|
+
monthly_spend?: number;
|
|
21
|
+
size?: number;
|
|
22
|
+
website?: string;
|
|
23
|
+
industry?: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface IntercomSettings extends Record<string, unknown> {
|
|
27
|
+
app_id: string;
|
|
28
|
+
api_base: IntercomApiBase;
|
|
29
|
+
custom_launcher_selector?: string;
|
|
30
|
+
alignment?: 'left' | 'right';
|
|
31
|
+
vertical_padding?: number;
|
|
32
|
+
horizontal_padding?: number;
|
|
33
|
+
z_index?: number;
|
|
34
|
+
hide_default_launcher?: boolean;
|
|
35
|
+
hide_notifications?: boolean;
|
|
36
|
+
theme_mode?: IntercomThemeMode;
|
|
37
|
+
session_duration?: number;
|
|
38
|
+
action_color?: string;
|
|
39
|
+
background_color?: string;
|
|
40
|
+
link_color?: string;
|
|
41
|
+
email?: string;
|
|
42
|
+
user_id?: string;
|
|
43
|
+
created_at?: number;
|
|
44
|
+
name?: string;
|
|
45
|
+
phone?: string;
|
|
46
|
+
unsubscribed_from_emails?: boolean;
|
|
47
|
+
language_override?: string;
|
|
48
|
+
utm_campaign?: string;
|
|
49
|
+
utm_content?: string;
|
|
50
|
+
utm_medium?: string;
|
|
51
|
+
utm_source?: string;
|
|
52
|
+
utm_term?: string;
|
|
53
|
+
avatar?: IntercomAvatar;
|
|
54
|
+
user_hash?: string;
|
|
55
|
+
company?: IntercomCompany;
|
|
56
|
+
companies?: IntercomCompany[];
|
|
57
|
+
page_title?: string;
|
|
58
|
+
}
|
|
59
|
+
export type IntercomCustomSettings = Partial<Omit<IntercomSettings, 'app_id' | 'api_base'>> & Record<string, unknown>;
|
|
60
|
+
declare global {
|
|
61
|
+
interface Window {
|
|
62
|
+
Intercom?: ((...args: unknown[]) => void) & {
|
|
63
|
+
q?: unknown[][];
|
|
64
|
+
};
|
|
65
|
+
intercomSettings?: IntercomSettings;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Intercom vendor manifest.
|
|
70
|
+
*
|
|
71
|
+
* Seeds `window.intercomSettings` and a queueing `Intercom` stub before loading
|
|
72
|
+
* the messenger widget bundle.
|
|
73
|
+
*/
|
|
74
|
+
export declare const intercomManifest: {
|
|
75
|
+
readonly kind: "c15t.vendor-manifest";
|
|
76
|
+
readonly schemaVersion: 1;
|
|
77
|
+
readonly vendor: 'intercom';
|
|
78
|
+
readonly category: 'functionality';
|
|
79
|
+
readonly install: [{
|
|
80
|
+
readonly type: 'defineStubFunction';
|
|
81
|
+
readonly name: 'Intercom';
|
|
82
|
+
readonly queue: {
|
|
83
|
+
readonly property: 'q';
|
|
84
|
+
};
|
|
85
|
+
readonly queueFormat: 'array';
|
|
86
|
+
readonly ifUndefined: true;
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: 'setGlobal';
|
|
89
|
+
readonly name: 'intercomSettings';
|
|
90
|
+
readonly value: '{{settings}}';
|
|
91
|
+
readonly ifUndefined: false;
|
|
92
|
+
}, {
|
|
93
|
+
readonly type: 'loadScript';
|
|
94
|
+
readonly src: '{{scriptSrc}}';
|
|
95
|
+
readonly async: true;
|
|
96
|
+
}];
|
|
97
|
+
};
|
|
98
|
+
export interface IntercomOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Your Intercom app ID.
|
|
101
|
+
*/
|
|
102
|
+
appId: string;
|
|
103
|
+
/**
|
|
104
|
+
* Regional Intercom API base.
|
|
105
|
+
*
|
|
106
|
+
* @default 'https://api-iam.intercom.io'
|
|
107
|
+
*/
|
|
108
|
+
apiBase?: IntercomApiBase;
|
|
109
|
+
/**
|
|
110
|
+
* Additional serializable Intercom settings merged into
|
|
111
|
+
* `window.intercomSettings`.
|
|
112
|
+
*/
|
|
113
|
+
settings?: IntercomCustomSettings;
|
|
114
|
+
/** Intercom loader URL. */
|
|
115
|
+
scriptSrc?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates an Intercom messenger script.
|
|
119
|
+
*
|
|
120
|
+
* The helper bootstraps the documented Intercom settings object and queues
|
|
121
|
+
* early `Intercom(...)` calls until the messenger bundle loads.
|
|
122
|
+
*
|
|
123
|
+
* @param options - The options for the Intercom script.
|
|
124
|
+
* @returns The Intercom script configuration.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const intercomScript = intercom({
|
|
129
|
+
* appId: 'abc123',
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @see {@link https://developers.intercom.com/installing-intercom/web/installation} Intercom installation documentation.
|
|
134
|
+
*/
|
|
135
|
+
export declare function intercom({ appId, apiBase, settings, scriptSrc, }: IntercomOptions): Script;
|
|
@@ -14,47 +14,44 @@ declare global {
|
|
|
14
14
|
* - Signals consent state via `gtag('consent', 'default'|'update', ...)`
|
|
15
15
|
*/
|
|
16
16
|
export declare const googleTagManagerManifest: {
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
17
|
+
readonly kind: "c15t.vendor-manifest";
|
|
18
|
+
readonly schemaVersion: 1;
|
|
19
|
+
readonly vendor: 'google-tag-manager';
|
|
20
|
+
readonly category: 'necessary';
|
|
19
21
|
readonly alwaysLoad: true;
|
|
20
22
|
readonly bootstrap: [{
|
|
21
|
-
readonly type:
|
|
22
|
-
readonly name:
|
|
23
|
+
readonly type: 'setGlobal';
|
|
24
|
+
readonly name: 'dataLayer';
|
|
23
25
|
readonly value: readonly [];
|
|
24
26
|
readonly ifUndefined: true;
|
|
25
27
|
}, {
|
|
26
|
-
readonly type:
|
|
27
|
-
readonly name:
|
|
28
|
-
readonly queue:
|
|
28
|
+
readonly type: 'defineQueueFunction';
|
|
29
|
+
readonly name: 'gtag';
|
|
30
|
+
readonly queue: 'dataLayer';
|
|
29
31
|
readonly ifUndefined: true;
|
|
30
32
|
}];
|
|
31
33
|
readonly install: [{
|
|
32
|
-
readonly type:
|
|
33
|
-
readonly queue:
|
|
34
|
+
readonly type: 'pushToQueue';
|
|
35
|
+
readonly queue: 'dataLayer';
|
|
34
36
|
readonly value: {
|
|
35
|
-
readonly 'gtm.start':
|
|
36
|
-
|
|
37
|
+
readonly 'gtm.start': {
|
|
38
|
+
readonly kind: "c15t.runtime-value";
|
|
39
|
+
readonly value: 'timestamp';
|
|
40
|
+
};
|
|
41
|
+
readonly event: 'gtm.js';
|
|
37
42
|
};
|
|
38
43
|
}, {
|
|
39
|
-
readonly type:
|
|
40
|
-
readonly src:
|
|
44
|
+
readonly type: 'loadScript';
|
|
45
|
+
readonly src: 'https://www.googletagmanager.com/gtm.js?id={{id}}';
|
|
41
46
|
readonly async: true;
|
|
42
47
|
}];
|
|
43
48
|
readonly onConsentChange: [{
|
|
44
|
-
readonly type:
|
|
45
|
-
readonly global:
|
|
49
|
+
readonly type: 'callGlobal';
|
|
50
|
+
readonly global: 'gtag';
|
|
46
51
|
readonly args: ["event", "{{updateEventName}}"];
|
|
47
52
|
}];
|
|
48
|
-
readonly consentMapping:
|
|
49
|
-
|
|
50
|
-
readonly functionality: ["functionality_storage"];
|
|
51
|
-
readonly measurement: ["analytics_storage"];
|
|
52
|
-
readonly marketing: ["ad_storage", "ad_user_data", "ad_personalization"];
|
|
53
|
-
readonly experience: ["personalization_storage"];
|
|
54
|
-
};
|
|
55
|
-
readonly consentSignal: "gtag";
|
|
56
|
-
readonly kind: "c15t.vendor-manifest";
|
|
57
|
-
readonly schemaVersion: 1;
|
|
53
|
+
readonly consentMapping: Record<string, string[]>;
|
|
54
|
+
readonly consentSignal: 'gtag';
|
|
58
55
|
};
|
|
59
56
|
export interface GoogleTagManagerOptions {
|
|
60
57
|
/**
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @c15t/scripts
|
|
2
|
+
|
|
3
|
+
> Consent-aware script integration docs for analytics, advertising pixels, tag managers, widgets, and custom loaders.
|
|
4
|
+
|
|
5
|
+
These docs ship inside the package so coding agents can read them offline. Open the topic file you need from the list below — paths are relative to this file.
|
|
6
|
+
|
|
7
|
+
## Frameworks
|
|
8
|
+
|
|
9
|
+
Install and configure c15t in JavaScript, React, and Next.js applications.
|
|
10
|
+
|
|
11
|
+
- [Script Loader](./frameworks/javascript/script-loader.md): Gate third-party scripts behind consent — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
|
|
12
|
+
- [Script Loader](./frameworks/next/script-loader.md): Gate third-party scripts behind consent in Next.js — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
|
|
13
|
+
- [Script Loader](./frameworks/react/script-loader.md): Gate third-party scripts behind consent in React — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
|
|
14
|
+
|
|
15
|
+
## Integrations
|
|
16
|
+
|
|
17
|
+
Connect analytics, advertising, maps, media, and other third-party tools behind consent.
|
|
18
|
+
|
|
19
|
+
- [Adobe Analytics](./integrations/adobe-analytics.md): Adobe Analytics loaded through an Adobe Experience Platform Data Collection Tags embed URL.
|
|
20
|
+
- [Ahrefs Analytics](./integrations/ahrefs-analytics.md): Cookieless web analytics from Ahrefs with a prebuilt helper that wires the project key into a c15t-managed script.
|
|
21
|
+
- [Amplitude](./integrations/amplitude.md): Load Amplitude Browser SDK 2 with c15t and gate product analytics behind measurement consent.
|
|
22
|
+
- [Build a Custom Script Integration](./integrations/building-integrations.md): Learn when to use a raw Script, when to build a reusable manifest-backed integration, and how to debug and test custom consent-aware scripts in c15t.
|
|
23
|
+
- [Clearbit](./integrations/clearbit.md): Visitor and company enrichment loaded with Clearbit's account-keyed tags.js snippet.
|
|
24
|
+
- [Cloudflare Web Analytics](./integrations/cloudflare-web-analytics.md): Cookieless analytics from Cloudflare with a prebuilt helper that serializes the beacon config into the `data-cf-beacon` attribute.
|
|
25
|
+
- [Crisp](./integrations/crisp.md): Load Crisp live chat with website ID, runtime, cookie, and session options.
|
|
26
|
+
- [Databuddy](./integrations/databuddy.md): Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization.
|
|
27
|
+
- [Fathom Analytics](./integrations/fathom-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that maps Fathom's data attributes into a c15t-managed script.
|
|
28
|
+
- [Google Maps](./integrations/google-maps.md): Render Google Maps only after consent with one shared Maps JavaScript API loader and independently managed map instances.
|
|
29
|
+
- [GA4 + Google Ads (gtag.js)](./integrations/google-tag.md): Send data to Google Analytics 4 and Google Ads with automatic Consent Mode v2 support.
|
|
30
|
+
- [Google Tag Manager](./integrations/google-tag-manager.md): Deploy and manage marketing tags centrally with automatic consent state synchronization.
|
|
31
|
+
- [Heap](./integrations/heap.md): Load Heap with c15t and gate autocapture product analytics behind measurement consent.
|
|
32
|
+
- [Hightouch](./integrations/hightouch.md): Load Hightouch Events with c15t and gate the browser SDK behind measurement consent.
|
|
33
|
+
- [Hotjar](./integrations/hotjar.md): Product analytics and behavior insights with a prebuilt helper that seeds Hotjar globals before loading the vendor bundle.
|
|
34
|
+
- [Intercom](./integrations/intercom.md): Bootstrap Intercom settings and load the messenger widget bundle.
|
|
35
|
+
- [LinkedIn Insights](./integrations/linkedin-insights.md): Track conversions and build matched audiences for LinkedIn advertising campaigns.
|
|
36
|
+
- [LogRocket](./integrations/logrocket.md): Session replay and monitoring loaded after measurement consent with LogRocket's browser SDK.
|
|
37
|
+
- [Matomo Analytics](./integrations/matomo-analytics.md): Load Matomo with c15t and keep Matomo's queue aligned with measurement consent.
|
|
38
|
+
- [Meta Pixel](./integrations/meta-pixel.md): Track conversions and build audiences for Facebook and Instagram advertising campaigns.
|
|
39
|
+
- [Microsoft Clarity](./integrations/microsoft-clarity.md): Session replay and behavior analytics with a prebuilt helper that keeps Clarity consent synchronized with c15t measurement state.
|
|
40
|
+
- [Microsoft UET](./integrations/microsoft-uet.md): Track conversions and measure performance for Microsoft Advertising and Bing Ads.
|
|
41
|
+
- [Mixpanel Analytics](./integrations/mixpanel-analytics.md): Load Mixpanel with c15t and let Mixpanel's own opt-in and opt-out APIs follow measurement consent.
|
|
42
|
+
- [Integrations](./integrations/overview.md): Load analytics, pixels, tag managers, and widgets through c15t so consent state controls when they run, update, and appear in your consent UI.
|
|
43
|
+
- [Pirsch](./integrations/pirsch.md): Privacy-friendly, cookieless analytics loaded with Pirsch's fixed script id and identification-code attributes.
|
|
44
|
+
- [Plausible Analytics](./integrations/plausible-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that preserves Plausible's queue bootstrap and loader attributes.
|
|
45
|
+
- [PostHog](./integrations/posthog.md): PostHog is an open-source product analytics platform for tracking user behavior, session replays, feature flags, and A/B testing. It supports cookieless tracking, allowing analytics to continue even without cookie consent.
|
|
46
|
+
- [Promptwatch](./integrations/promptwatch.md): Promptwatch analyzes traffic on your site for Artificial Intelligence (AI) traffic and usage insights. Data is stored in the EU without user-identifiable information.
|
|
47
|
+
- [Reddit Pixel](./integrations/reddit-pixel.md): Track conversions and build retargeting audiences for Reddit advertising campaigns.
|
|
48
|
+
- [RudderStack](./integrations/rudderstack.md): Load RudderStack's JavaScript SDK with c15t and gate the browser SDK behind measurement consent.
|
|
49
|
+
- [Rybbit Analytics](./integrations/rybbit-analytics.md): Privacy-friendly analytics with script-tag configuration via Rybbit's data attributes.
|
|
50
|
+
- [Segment](./integrations/segment.md): Load Segment Analytics.js with c15t and gate it behind measurement consent.
|
|
51
|
+
- [Snapchat Pixel](./integrations/snapchat-pixel.md): Measure Snapchat ad performance and build remarketing audiences with a prebuilt pixel helper.
|
|
52
|
+
- [TikTok Pixel](./integrations/tiktok-pixel.md): Measure ad performance and build audiences for TikTok advertising campaigns.
|
|
53
|
+
- [Umami Analytics](./integrations/umami-analytics.md): Open-source, cookieless analytics with a prebuilt helper that maps Umami's data attributes into a c15t-managed script.
|
|
54
|
+
- [Vercel Analytics](./integrations/vercel-analytics.md): Bootstrap Vercel Analytics with a declarative queue and script attributes.
|
|
55
|
+
- [X Pixel (Twitter Pixel)](./integrations/x-pixel.md): Track conversions and build audiences for advertising campaigns on X (formerly Twitter).
|
|
56
|
+
- [YouTube](./integrations/youtube.md): Keep YouTube iframes unmounted until consent with a privacy-enhanced, lazy-loaded React or Next.js embed.
|
|
57
|
+
|
|
58
|
+
## Reference
|
|
59
|
+
|
|
60
|
+
Concepts, legal templates, open-source policies, and contributor documentation.
|
|
61
|
+
|
|
62
|
+
- [Script Loader](./shared/react/guides/script-loader.md): Reference page for script loader.
|