@c15t/scripts 2.2.0 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/AGENTS.md +74 -48
  2. package/README.md +3 -3
  3. package/dist/e2e-test-utils.js +60 -24
  4. package/dist/engine/compile.js +45 -45
  5. package/dist/engine/runtime.js +119 -119
  6. package/dist/registry.js +186 -176
  7. package/dist/resolve.js +12 -12
  8. package/dist/vendors/_shared/attributes.js +5 -5
  9. package/dist/vendors/_shared/google-consent.js +10 -10
  10. package/dist/vendors/_shared/install-builders.js +9 -9
  11. package/dist/vendors/_shared/script-url.js +12 -12
  12. package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
  13. package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
  14. package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
  15. package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
  16. package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
  17. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
  18. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
  19. package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
  20. package/dist/vendors/analytics/adobe-analytics.js +17 -17
  21. package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
  22. package/dist/vendors/analytics/amplitude.js +39 -39
  23. package/dist/vendors/analytics/clearbit.js +11 -11
  24. package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
  25. package/dist/vendors/analytics/databuddy.js +45 -45
  26. package/dist/vendors/analytics/fathom-analytics.js +15 -15
  27. package/dist/vendors/analytics/google-tag.js +23 -23
  28. package/dist/vendors/analytics/heap.js +37 -37
  29. package/dist/vendors/analytics/hightouch.js +30 -30
  30. package/dist/vendors/analytics/hotjar.js +14 -14
  31. package/dist/vendors/analytics/logrocket.js +24 -24
  32. package/dist/vendors/analytics/matomo-analytics.js +51 -51
  33. package/dist/vendors/analytics/microsoft-clarity.js +31 -31
  34. package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
  35. package/dist/vendors/analytics/pirsch.js +27 -27
  36. package/dist/vendors/analytics/plausible-analytics.js +24 -24
  37. package/dist/vendors/analytics/posthog.js +84 -79
  38. package/dist/vendors/analytics/promptwatch.js +8 -8
  39. package/dist/vendors/analytics/rudderstack.js +50 -50
  40. package/dist/vendors/analytics/rybbit-analytics.js +30 -30
  41. package/dist/vendors/analytics/segment.js +16 -16
  42. package/dist/vendors/analytics/umami-analytics.js +16 -16
  43. package/dist/vendors/analytics/vercel-analytics.js +22 -22
  44. package/dist/vendors/functional/crisp.js +49 -51
  45. package/dist/vendors/functional/intercom.js +18 -18
  46. package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
  47. package/dist-types/__tests__/helpers.d.ts +10 -10
  48. package/dist-types/engine/compile.d.ts +2 -2
  49. package/dist-types/engine/runtime.d.ts +3 -3
  50. package/dist-types/registry.d.ts +182 -173
  51. package/dist-types/resolve.d.ts +2 -2
  52. package/dist-types/types.d.ts +2 -2
  53. package/dist-types/vendors/_shared/attributes.d.ts +2 -2
  54. package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
  55. package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
  56. package/dist-types/vendors/_shared/script-url.d.ts +6 -6
  57. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
  58. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
  59. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
  60. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
  61. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
  62. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
  63. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
  64. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
  65. package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
  66. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
  67. package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
  68. package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
  69. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
  70. package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
  71. package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
  72. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  73. package/dist-types/vendors/analytics/heap.d.ts +17 -17
  74. package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
  75. package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
  76. package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
  77. package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
  78. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
  79. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
  80. package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
  81. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  82. package/dist-types/vendors/analytics/posthog.d.ts +35 -32
  83. package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
  84. package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
  85. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
  86. package/dist-types/vendors/analytics/segment.d.ts +11 -11
  87. package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
  88. package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
  89. package/dist-types/vendors/functional/crisp.d.ts +9 -9
  90. package/dist-types/vendors/functional/intercom.d.ts +12 -12
  91. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
  92. package/docs/README.md +74 -48
  93. package/docs/assets/v3/brand-bar.png +0 -0
  94. package/docs/assets/v3/brand-card.png +0 -0
  95. package/docs/assets/v3/choice-wall.png +0 -0
  96. package/docs/assets/v3/mobile-card.png +0 -0
  97. package/docs/assets/v3/preferences.png +0 -0
  98. package/docs/customization/overview.md +45 -0
  99. package/docs/customization/recipes.md +79 -0
  100. package/docs/customization/slots.md +55 -0
  101. package/docs/customization/tokens.md +76 -0
  102. package/docs/customization/translations.md +49 -0
  103. package/docs/frameworks/javascript/script-loader.md +30 -339
  104. package/docs/frameworks/next/script-loader.md +134 -467
  105. package/docs/frameworks/react/script-loader.md +35 -535
  106. package/docs/guides/consent-state.md +60 -0
  107. package/docs/guides/data-fetching.md +163 -0
  108. package/docs/guides/deployment-modes.md +63 -0
  109. package/docs/guides/troubleshooting.md +68 -0
  110. package/docs/guides/verify-consent.md +62 -0
  111. package/docs/integrations/adobe-analytics.md +239 -105
  112. package/docs/integrations/ahrefs-analytics.md +238 -104
  113. package/docs/integrations/amplitude.md +219 -157
  114. package/docs/integrations/building-integrations.md +32 -224
  115. package/docs/integrations/clearbit.md +247 -86
  116. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  117. package/docs/integrations/crisp.md +251 -97
  118. package/docs/integrations/databuddy.md +259 -153
  119. package/docs/integrations/fathom-analytics.md +239 -96
  120. package/docs/integrations/google-maps.md +328 -207
  121. package/docs/integrations/google-tag-manager.md +248 -96
  122. package/docs/integrations/google-tag.md +261 -90
  123. package/docs/integrations/heap.md +222 -149
  124. package/docs/integrations/hightouch.md +225 -131
  125. package/docs/integrations/hotjar.md +239 -90
  126. package/docs/integrations/intercom.md +239 -98
  127. package/docs/integrations/linkedin-insights.md +243 -113
  128. package/docs/integrations/logrocket.md +241 -123
  129. package/docs/integrations/matomo-analytics.md +256 -111
  130. package/docs/integrations/meta-pixel.md +197 -324
  131. package/docs/integrations/microsoft-clarity.md +233 -114
  132. package/docs/integrations/microsoft-uet.md +245 -110
  133. package/docs/integrations/mixpanel-analytics.md +252 -87
  134. package/docs/integrations/openai-pixel.md +441 -0
  135. package/docs/integrations/overview.md +95 -133
  136. package/docs/integrations/pirsch.md +249 -96
  137. package/docs/integrations/plausible-analytics.md +241 -100
  138. package/docs/integrations/posthog.md +353 -214
  139. package/docs/integrations/promptwatch.md +251 -81
  140. package/docs/integrations/reddit-pixel.md +226 -173
  141. package/docs/integrations/rudderstack.md +244 -187
  142. package/docs/integrations/rybbit-analytics.md +244 -91
  143. package/docs/integrations/segment.md +238 -92
  144. package/docs/integrations/snapchat-pixel.md +240 -110
  145. package/docs/integrations/tiktok-pixel.md +249 -81
  146. package/docs/integrations/umami-analytics.md +242 -95
  147. package/docs/integrations/vercel-analytics.md +242 -90
  148. package/docs/integrations/x-pixel.md +238 -104
  149. package/docs/integrations/youtube.md +354 -142
  150. package/docs/upgrade-v3.md +334 -0
  151. package/package.json +85 -78
  152. package/readme.json +2 -2
  153. package/dist/e2e-test-utils.cjs +0 -166
  154. package/dist/engine/compile.cjs +0 -130
  155. package/dist/engine/runtime.cjs +0 -475
  156. package/dist/registry.cjs +0 -423
  157. package/dist/resolve.cjs +0 -71
  158. package/dist/types.cjs +0 -69
  159. package/dist/vendors/_shared/attributes.cjs +0 -55
  160. package/dist/vendors/_shared/google-consent.cjs +0 -69
  161. package/dist/vendors/_shared/install-builders.cjs +0 -59
  162. package/dist/vendors/_shared/script-url.cjs +0 -78
  163. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
  164. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
  165. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
  166. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
  167. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
  168. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
  169. package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
  170. package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
  171. package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
  172. package/dist/vendors/analytics/amplitude.cjs +0 -193
  173. package/dist/vendors/analytics/clearbit.cjs +0 -69
  174. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
  175. package/dist/vendors/analytics/databuddy.cjs +0 -144
  176. package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
  177. package/dist/vendors/analytics/google-tag.cjs +0 -107
  178. package/dist/vendors/analytics/heap.cjs +0 -181
  179. package/dist/vendors/analytics/hightouch.cjs +0 -153
  180. package/dist/vendors/analytics/hotjar.cjs +0 -85
  181. package/dist/vendors/analytics/logrocket.cjs +0 -99
  182. package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
  183. package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
  184. package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
  185. package/dist/vendors/analytics/pirsch.cjs +0 -108
  186. package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
  187. package/dist/vendors/analytics/posthog.cjs +0 -236
  188. package/dist/vendors/analytics/promptwatch.cjs +0 -70
  189. package/dist/vendors/analytics/rudderstack.cjs +0 -227
  190. package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
  191. package/dist/vendors/analytics/segment.cjs +0 -97
  192. package/dist/vendors/analytics/umami-analytics.cjs +0 -80
  193. package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
  194. package/dist/vendors/functional/crisp.cjs +0 -143
  195. package/dist/vendors/functional/intercom.cjs +0 -89
  196. package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
  197. package/docs/shared/react/guides/script-loader.md +0 -311
@@ -1,12 +1,12 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  export interface LinkedInInsightsConversionEvent {
3
3
  conversion_id: string | number;
4
4
  [key: string]: unknown;
5
5
  }
6
- type LinkedInInsightsFunction = {
6
+ interface LinkedInInsightsFunction {
7
7
  (command: 'track', event: LinkedInInsightsConversionEvent): void;
8
8
  (command: string, ...args: unknown[]): void;
9
- };
9
+ }
10
10
  declare global {
11
11
  interface Window {
12
12
  lintrk: LinkedInInsightsFunction & {
@@ -30,35 +30,35 @@ declare global {
30
30
  export declare const linkedinInsightsManifest: {
31
31
  readonly kind: "c15t.vendor-manifest";
32
32
  readonly schemaVersion: 1;
33
- readonly vendor: 'linkedin-insights';
34
33
  readonly category: 'marketing';
35
34
  readonly install: [{
36
- readonly type: 'setGlobal';
35
+ readonly ifUndefined: false;
37
36
  readonly name: '_linkedin_partner_id';
37
+ readonly type: 'setGlobal';
38
38
  readonly value: '{{id}}';
39
- readonly ifUndefined: false;
40
39
  }, {
41
- readonly type: 'setGlobal';
40
+ readonly ifUndefined: true;
42
41
  readonly name: '_linkedin_data_partner_ids';
42
+ readonly type: 'setGlobal';
43
43
  readonly value: readonly [];
44
- readonly ifUndefined: true;
45
44
  }, {
46
- readonly type: 'pushToQueue';
47
45
  readonly queue: '_linkedin_data_partner_ids';
46
+ readonly type: 'pushToQueue';
48
47
  readonly value: '{{id}}';
49
48
  }, {
50
- readonly type: 'defineStubFunction';
49
+ readonly ifUndefined: true;
51
50
  readonly name: 'lintrk';
52
51
  readonly queue: {
53
52
  readonly property: 'q';
54
53
  };
55
54
  readonly queueFormat: 'array';
56
- readonly ifUndefined: true;
55
+ readonly type: 'defineStubFunction';
57
56
  }, {
58
- readonly type: 'loadScript';
59
- readonly src: '{{scriptSrc}}';
60
57
  readonly async: true;
58
+ readonly src: '{{scriptSrc}}';
59
+ readonly type: 'loadScript';
61
60
  }];
61
+ readonly vendor: 'linkedin-insights';
62
62
  };
63
63
  export interface LinkedInInsightsOptions {
64
64
  /**
@@ -88,5 +88,5 @@ export interface LinkedInInsightsOptions {
88
88
  *
89
89
  * @see {@link https://www.linkedin.com/help/lms/answer/a418880} Add the LinkedIn Insight Tag to your website
90
90
  */
91
- export declare function linkedinInsights({ id, scriptSrc, }: LinkedInInsightsOptions): Script;
91
+ export declare const linkedinInsights: ({ id, scriptSrc, }: LinkedInInsightsOptions) => Script;
92
92
  export {};
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  /**
3
3
  * Represents the `contents` array object property.
4
4
  */
@@ -128,51 +128,51 @@ declare global {
128
128
  export declare const metaPixelManifest: {
129
129
  readonly kind: "c15t.vendor-manifest";
130
130
  readonly schemaVersion: 1;
131
- readonly vendor: 'meta-pixel';
132
- readonly category: 'marketing';
133
- readonly persistAfterConsentRevoked: true;
134
131
  readonly bootstrap: [{
135
- readonly type: 'defineStubFunction';
136
- readonly name: 'fbq';
137
- readonly queue: {
138
- readonly property: 'queue';
139
- };
140
- readonly dispatchProperty: 'callMethod';
141
- readonly selfReferences: ["push"];
142
132
  readonly aliases: ["_fbq"];
133
+ readonly dispatchProperty: 'callMethod';
134
+ readonly ifUndefined: true;
135
+ readonly name: 'fbq';
143
136
  readonly properties: {
144
137
  readonly loaded: true;
145
138
  readonly version: '2.0';
146
139
  };
147
- readonly ifUndefined: true;
140
+ readonly queue: {
141
+ readonly property: 'queue';
142
+ };
143
+ readonly selfReferences: ["push"];
144
+ readonly type: 'defineStubFunction';
148
145
  }];
146
+ readonly category: 'marketing';
149
147
  readonly install: [{
150
- readonly type: 'callGlobal';
151
- readonly global: 'fbq';
152
148
  readonly args: ["consent", "grant"];
153
- }, {
154
- readonly type: 'callGlobal';
155
149
  readonly global: 'fbq';
156
- readonly args: ["init", "{{pixelId}}"];
157
- }, {
158
150
  readonly type: 'callGlobal';
151
+ }, {
152
+ readonly args: ["init", "{{pixelId}}"];
159
153
  readonly global: 'fbq';
154
+ readonly type: 'callGlobal';
155
+ }, {
160
156
  readonly args: ["track", "PageView"];
157
+ readonly global: 'fbq';
158
+ readonly type: 'callGlobal';
161
159
  }, {
162
- readonly type: 'loadScript';
163
- readonly src: '{{scriptSrc}}';
164
160
  readonly async: true;
165
- }];
166
- readonly onConsentGranted: [{
167
- readonly type: 'callGlobal';
168
- readonly global: 'fbq';
169
- readonly args: ["consent", "grant"];
161
+ readonly src: '{{scriptSrc}}';
162
+ readonly type: 'loadScript';
170
163
  }];
171
164
  readonly onConsentDenied: [{
165
+ readonly args: ["consent", "revoke"];
166
+ readonly global: 'fbq';
172
167
  readonly type: 'callGlobal';
168
+ }];
169
+ readonly onConsentGranted: [{
170
+ readonly args: ["consent", "grant"];
173
171
  readonly global: 'fbq';
174
- readonly args: ["consent", "revoke"];
172
+ readonly type: 'callGlobal';
175
173
  }];
174
+ readonly persistAfterConsentRevoked: true;
175
+ readonly vendor: 'meta-pixel';
176
176
  };
177
177
  export interface MetaPixelOptions {
178
178
  /**
@@ -216,7 +216,7 @@ export interface MetaPixelOptions {
216
216
  *
217
217
  * @see {@link https://developers.facebook.com/docs/meta-pixel/get-started} Meta Pixel documentation
218
218
  */
219
- export declare function metaPixel({ pixelId, initOptions, trackPageView, dataProcessingOptions, scriptSrc, }: MetaPixelOptions): Script;
219
+ export declare const metaPixel: ({ pixelId, initOptions, trackPageView, dataProcessingOptions, scriptSrc, }: MetaPixelOptions) => Script;
220
220
  /**
221
221
  * Tracks a Meta Pixel standard event.
222
222
  *
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  declare global {
3
3
  interface Window {
4
4
  uetq: unknown[] | undefined;
@@ -13,68 +13,68 @@ declare global {
13
13
  export declare const microsoftUetManifest: {
14
14
  readonly kind: "c15t.vendor-manifest";
15
15
  readonly schemaVersion: 1;
16
- readonly vendor: 'microsoft-uet';
17
- readonly category: 'marketing';
16
+ readonly afterLoad: [{
17
+ readonly args: [{
18
+ readonly enableAutoSpaTracking: true;
19
+ readonly ti: '{{id}}';
20
+ }];
21
+ readonly assignTo: 'uetq';
22
+ readonly constructor: 'UET';
23
+ readonly copyAssignedValueToArgProperty: 'q';
24
+ readonly type: 'constructGlobal';
25
+ }, {
26
+ readonly args: ["pageLoad"];
27
+ readonly global: 'uetq';
28
+ readonly method: 'push';
29
+ readonly type: 'callGlobal';
30
+ }];
18
31
  readonly alwaysLoad: true;
19
- readonly persistAfterConsentRevoked: true;
20
32
  readonly bootstrap: [{
21
- readonly type: 'setGlobal';
33
+ readonly ifUndefined: true;
22
34
  readonly name: 'uetq';
35
+ readonly type: 'setGlobal';
23
36
  readonly value: readonly [];
24
- readonly ifUndefined: true;
25
37
  }];
26
- readonly onBeforeLoadGranted: [{
27
- readonly type: 'callGlobal';
38
+ readonly category: 'marketing';
39
+ readonly install: [{
40
+ readonly async: true;
41
+ readonly src: '{{scriptSrc}}';
42
+ readonly type: 'loadScript';
43
+ }];
44
+ readonly onBeforeLoadDenied: [{
45
+ readonly args: ["consent", "default", {
46
+ readonly ad_storage: 'denied';
47
+ }];
28
48
  readonly global: 'uetq';
29
49
  readonly method: 'push';
50
+ readonly type: 'callGlobal';
51
+ }];
52
+ readonly onBeforeLoadGranted: [{
30
53
  readonly args: ["consent", "default", {
31
54
  readonly ad_storage: 'granted';
32
55
  }];
33
- }];
34
- readonly onBeforeLoadDenied: [{
35
- readonly type: 'callGlobal';
36
56
  readonly global: 'uetq';
37
57
  readonly method: 'push';
38
- readonly args: ["consent", "default", {
39
- readonly ad_storage: 'denied';
40
- }];
41
- }];
42
- readonly install: [{
43
- readonly type: 'loadScript';
44
- readonly src: '{{scriptSrc}}';
45
- readonly async: true;
58
+ readonly type: 'callGlobal';
46
59
  }];
47
- readonly afterLoad: [{
48
- readonly type: 'constructGlobal';
49
- readonly constructor: 'UET';
50
- readonly assignTo: 'uetq';
51
- readonly args: [{
52
- readonly ti: '{{id}}';
53
- readonly enableAutoSpaTracking: true;
60
+ readonly onConsentDenied: [{
61
+ readonly args: ["consent", "update", {
62
+ readonly ad_storage: 'denied';
54
63
  }];
55
- readonly copyAssignedValueToArgProperty: 'q';
56
- }, {
57
- readonly type: 'callGlobal';
58
64
  readonly global: 'uetq';
59
65
  readonly method: 'push';
60
- readonly args: ["pageLoad"];
66
+ readonly type: 'callGlobal';
61
67
  }];
62
68
  readonly onConsentGranted: [{
63
- readonly type: 'callGlobal';
64
- readonly global: 'uetq';
65
- readonly method: 'push';
66
69
  readonly args: ["consent", "update", {
67
70
  readonly ad_storage: 'granted';
68
71
  }];
69
- }];
70
- readonly onConsentDenied: [{
71
- readonly type: 'callGlobal';
72
72
  readonly global: 'uetq';
73
73
  readonly method: 'push';
74
- readonly args: ["consent", "update", {
75
- readonly ad_storage: 'denied';
76
- }];
74
+ readonly type: 'callGlobal';
77
75
  }];
76
+ readonly persistAfterConsentRevoked: true;
77
+ readonly vendor: 'microsoft-uet';
78
78
  };
79
79
  export interface MicrosoftUetOptions {
80
80
  /**
@@ -102,4 +102,4 @@ export interface MicrosoftUetOptions {
102
102
  *
103
103
  * @see https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking?view=bingads-13
104
104
  */
105
- export declare function microsoftUet({ id, scriptSrc }: MicrosoftUetOptions): Script;
105
+ export declare const microsoftUet: ({ id, scriptSrc, }: MicrosoftUetOptions) => Script;
@@ -0,0 +1,211 @@
1
+ import type { Script } from '@c15t/core';
2
+ /** User matching fields accepted by OpenAI. Hash identifiers before passing them. */
3
+ export interface OpenAIPixelUser {
4
+ /** SHA-256 of the trimmed, lowercase email address. */
5
+ email_sha256?: string;
6
+ /** SHA-256 of the normalized phone number, including its country code. */
7
+ phone_number_sha256?: string;
8
+ /** SHA-256 of the trimmed external ID, preserving case. */
9
+ external_id_sha256?: string;
10
+ /** SHA-256 of the lowercase first name without whitespace or ASCII punctuation. */
11
+ first_name_sha256?: string;
12
+ /** SHA-256 of the lowercase last name without whitespace or ASCII punctuation. */
13
+ last_name_sha256?: string;
14
+ /** Two-letter ISO 3166-1 country code. */
15
+ country?: string;
16
+ /** City name, up to 128 characters. */
17
+ city?: string;
18
+ /** State, province, or region, up to 128 characters. */
19
+ region?: string;
20
+ /** Postal or ZIP code, up to 32 characters. */
21
+ postal_code?: string;
22
+ }
23
+ /** Documented options for `oaiq('init', ...)`, including subsequent user updates. */
24
+ export interface OpenAIPixelInitOptions {
25
+ /** Required on first initialization; include for updates with multiple pixels. */
26
+ pixelId?: string;
27
+ /** Log SDK activity to the browser console. */
28
+ debug?: boolean;
29
+ /** Complete user matching payload. Raw identifiers must not be sent. */
30
+ user?: OpenAIPixelUser;
31
+ }
32
+ /** An item attached to a browser conversion event. */
33
+ export interface OpenAIPixelContent {
34
+ id?: string;
35
+ name?: string;
36
+ content_type?: string;
37
+ /** Integer item quantity. */
38
+ quantity?: number;
39
+ /** Integer amount in the currency's minor unit. */
40
+ amount?: number;
41
+ /** ISO 4217 code; may inherit the event currency. */
42
+ currency?: string;
43
+ }
44
+ /** Event-level amounts require an ISO 4217 currency code. */
45
+ type OpenAIPixelValue = {
46
+ amount: number;
47
+ currency: string;
48
+ } | {
49
+ amount?: never;
50
+ currency?: string;
51
+ };
52
+ /** Payload for page views and commerce events. */
53
+ export type OpenAIPixelContentsData = OpenAIPixelValue & {
54
+ type: 'contents';
55
+ contents?: OpenAIPixelContent[];
56
+ };
57
+ /** Payload for leads, registrations, and appointments. */
58
+ export type OpenAIPixelCustomerActionData = OpenAIPixelValue & {
59
+ type: 'customer_action';
60
+ };
61
+ /** Payload for subscriptions and trials. */
62
+ export type OpenAIPixelPlanData = OpenAIPixelValue & {
63
+ type: 'plan_enrollment';
64
+ plan_id?: string;
65
+ contents?: OpenAIPixelContent[];
66
+ };
67
+ /** Payload for a custom conversion. */
68
+ export type OpenAIPixelCustomData = OpenAIPixelValue & {
69
+ type: 'custom';
70
+ plan_id?: string;
71
+ contents?: OpenAIPixelContent[];
72
+ };
73
+ /** Browser event names and their required payload shapes. */
74
+ export interface OpenAIPixelEventData {
75
+ appointment_scheduled: OpenAIPixelCustomerActionData;
76
+ checkout_started: OpenAIPixelContentsData;
77
+ contents_viewed: OpenAIPixelContentsData;
78
+ items_added: OpenAIPixelContentsData;
79
+ lead_created: OpenAIPixelCustomerActionData;
80
+ order_created: OpenAIPixelContentsData;
81
+ page_viewed: OpenAIPixelContentsData;
82
+ registration_completed: OpenAIPixelCustomerActionData;
83
+ subscription_created: OpenAIPixelPlanData;
84
+ trial_started: OpenAIPixelPlanData;
85
+ }
86
+ /** Options passed separately from event data to the Measurement Pixel. */
87
+ export interface OpenAIPixelEventOptions {
88
+ /** Reuse the same ID for browser/server event deduplication. */
89
+ event_id?: string;
90
+ /** Opt this event out of future user-level personalization. */
91
+ opt_out?: boolean;
92
+ }
93
+ /** Custom events require a name in addition to their event data. */
94
+ export interface OpenAIPixelCustomEventOptions extends OpenAIPixelEventOptions {
95
+ /** A 1–64 character name using letters, numbers, underscores, or dashes. */
96
+ custom_event_name: string;
97
+ }
98
+ /** Arguments accepted by the event helper and the SDK's measure commands. */
99
+ export type OpenAIPixelEventArgs = {
100
+ [EventName in keyof OpenAIPixelEventData]: [
101
+ eventName: EventName,
102
+ data: OpenAIPixelEventData[EventName],
103
+ options?: OpenAIPixelEventOptions
104
+ ];
105
+ }[keyof OpenAIPixelEventData] | [
106
+ eventName: 'custom',
107
+ data: OpenAIPixelCustomData,
108
+ options: OpenAIPixelCustomEventOptions
109
+ ];
110
+ /** The documented OpenAI browser command API and its pre-load queue. */
111
+ export interface OpenAIPixelFunction {
112
+ (command: 'consent', granted: boolean): void;
113
+ (command: 'init', options: OpenAIPixelInitOptions): void;
114
+ (command: 'measure', ...args: OpenAIPixelEventArgs): void;
115
+ (command: 'measureSingle', pixelId: string, ...args: OpenAIPixelEventArgs): void;
116
+ /** Commands queued before the SDK replaces the stub. */
117
+ q?: IArguments[];
118
+ }
119
+ declare global {
120
+ interface Window {
121
+ oaiq?: OpenAIPixelFunction;
122
+ }
123
+ }
124
+ /** Options for the ChatGPT Ads Measurement Pixel. */
125
+ export interface OpenAIPixelOptions extends OpenAIPixelInitOptions {
126
+ /** Pixel ID from the conversions tab in OpenAI Ads Manager. */
127
+ pixelId: string;
128
+ /** Log SDK activity in the browser console. @default false */
129
+ debug?: boolean;
130
+ /** Override the Measurement Pixel SDK URL. */
131
+ scriptSrc?: string;
132
+ }
133
+ /**
134
+ * ChatGPT Ads Measurement Pixel manifest.
135
+ *
136
+ * Loads after marketing consent. Denies measurement before initialization,
137
+ * then applies the current consent state before the SDK executes.
138
+ *
139
+ * @see https://developers.openai.com/ads/measurement-pixel
140
+ */
141
+ export declare const openaiPixelManifest: {
142
+ readonly kind: "c15t.vendor-manifest";
143
+ readonly schemaVersion: 1;
144
+ readonly bootstrap: [{
145
+ readonly ifUndefined: true;
146
+ readonly name: 'oaiq';
147
+ readonly queue: {
148
+ readonly property: 'q';
149
+ };
150
+ readonly type: 'defineStubFunction';
151
+ }, {
152
+ readonly args: ["consent", false];
153
+ readonly global: 'oaiq';
154
+ readonly type: 'callGlobal';
155
+ }];
156
+ readonly category: 'marketing';
157
+ readonly install: [{
158
+ readonly args: ["init", "{{initOptions}}"];
159
+ readonly global: 'oaiq';
160
+ readonly type: 'callGlobal';
161
+ }, {
162
+ readonly async: true;
163
+ readonly src: '{{scriptSrc}}';
164
+ readonly type: 'loadScript';
165
+ }];
166
+ readonly onBeforeLoadGranted: [{
167
+ readonly args: ["consent", true];
168
+ readonly global: 'oaiq';
169
+ readonly type: 'callGlobal';
170
+ }];
171
+ readonly onConsentDenied: [{
172
+ readonly args: ["consent", false];
173
+ readonly global: 'oaiq';
174
+ readonly type: 'callGlobal';
175
+ }];
176
+ readonly onConsentGranted: [{
177
+ readonly args: ["consent", true];
178
+ readonly global: 'oaiq';
179
+ readonly type: 'callGlobal';
180
+ }];
181
+ readonly persistAfterConsentRevoked: true;
182
+ readonly vendor: 'openai-pixel';
183
+ };
184
+ /**
185
+ * Creates a consent-aware ChatGPT Ads Measurement Pixel script.
186
+ *
187
+ * @param options - Pixel ID, debug logging, and optional SDK URL.
188
+ * @returns A script gated on marketing consent, with SDK consent updates.
189
+ * @example
190
+ * ```ts
191
+ * openaiPixel({ pixelId: 'YOUR_PIXEL_ID', debug: true });
192
+ * ```
193
+ */
194
+ export declare const openaiPixel: ({ pixelId, debug, user, scriptSrc, }: OpenAIPixelOptions) => Script;
195
+ /**
196
+ * Sends a conversion to every initialized OpenAI pixel.
197
+ *
198
+ * Calls before the queue exists are dropped. Once loaded, the SDK applies
199
+ * c15t's consent signal. Use `window.oaiq('measureSingle', ...)` to target one pixel.
200
+ *
201
+ * @param args - Event name, matching data, and event options.
202
+ * @returns Nothing.
203
+ * @example
204
+ * ```ts
205
+ * openaiPixelEvent('order_created', {
206
+ * type: 'contents', amount: 2599, currency: 'USD',
207
+ * }, { event_id: 'order_123' });
208
+ * ```
209
+ */
210
+ export declare const openaiPixelEvent: (...args: OpenAIPixelEventArgs) => void;
211
+ export {};
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  /**
3
3
  * Reddit Pixel standard conversion event names.
4
4
  *
@@ -68,7 +68,7 @@ export interface RedditPixelInitOptions {
68
68
  /** Integration partner version. */
69
69
  partner_version?: string;
70
70
  /** Source integration name reported to Reddit. */
71
- integration?: 'reddit' | 'gtm' | (string & {});
71
+ integration?: 'reddit' | 'gtm' | (string & Record<never, never>);
72
72
  /** Enable Reddit Pixel debug logging. */
73
73
  debug?: boolean;
74
74
  /**
@@ -92,13 +92,13 @@ export interface RedditPixelEventMetadata {
92
92
  currency?: string;
93
93
  transactionId?: string;
94
94
  customEventName?: string;
95
- products?: string | Array<{
95
+ products?: string | {
96
96
  id?: string | number;
97
97
  name?: string;
98
98
  category?: string;
99
99
  quantity?: number | string;
100
100
  itemPrice?: number | string;
101
- }>;
101
+ }[];
102
102
  /**
103
103
  * Conversion ID used to deduplicate Pixel events against Conversions API
104
104
  * events.
@@ -108,13 +108,12 @@ export interface RedditPixelEventMetadata {
108
108
  conversionId?: string;
109
109
  [key: string]: unknown;
110
110
  }
111
- type RedditPixelFunction = {
111
+ interface RedditPixelFunction {
112
112
  (command: 'init', pixelId: string, options?: RedditPixelInitOptions): void;
113
- (command: 'enableFirstPartyCookies'): void;
114
- (command: 'disableFirstPartyCookies'): void;
115
- (command: 'track', eventName: RedditPixelEventName | (string & {}), properties?: RedditPixelEventMetadata): void;
113
+ (command: 'enableFirstPartyCookies' | 'disableFirstPartyCookies'): void;
114
+ (command: 'track', eventName: RedditPixelEventName | (string & Record<never, never>), properties?: RedditPixelEventMetadata): void;
116
115
  (command: string, ...args: unknown[]): void;
117
- };
116
+ }
118
117
  declare global {
119
118
  interface Window {
120
119
  rdt?: RedditPixelFunction & {
@@ -132,42 +131,42 @@ declare global {
132
131
  export declare const redditPixelManifest: {
133
132
  readonly kind: "c15t.vendor-manifest";
134
133
  readonly schemaVersion: 1;
135
- readonly vendor: 'reddit-pixel';
136
- readonly category: 'marketing';
137
- readonly persistAfterConsentRevoked: true;
138
134
  readonly bootstrap: [{
139
- readonly type: 'defineStubFunction';
135
+ readonly dispatchProperty: 'sendEvent';
136
+ readonly ifUndefined: true;
140
137
  readonly name: 'rdt';
141
138
  readonly queue: {
142
139
  readonly property: 'callQueue';
143
140
  };
144
- readonly dispatchProperty: 'sendEvent';
145
141
  readonly queueFormat: 'array';
146
- readonly ifUndefined: true;
142
+ readonly type: 'defineStubFunction';
147
143
  }];
144
+ readonly category: 'marketing';
148
145
  readonly install: [{
149
- readonly type: 'callGlobal';
150
- readonly global: 'rdt';
151
146
  readonly args: ["init", "{{pixelId}}"];
152
- }, {
153
- readonly type: 'callGlobal';
154
147
  readonly global: 'rdt';
148
+ readonly type: 'callGlobal';
149
+ }, {
155
150
  readonly args: ["track", "PageVisit"];
151
+ readonly global: 'rdt';
152
+ readonly type: 'callGlobal';
156
153
  }, {
157
- readonly type: 'loadScript';
158
- readonly src: '{{scriptUrl}}';
159
154
  readonly async: true;
160
- }];
161
- readonly onConsentGranted: [{
162
- readonly type: 'callGlobal';
163
- readonly global: 'rdt';
164
- readonly args: ["enableFirstPartyCookies"];
155
+ readonly src: '{{scriptUrl}}';
156
+ readonly type: 'loadScript';
165
157
  }];
166
158
  readonly onConsentDenied: [{
159
+ readonly args: ["disableFirstPartyCookies"];
160
+ readonly global: 'rdt';
167
161
  readonly type: 'callGlobal';
162
+ }];
163
+ readonly onConsentGranted: [{
164
+ readonly args: ["enableFirstPartyCookies"];
168
165
  readonly global: 'rdt';
169
- readonly args: ["disableFirstPartyCookies"];
166
+ readonly type: 'callGlobal';
170
167
  }];
168
+ readonly persistAfterConsentRevoked: true;
169
+ readonly vendor: 'reddit-pixel';
171
170
  };
172
171
  export interface RedditPixelOptions {
173
172
  /**
@@ -199,7 +198,7 @@ export interface RedditPixelOptions {
199
198
  * @param options - The options for the Reddit Pixel script.
200
199
  * @returns The Reddit Pixel script configuration.
201
200
  */
202
- export declare function redditPixel({ pixelId, trackPageVisit, initOptions, disableFirstPartyCookies, scriptUrl, }: RedditPixelOptions): Script;
201
+ export declare const redditPixel: ({ pixelId, trackPageVisit, initOptions, disableFirstPartyCookies, scriptUrl, }: RedditPixelOptions) => Script;
203
202
  /**
204
203
  * Tracks a Reddit Pixel event.
205
204
  *
@@ -207,5 +206,5 @@ export declare function redditPixel({ pixelId, trackPageVisit, initOptions, disa
207
206
  * @param metadata - Optional event metadata, including `conversionId` for
208
207
  * Pixel plus Conversions API deduplication.
209
208
  */
210
- export declare const redditPixelEvent: (eventName: RedditPixelEventName | (string & {}), metadata?: RedditPixelEventMetadata) => void;
209
+ export declare const redditPixelEvent: (eventName: RedditPixelEventName | (string & Record<never, never>), metadata?: RedditPixelEventMetadata) => void;
211
210
  export {};