@c15t/scripts 2.1.0 → 2.2.0-canary-20260804162155
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 +32 -20
- 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 +103 -17
- package/dist/engine/runtime.js +94 -12
- package/dist/registry.cjs +97 -12
- package/dist/registry.js +80 -0
- package/dist/resolve.cjs +9 -5
- package/dist/types.cjs +17 -13
- package/dist/vendors/_shared/attributes.cjs +13 -9
- package/dist/vendors/_shared/google-consent.cjs +14 -9
- package/dist/vendors/_shared/install-builders.cjs +12 -8
- package/dist/vendors/_shared/script-url.cjs +16 -12
- package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +9 -5
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +13 -9
- package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +11 -7
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +9 -5
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +11 -7
- package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +9 -5
- package/dist/vendors/ads-and-pixels/x-pixel.cjs +9 -5
- 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 +11 -7
- 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 +11 -7
- package/dist/vendors/analytics/databuddy.cjs +11 -7
- package/dist/vendors/analytics/fathom-analytics.cjs +11 -7
- package/dist/vendors/analytics/google-tag.cjs +11 -7
- 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 +11 -7
- package/dist/vendors/analytics/logrocket.cjs +99 -0
- package/dist/vendors/analytics/logrocket.js +58 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +9 -5
- package/dist/vendors/analytics/microsoft-clarity.cjs +75 -47
- package/dist/vendors/analytics/microsoft-clarity.js +64 -40
- package/dist/vendors/analytics/mixpanel-analytics.cjs +31 -16
- package/dist/vendors/analytics/mixpanel-analytics.js +22 -11
- package/dist/vendors/analytics/pirsch.cjs +108 -0
- package/dist/vendors/analytics/pirsch.js +67 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +9 -5
- package/dist/vendors/analytics/posthog.cjs +63 -27
- package/dist/vendors/analytics/posthog.js +52 -20
- package/dist/vendors/analytics/promptwatch.cjs +11 -7
- package/dist/vendors/analytics/rudderstack.cjs +227 -0
- package/dist/vendors/analytics/rudderstack.js +183 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +9 -5
- package/dist/vendors/analytics/segment.cjs +9 -5
- package/dist/vendors/analytics/umami-analytics.cjs +9 -5
- package/dist/vendors/analytics/vercel-analytics.cjs +11 -7
- package/dist/vendors/functional/crisp.cjs +9 -5
- package/dist/vendors/functional/intercom.cjs +11 -7
- package/dist/vendors/tag-managers/google-tag-manager.cjs +11 -7
- package/dist-types/registry.d.ts +313 -241
- package/dist-types/types.d.ts +46 -4
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +18 -18
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +21 -21
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +32 -32
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +19 -19
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +16 -16
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +28 -28
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +13 -13
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +7 -7
- 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 +7 -7
- package/dist-types/vendors/analytics/databuddy.d.ts +25 -25
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +11 -11
- package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
- 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 +14 -14
- package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +42 -30
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +40 -28
- package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
- package/dist-types/vendors/analytics/posthog.d.ts +63 -45
- package/dist-types/vendors/analytics/promptwatch.d.ts +7 -7
- package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +18 -18
- package/dist-types/vendors/analytics/segment.d.ts +13 -13
- package/dist-types/vendors/analytics/umami-analytics.d.ts +12 -12
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +16 -16
- package/dist-types/vendors/functional/crisp.d.ts +11 -11
- package/dist-types/vendors/functional/intercom.d.ts +16 -16
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +18 -18
- package/docs/README.md +62 -0
- package/docs/frameworks/javascript/script-loader.md +356 -0
- package/docs/frameworks/next/script-loader.md +501 -0
- package/docs/frameworks/react/script-loader.md +555 -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 +311 -0
- package/package.json +61 -7
- package/readme.json +8 -4
package/dist-types/types.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ export interface RuntimeValue {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const runtimeDateValue: {
|
|
14
14
|
readonly kind: "c15t.runtime-value";
|
|
15
|
-
readonly value:
|
|
15
|
+
readonly value: 'date';
|
|
16
16
|
};
|
|
17
17
|
export declare const runtimeTimestampValue: {
|
|
18
18
|
readonly kind: "c15t.runtime-value";
|
|
19
|
-
readonly value:
|
|
19
|
+
readonly value: 'timestamp';
|
|
20
20
|
};
|
|
21
21
|
export interface ManifestContract {
|
|
22
22
|
kind: typeof VENDOR_MANIFEST_KIND;
|
|
@@ -119,6 +119,8 @@ export interface SetGlobalPathStep {
|
|
|
119
119
|
path: string[];
|
|
120
120
|
/** Value to assign at the target path */
|
|
121
121
|
value: unknown;
|
|
122
|
+
/** Only assign while the root global is still a snippet queue array. */
|
|
123
|
+
ifGlobalIsQueue?: boolean;
|
|
122
124
|
}
|
|
123
125
|
export interface DefineQueueMethodsStep {
|
|
124
126
|
type: 'defineQueueMethods';
|
|
@@ -134,6 +136,40 @@ export interface DefineQueueMethodsStep {
|
|
|
134
136
|
global?: never;
|
|
135
137
|
property: string;
|
|
136
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Format used for each queued method call.
|
|
141
|
+
*
|
|
142
|
+
* - `tuple` pushes `[methodName, ...args]`, matching classic array queues.
|
|
143
|
+
* - `methodCall` pushes `{ name, args, resolve }` and returns a `Promise`,
|
|
144
|
+
* matching SDK loaders that replay named calls and resolve the original
|
|
145
|
+
* pre-load promise after the real method runs.
|
|
146
|
+
* - `wrappedMethodCall` queues like `methodCall` but returns
|
|
147
|
+
* `{ promise }`, matching Amplitude's snippet contract where queued
|
|
148
|
+
* proxy calls expose the pending promise on a `promise` property.
|
|
149
|
+
* - `voidMethodCall` queues like `methodCall` but returns nothing,
|
|
150
|
+
* matching snippet methods the vendor treats as synchronous.
|
|
151
|
+
* - `callback` pushes `{ name, fn }`, where `fn` replays the captured call
|
|
152
|
+
* against the current global target, matching loaders that own a
|
|
153
|
+
* ready-callback queue.
|
|
154
|
+
*
|
|
155
|
+
* @default 'tuple'
|
|
156
|
+
*/
|
|
157
|
+
queueFormat?: 'tuple' | 'methodCall' | 'wrappedMethodCall' | 'voidMethodCall' | 'callback';
|
|
158
|
+
}
|
|
159
|
+
export interface DefineQueueClassStep {
|
|
160
|
+
type: 'defineQueueClass';
|
|
161
|
+
/** Global object that receives the queued helper class. */
|
|
162
|
+
target: string;
|
|
163
|
+
/** Constructor property name to define on the target object. */
|
|
164
|
+
name: string;
|
|
165
|
+
/**
|
|
166
|
+
* Instance property that stores queued helper method calls.
|
|
167
|
+
*
|
|
168
|
+
* @default '_q'
|
|
169
|
+
*/
|
|
170
|
+
queueProperty?: string;
|
|
171
|
+
/** Helper instance method names to attach to the constructor prototype. */
|
|
172
|
+
methods: string[];
|
|
137
173
|
}
|
|
138
174
|
export type GlobalMethodBehavior = {
|
|
139
175
|
name: string;
|
|
@@ -148,6 +184,8 @@ export interface DefineGlobalMethodsStep {
|
|
|
148
184
|
/** Global object name to receive the methods */
|
|
149
185
|
target: string;
|
|
150
186
|
methods: Array<GlobalMethodBehavior>;
|
|
187
|
+
/** Only define methods while the target is still a snippet queue array. */
|
|
188
|
+
ifGlobalIsQueue?: boolean;
|
|
151
189
|
}
|
|
152
190
|
export interface ConstructGlobalStep {
|
|
153
191
|
type: 'constructGlobal';
|
|
@@ -163,13 +201,17 @@ export interface ConstructGlobalStep {
|
|
|
163
201
|
*/
|
|
164
202
|
copyAssignedValueToArgProperty?: string;
|
|
165
203
|
}
|
|
166
|
-
export type ManifestStep = LoadScriptStep | SetGlobalStep | DefineQueueFunctionStep | DefineStubFunctionStep | CallGlobalStep | PushToQueueStep | SetGlobalPathStep | DefineQueueMethodsStep | DefineGlobalMethodsStep | ConstructGlobalStep;
|
|
204
|
+
export type ManifestStep = LoadScriptStep | SetGlobalStep | DefineQueueFunctionStep | DefineStubFunctionStep | CallGlobalStep | PushToQueueStep | SetGlobalPathStep | DefineQueueMethodsStep | DefineQueueClassStep | DefineGlobalMethodsStep | ConstructGlobalStep;
|
|
167
205
|
/**
|
|
168
206
|
* Consent signal type determines how consent state is communicated to the vendor.
|
|
169
207
|
*
|
|
170
208
|
* - `'gtag'` — Google Consent Mode pattern: calls `gtag('consent', 'default'|'update', state)`
|
|
209
|
+
* - `'rudderstack'` — RudderStack consent-management pattern: calls
|
|
210
|
+
* `rudderanalytics.consent({ consentManagement: { enabled, provider: 'custom',
|
|
211
|
+
* allowedConsentIds, deniedConsentIds } })` with the mapping's consent IDs
|
|
212
|
+
* partitioned by the current c15t consent state
|
|
171
213
|
*/
|
|
172
|
-
export type ConsentSignalType = 'gtag';
|
|
214
|
+
export type ConsentSignalType = 'gtag' | 'rudderstack';
|
|
173
215
|
/**
|
|
174
216
|
* A declarative definition of a vendor integration.
|
|
175
217
|
*
|
|
@@ -28,37 +28,37 @@ declare global {
|
|
|
28
28
|
* via structured startup steps.
|
|
29
29
|
*/
|
|
30
30
|
export declare const linkedinInsightsManifest: {
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
31
|
+
readonly kind: "c15t.vendor-manifest";
|
|
32
|
+
readonly schemaVersion: 1;
|
|
33
|
+
readonly vendor: 'linkedin-insights';
|
|
34
|
+
readonly category: 'marketing';
|
|
33
35
|
readonly install: [{
|
|
34
|
-
readonly type:
|
|
35
|
-
readonly name:
|
|
36
|
-
readonly value:
|
|
36
|
+
readonly type: 'setGlobal';
|
|
37
|
+
readonly name: '_linkedin_partner_id';
|
|
38
|
+
readonly value: '{{id}}';
|
|
37
39
|
readonly ifUndefined: false;
|
|
38
40
|
}, {
|
|
39
|
-
readonly type:
|
|
40
|
-
readonly name:
|
|
41
|
+
readonly type: 'setGlobal';
|
|
42
|
+
readonly name: '_linkedin_data_partner_ids';
|
|
41
43
|
readonly value: readonly [];
|
|
42
44
|
readonly ifUndefined: true;
|
|
43
45
|
}, {
|
|
44
|
-
readonly type:
|
|
45
|
-
readonly queue:
|
|
46
|
-
readonly value:
|
|
46
|
+
readonly type: 'pushToQueue';
|
|
47
|
+
readonly queue: '_linkedin_data_partner_ids';
|
|
48
|
+
readonly value: '{{id}}';
|
|
47
49
|
}, {
|
|
48
|
-
readonly type:
|
|
49
|
-
readonly name:
|
|
50
|
+
readonly type: 'defineStubFunction';
|
|
51
|
+
readonly name: 'lintrk';
|
|
50
52
|
readonly queue: {
|
|
51
|
-
readonly property:
|
|
53
|
+
readonly property: 'q';
|
|
52
54
|
};
|
|
53
|
-
readonly queueFormat:
|
|
55
|
+
readonly queueFormat: 'array';
|
|
54
56
|
readonly ifUndefined: true;
|
|
55
57
|
}, {
|
|
56
|
-
readonly type:
|
|
57
|
-
readonly src:
|
|
58
|
+
readonly type: 'loadScript';
|
|
59
|
+
readonly src: '{{scriptSrc}}';
|
|
58
60
|
readonly async: true;
|
|
59
61
|
}];
|
|
60
|
-
readonly kind: "c15t.vendor-manifest";
|
|
61
|
-
readonly schemaVersion: 1;
|
|
62
62
|
};
|
|
63
63
|
export interface LinkedInInsightsOptions {
|
|
64
64
|
/**
|
|
@@ -126,53 +126,53 @@ declare global {
|
|
|
126
126
|
* stub and provides a consent API via `fbq('consent', 'grant'|'revoke')`.
|
|
127
127
|
*/
|
|
128
128
|
export declare const metaPixelManifest: {
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
129
|
+
readonly kind: "c15t.vendor-manifest";
|
|
130
|
+
readonly schemaVersion: 1;
|
|
131
|
+
readonly vendor: 'meta-pixel';
|
|
132
|
+
readonly category: 'marketing';
|
|
131
133
|
readonly persistAfterConsentRevoked: true;
|
|
132
134
|
readonly bootstrap: [{
|
|
133
|
-
readonly type:
|
|
134
|
-
readonly name:
|
|
135
|
+
readonly type: 'defineStubFunction';
|
|
136
|
+
readonly name: 'fbq';
|
|
135
137
|
readonly queue: {
|
|
136
|
-
readonly property:
|
|
138
|
+
readonly property: 'queue';
|
|
137
139
|
};
|
|
138
|
-
readonly dispatchProperty:
|
|
140
|
+
readonly dispatchProperty: 'callMethod';
|
|
139
141
|
readonly selfReferences: ["push"];
|
|
140
142
|
readonly aliases: ["_fbq"];
|
|
141
143
|
readonly properties: {
|
|
142
144
|
readonly loaded: true;
|
|
143
|
-
readonly version:
|
|
145
|
+
readonly version: '2.0';
|
|
144
146
|
};
|
|
145
147
|
readonly ifUndefined: true;
|
|
146
148
|
}];
|
|
147
149
|
readonly install: [{
|
|
148
|
-
readonly type:
|
|
149
|
-
readonly global:
|
|
150
|
+
readonly type: 'callGlobal';
|
|
151
|
+
readonly global: 'fbq';
|
|
150
152
|
readonly args: ["consent", "grant"];
|
|
151
153
|
}, {
|
|
152
|
-
readonly type:
|
|
153
|
-
readonly global:
|
|
154
|
+
readonly type: 'callGlobal';
|
|
155
|
+
readonly global: 'fbq';
|
|
154
156
|
readonly args: ["init", "{{pixelId}}"];
|
|
155
157
|
}, {
|
|
156
|
-
readonly type:
|
|
157
|
-
readonly global:
|
|
158
|
+
readonly type: 'callGlobal';
|
|
159
|
+
readonly global: 'fbq';
|
|
158
160
|
readonly args: ["track", "PageView"];
|
|
159
161
|
}, {
|
|
160
|
-
readonly type:
|
|
161
|
-
readonly src:
|
|
162
|
+
readonly type: 'loadScript';
|
|
163
|
+
readonly src: '{{scriptSrc}}';
|
|
162
164
|
readonly async: true;
|
|
163
165
|
}];
|
|
164
166
|
readonly onConsentGranted: [{
|
|
165
|
-
readonly type:
|
|
166
|
-
readonly global:
|
|
167
|
+
readonly type: 'callGlobal';
|
|
168
|
+
readonly global: 'fbq';
|
|
167
169
|
readonly args: ["consent", "grant"];
|
|
168
170
|
}];
|
|
169
171
|
readonly onConsentDenied: [{
|
|
170
|
-
readonly type:
|
|
171
|
-
readonly global:
|
|
172
|
+
readonly type: 'callGlobal';
|
|
173
|
+
readonly global: 'fbq';
|
|
172
174
|
readonly args: ["consent", "revoke"];
|
|
173
175
|
}];
|
|
174
|
-
readonly kind: "c15t.vendor-manifest";
|
|
175
|
-
readonly schemaVersion: 1;
|
|
176
176
|
};
|
|
177
177
|
export interface MetaPixelOptions {
|
|
178
178
|
/**
|
|
@@ -11,70 +11,70 @@ declare global {
|
|
|
11
11
|
* `window.uetq.push('consent', 'default'|'update', consentState)`.
|
|
12
12
|
*/
|
|
13
13
|
export declare const microsoftUetManifest: {
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
14
|
+
readonly kind: "c15t.vendor-manifest";
|
|
15
|
+
readonly schemaVersion: 1;
|
|
16
|
+
readonly vendor: 'microsoft-uet';
|
|
17
|
+
readonly category: 'marketing';
|
|
16
18
|
readonly alwaysLoad: true;
|
|
17
19
|
readonly persistAfterConsentRevoked: true;
|
|
18
20
|
readonly bootstrap: [{
|
|
19
|
-
readonly type:
|
|
20
|
-
readonly name:
|
|
21
|
+
readonly type: 'setGlobal';
|
|
22
|
+
readonly name: 'uetq';
|
|
21
23
|
readonly value: readonly [];
|
|
22
24
|
readonly ifUndefined: true;
|
|
23
25
|
}];
|
|
24
26
|
readonly onBeforeLoadGranted: [{
|
|
25
|
-
readonly type:
|
|
26
|
-
readonly global:
|
|
27
|
-
readonly method:
|
|
27
|
+
readonly type: 'callGlobal';
|
|
28
|
+
readonly global: 'uetq';
|
|
29
|
+
readonly method: 'push';
|
|
28
30
|
readonly args: ["consent", "default", {
|
|
29
|
-
readonly ad_storage:
|
|
31
|
+
readonly ad_storage: 'granted';
|
|
30
32
|
}];
|
|
31
33
|
}];
|
|
32
34
|
readonly onBeforeLoadDenied: [{
|
|
33
|
-
readonly type:
|
|
34
|
-
readonly global:
|
|
35
|
-
readonly method:
|
|
35
|
+
readonly type: 'callGlobal';
|
|
36
|
+
readonly global: 'uetq';
|
|
37
|
+
readonly method: 'push';
|
|
36
38
|
readonly args: ["consent", "default", {
|
|
37
|
-
readonly ad_storage:
|
|
39
|
+
readonly ad_storage: 'denied';
|
|
38
40
|
}];
|
|
39
41
|
}];
|
|
40
42
|
readonly install: [{
|
|
41
|
-
readonly type:
|
|
42
|
-
readonly src:
|
|
43
|
+
readonly type: 'loadScript';
|
|
44
|
+
readonly src: '{{scriptSrc}}';
|
|
43
45
|
readonly async: true;
|
|
44
46
|
}];
|
|
45
47
|
readonly afterLoad: [{
|
|
46
|
-
readonly type:
|
|
47
|
-
readonly constructor:
|
|
48
|
-
readonly assignTo:
|
|
48
|
+
readonly type: 'constructGlobal';
|
|
49
|
+
readonly constructor: 'UET';
|
|
50
|
+
readonly assignTo: 'uetq';
|
|
49
51
|
readonly args: [{
|
|
50
|
-
readonly ti:
|
|
52
|
+
readonly ti: '{{id}}';
|
|
51
53
|
readonly enableAutoSpaTracking: true;
|
|
52
54
|
}];
|
|
53
|
-
readonly copyAssignedValueToArgProperty:
|
|
55
|
+
readonly copyAssignedValueToArgProperty: 'q';
|
|
54
56
|
}, {
|
|
55
|
-
readonly type:
|
|
56
|
-
readonly global:
|
|
57
|
-
readonly method:
|
|
57
|
+
readonly type: 'callGlobal';
|
|
58
|
+
readonly global: 'uetq';
|
|
59
|
+
readonly method: 'push';
|
|
58
60
|
readonly args: ["pageLoad"];
|
|
59
61
|
}];
|
|
60
62
|
readonly onConsentGranted: [{
|
|
61
|
-
readonly type:
|
|
62
|
-
readonly global:
|
|
63
|
-
readonly method:
|
|
63
|
+
readonly type: 'callGlobal';
|
|
64
|
+
readonly global: 'uetq';
|
|
65
|
+
readonly method: 'push';
|
|
64
66
|
readonly args: ["consent", "update", {
|
|
65
|
-
readonly ad_storage:
|
|
67
|
+
readonly ad_storage: 'granted';
|
|
66
68
|
}];
|
|
67
69
|
}];
|
|
68
70
|
readonly onConsentDenied: [{
|
|
69
|
-
readonly type:
|
|
70
|
-
readonly global:
|
|
71
|
-
readonly method:
|
|
71
|
+
readonly type: 'callGlobal';
|
|
72
|
+
readonly global: 'uetq';
|
|
73
|
+
readonly method: 'push';
|
|
72
74
|
readonly args: ["consent", "update", {
|
|
73
|
-
readonly ad_storage:
|
|
75
|
+
readonly ad_storage: 'denied';
|
|
74
76
|
}];
|
|
75
77
|
}];
|
|
76
|
-
readonly kind: "c15t.vendor-manifest";
|
|
77
|
-
readonly schemaVersion: 1;
|
|
78
78
|
};
|
|
79
79
|
export interface MicrosoftUetOptions {
|
|
80
80
|
/**
|
|
@@ -130,44 +130,44 @@ declare global {
|
|
|
130
130
|
* event before the external bundle loads.
|
|
131
131
|
*/
|
|
132
132
|
export declare const redditPixelManifest: {
|
|
133
|
-
readonly
|
|
134
|
-
readonly
|
|
133
|
+
readonly kind: "c15t.vendor-manifest";
|
|
134
|
+
readonly schemaVersion: 1;
|
|
135
|
+
readonly vendor: 'reddit-pixel';
|
|
136
|
+
readonly category: 'marketing';
|
|
135
137
|
readonly persistAfterConsentRevoked: true;
|
|
136
138
|
readonly bootstrap: [{
|
|
137
|
-
readonly type:
|
|
138
|
-
readonly name:
|
|
139
|
+
readonly type: 'defineStubFunction';
|
|
140
|
+
readonly name: 'rdt';
|
|
139
141
|
readonly queue: {
|
|
140
|
-
readonly property:
|
|
142
|
+
readonly property: 'callQueue';
|
|
141
143
|
};
|
|
142
|
-
readonly dispatchProperty:
|
|
143
|
-
readonly queueFormat:
|
|
144
|
+
readonly dispatchProperty: 'sendEvent';
|
|
145
|
+
readonly queueFormat: 'array';
|
|
144
146
|
readonly ifUndefined: true;
|
|
145
147
|
}];
|
|
146
148
|
readonly install: [{
|
|
147
|
-
readonly type:
|
|
148
|
-
readonly global:
|
|
149
|
+
readonly type: 'callGlobal';
|
|
150
|
+
readonly global: 'rdt';
|
|
149
151
|
readonly args: ["init", "{{pixelId}}"];
|
|
150
152
|
}, {
|
|
151
|
-
readonly type:
|
|
152
|
-
readonly global:
|
|
153
|
+
readonly type: 'callGlobal';
|
|
154
|
+
readonly global: 'rdt';
|
|
153
155
|
readonly args: ["track", "PageVisit"];
|
|
154
156
|
}, {
|
|
155
|
-
readonly type:
|
|
156
|
-
readonly src:
|
|
157
|
+
readonly type: 'loadScript';
|
|
158
|
+
readonly src: '{{scriptUrl}}';
|
|
157
159
|
readonly async: true;
|
|
158
160
|
}];
|
|
159
161
|
readonly onConsentGranted: [{
|
|
160
|
-
readonly type:
|
|
161
|
-
readonly global:
|
|
162
|
+
readonly type: 'callGlobal';
|
|
163
|
+
readonly global: 'rdt';
|
|
162
164
|
readonly args: ["enableFirstPartyCookies"];
|
|
163
165
|
}];
|
|
164
166
|
readonly onConsentDenied: [{
|
|
165
|
-
readonly type:
|
|
166
|
-
readonly global:
|
|
167
|
+
readonly type: 'callGlobal';
|
|
168
|
+
readonly global: 'rdt';
|
|
167
169
|
readonly args: ["disableFirstPartyCookies"];
|
|
168
170
|
}];
|
|
169
|
-
readonly kind: "c15t.vendor-manifest";
|
|
170
|
-
readonly schemaVersion: 1;
|
|
171
171
|
};
|
|
172
172
|
export interface RedditPixelOptions {
|
|
173
173
|
/**
|
|
@@ -62,39 +62,39 @@ declare global {
|
|
|
62
62
|
* `PAGE_VIEW` event before the vendor bundle loads.
|
|
63
63
|
*/
|
|
64
64
|
export declare const snapchatPixelManifest: {
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
65
|
+
readonly kind: "c15t.vendor-manifest";
|
|
66
|
+
readonly schemaVersion: 1;
|
|
67
|
+
readonly vendor: 'snapchat-pixel';
|
|
68
|
+
readonly category: 'marketing';
|
|
67
69
|
readonly bootstrap: [{
|
|
68
|
-
readonly type:
|
|
69
|
-
readonly name:
|
|
70
|
+
readonly type: 'defineStubFunction';
|
|
71
|
+
readonly name: 'snaptr';
|
|
70
72
|
readonly queue: {
|
|
71
|
-
readonly property:
|
|
73
|
+
readonly property: 'queue';
|
|
72
74
|
};
|
|
73
|
-
readonly dispatchProperty:
|
|
74
|
-
readonly queueFormat:
|
|
75
|
+
readonly dispatchProperty: 'handleRequest';
|
|
76
|
+
readonly queueFormat: 'array';
|
|
75
77
|
readonly aliases: ["_snaptr"];
|
|
76
78
|
readonly selfReferences: ["push"];
|
|
77
79
|
readonly properties: {
|
|
78
80
|
readonly loaded: true;
|
|
79
|
-
readonly version:
|
|
81
|
+
readonly version: '1.0';
|
|
80
82
|
};
|
|
81
83
|
readonly ifUndefined: true;
|
|
82
84
|
}];
|
|
83
85
|
readonly install: [{
|
|
84
|
-
readonly type:
|
|
85
|
-
readonly global:
|
|
86
|
+
readonly type: 'callGlobal';
|
|
87
|
+
readonly global: 'snaptr';
|
|
86
88
|
readonly args: ["init", "{{pixelId}}"];
|
|
87
89
|
}, {
|
|
88
|
-
readonly type:
|
|
89
|
-
readonly global:
|
|
90
|
+
readonly type: 'callGlobal';
|
|
91
|
+
readonly global: 'snaptr';
|
|
90
92
|
readonly args: ["track", "PAGE_VIEW"];
|
|
91
93
|
}, {
|
|
92
|
-
readonly type:
|
|
93
|
-
readonly src:
|
|
94
|
+
readonly type: 'loadScript';
|
|
95
|
+
readonly src: '{{scriptUrl}}';
|
|
94
96
|
readonly async: true;
|
|
95
97
|
}];
|
|
96
|
-
readonly kind: "c15t.vendor-manifest";
|
|
97
|
-
readonly schemaVersion: 1;
|
|
98
98
|
};
|
|
99
99
|
export interface SnapchatPixelOptions {
|
|
100
100
|
/**
|
|
@@ -29,53 +29,53 @@ declare global {
|
|
|
29
29
|
* via `ttq.grantConsent()` / `ttq.revokeConsent()`.
|
|
30
30
|
*/
|
|
31
31
|
export declare const tiktokPixelManifest: {
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
32
|
+
readonly kind: "c15t.vendor-manifest";
|
|
33
|
+
readonly schemaVersion: 1;
|
|
34
|
+
readonly vendor: 'tiktok-pixel';
|
|
35
|
+
readonly category: 'marketing';
|
|
34
36
|
readonly persistAfterConsentRevoked: true;
|
|
35
37
|
readonly bootstrap: [{
|
|
36
|
-
readonly type:
|
|
37
|
-
readonly name:
|
|
38
|
-
readonly value:
|
|
38
|
+
readonly type: 'setGlobal';
|
|
39
|
+
readonly name: 'TiktokAnalyticsObject';
|
|
40
|
+
readonly value: 'ttq';
|
|
39
41
|
}, {
|
|
40
|
-
readonly type:
|
|
41
|
-
readonly name:
|
|
42
|
+
readonly type: 'setGlobal';
|
|
43
|
+
readonly name: 'ttq';
|
|
42
44
|
readonly value: readonly [];
|
|
43
45
|
readonly ifUndefined: true;
|
|
44
46
|
}, {
|
|
45
|
-
readonly type:
|
|
46
|
-
readonly target:
|
|
47
|
+
readonly type: 'defineQueueMethods';
|
|
48
|
+
readonly target: 'ttq';
|
|
47
49
|
readonly methods: ["page", "track", "identify", "instances", "debug", "on", "off", "once", "ready", "alias", "group", "enableCookie", "disableCookie", "holdConsent", "revokeConsent", "grantConsent"];
|
|
48
50
|
}];
|
|
49
51
|
readonly install: [{
|
|
50
|
-
readonly type:
|
|
51
|
-
readonly global:
|
|
52
|
-
readonly method:
|
|
52
|
+
readonly type: 'callGlobal';
|
|
53
|
+
readonly global: 'ttq';
|
|
54
|
+
readonly method: 'grantConsent';
|
|
53
55
|
}, {
|
|
54
|
-
readonly type:
|
|
55
|
-
readonly global:
|
|
56
|
-
readonly method:
|
|
56
|
+
readonly type: 'callGlobal';
|
|
57
|
+
readonly global: 'ttq';
|
|
58
|
+
readonly method: 'page';
|
|
57
59
|
}, {
|
|
58
|
-
readonly type:
|
|
59
|
-
readonly src:
|
|
60
|
+
readonly type: 'loadScript';
|
|
61
|
+
readonly src: '{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq';
|
|
60
62
|
readonly async: true;
|
|
61
63
|
}];
|
|
62
64
|
readonly afterLoad: [{
|
|
63
|
-
readonly type:
|
|
64
|
-
readonly global:
|
|
65
|
-
readonly method:
|
|
65
|
+
readonly type: 'callGlobal';
|
|
66
|
+
readonly global: 'ttq';
|
|
67
|
+
readonly method: 'grantConsent';
|
|
66
68
|
}];
|
|
67
69
|
readonly onConsentGranted: [{
|
|
68
|
-
readonly type:
|
|
69
|
-
readonly global:
|
|
70
|
-
readonly method:
|
|
70
|
+
readonly type: 'callGlobal';
|
|
71
|
+
readonly global: 'ttq';
|
|
72
|
+
readonly method: 'grantConsent';
|
|
71
73
|
}];
|
|
72
74
|
readonly onConsentDenied: [{
|
|
73
|
-
readonly type:
|
|
74
|
-
readonly global:
|
|
75
|
-
readonly method:
|
|
75
|
+
readonly type: 'callGlobal';
|
|
76
|
+
readonly global: 'ttq';
|
|
77
|
+
readonly method: 'revokeConsent';
|
|
76
78
|
}];
|
|
77
|
-
readonly kind: "c15t.vendor-manifest";
|
|
78
|
-
readonly schemaVersion: 1;
|
|
79
79
|
};
|
|
80
80
|
export interface TikTokPixelOptions {
|
|
81
81
|
/**
|
|
@@ -105,31 +105,31 @@ declare global {
|
|
|
105
105
|
* No consent API — the script simply loads or doesn't based on consent.
|
|
106
106
|
*/
|
|
107
107
|
export declare const xPixelManifest: {
|
|
108
|
-
readonly
|
|
109
|
-
readonly
|
|
108
|
+
readonly kind: "c15t.vendor-manifest";
|
|
109
|
+
readonly schemaVersion: 1;
|
|
110
|
+
readonly vendor: 'x-pixel';
|
|
111
|
+
readonly category: 'marketing';
|
|
110
112
|
readonly bootstrap: [{
|
|
111
|
-
readonly type:
|
|
112
|
-
readonly name:
|
|
113
|
+
readonly type: 'defineStubFunction';
|
|
114
|
+
readonly name: 'twq';
|
|
113
115
|
readonly queue: {
|
|
114
|
-
readonly property:
|
|
116
|
+
readonly property: 'queue';
|
|
115
117
|
};
|
|
116
|
-
readonly dispatchProperty:
|
|
118
|
+
readonly dispatchProperty: 'exe';
|
|
117
119
|
readonly properties: {
|
|
118
|
-
readonly version:
|
|
120
|
+
readonly version: '1.1';
|
|
119
121
|
};
|
|
120
122
|
readonly ifUndefined: true;
|
|
121
123
|
}];
|
|
122
124
|
readonly install: [{
|
|
123
|
-
readonly type:
|
|
124
|
-
readonly global:
|
|
125
|
+
readonly type: 'callGlobal';
|
|
126
|
+
readonly global: 'twq';
|
|
125
127
|
readonly args: ["config", "{{pixelId}}"];
|
|
126
128
|
}, {
|
|
127
|
-
readonly type:
|
|
128
|
-
readonly src:
|
|
129
|
+
readonly type: 'loadScript';
|
|
130
|
+
readonly src: '{{scriptSrc}}';
|
|
129
131
|
readonly async: true;
|
|
130
132
|
}];
|
|
131
|
-
readonly kind: "c15t.vendor-manifest";
|
|
132
|
-
readonly schemaVersion: 1;
|
|
133
133
|
};
|
|
134
134
|
export interface XPixelOptions {
|
|
135
135
|
/**
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
import { type VendorManifest } from '../../types';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
adobeDataLayer?: unknown[];
|
|
6
|
+
_satellite?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Adobe Analytics vendor manifest.
|
|
11
|
+
*
|
|
12
|
+
* Loads the Adobe Experience Platform Data Collection Tags embed script for a
|
|
13
|
+
* specific property environment. Adobe does not provide a generic public
|
|
14
|
+
* loader; each customer copies their own environment URL from Data Collection,
|
|
15
|
+
* commonly hosted at `https://assets.adobedtm.com/.../launch-*.min.js`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const adobeAnalyticsManifest: VendorManifest;
|
|
18
|
+
export interface AdobeAnalyticsOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Adobe Experience Platform Data Collection web property embed URL.
|
|
21
|
+
*
|
|
22
|
+
* This must be the full `https:` URL from your Adobe Tags environment embed
|
|
23
|
+
* code, commonly shaped like
|
|
24
|
+
* `https://assets.adobedtm.com/{org}/{property}/launch-{env}.min.js`.
|
|
25
|
+
* Self-hosted Launch/Tags embeds are supported as long as they use `https:`.
|
|
26
|
+
*/
|
|
27
|
+
scriptUrl: string;
|
|
28
|
+
/**
|
|
29
|
+
* Load the Adobe Tags library asynchronously.
|
|
30
|
+
*
|
|
31
|
+
* Adobe recommends asynchronous deployment for most web properties. Set this
|
|
32
|
+
* to `false` only for legacy synchronous setups that require ordered blocking
|
|
33
|
+
* behavior.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
async?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Seed the Adobe Client Data Layer queue before the Tags library loads.
|
|
39
|
+
*
|
|
40
|
+
* When enabled, c15t creates `window.adobeDataLayer = []` only when the
|
|
41
|
+
* global is still undefined. This matches Adobe Client Data Layer's default
|
|
42
|
+
* object name and is harmless for properties that do not use the extension.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
seedAdobeDataLayer?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates an Adobe Analytics script.
|
|
49
|
+
*
|
|
50
|
+
* @see https://experienceleague.adobe.com/en/docs/experience-platform/tags/publish/environments/environments
|
|
51
|
+
* @see https://experienceleague.adobe.com/en/docs/experience-platform/tags/extensions/client/client-data-layer/overview
|
|
52
|
+
*
|
|
53
|
+
* @param options - The options for the Adobe Analytics script.
|
|
54
|
+
* @returns The Adobe Analytics script.
|
|
55
|
+
* @throws {Error} When `scriptUrl` is missing, empty, invalid, or not `https:`.
|
|
56
|
+
* Copy the full web property embed URL from Adobe Data Collection and pass it
|
|
57
|
+
* as `scriptUrl`.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* Adobe Analytics is commonly deployed through Adobe Experience Platform Data
|
|
61
|
+
* Collection Tags (formerly Launch). The loaded property may in turn load Adobe
|
|
62
|
+
* Analytics, Web SDK, or other extensions and rules, so configure those Adobe
|
|
63
|
+
* rules to respect your consent model too.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { adobeAnalytics } from '@c15t/scripts/adobe-analytics';
|
|
68
|
+
*
|
|
69
|
+
* adobeAnalytics({
|
|
70
|
+
* scriptUrl:
|
|
71
|
+
* 'https://assets.adobedtm.com/YOUR_ORG/YOUR_PROPERTY/launch-production.min.js',
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function adobeAnalytics(options: AdobeAnalyticsOptions): Script;
|