@c15t/scripts 3.0.0-alpha.2 → 3.0.0-alpha.3

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 (300) hide show
  1. package/AGENTS.md +129 -63
  2. package/README.md +8 -29
  3. package/SKILL.md +33 -0
  4. package/dist/adobe-analytics.js +2 -0
  5. package/dist/ahrefs-analytics.js +2 -0
  6. package/dist/amplitude.js +2 -0
  7. package/dist/clearbit.js +2 -0
  8. package/dist/cloudflare-web-analytics.js +2 -0
  9. package/dist/cloudflare-zaraz.js +2 -0
  10. package/dist/crisp.js +2 -0
  11. package/dist/databuddy.js +2 -0
  12. package/dist/e2e-test-utils.js +2 -139
  13. package/dist/engine/compile.js +2 -89
  14. package/dist/engine/runtime.js +2 -448
  15. package/dist/events.js +2 -218
  16. package/dist/fathom-analytics.js +2 -0
  17. package/dist/front-chat.js +2 -0
  18. package/dist/google-tag-manager.js +2 -0
  19. package/dist/google-tag.js +2 -0
  20. package/dist/heap.js +2 -0
  21. package/dist/hightouch.js +2 -0
  22. package/dist/hotjar.js +2 -0
  23. package/dist/intercom.js +2 -0
  24. package/dist/klaviyo.js +2 -0
  25. package/dist/linkedin-insights.js +2 -0
  26. package/dist/logrocket.js +2 -0
  27. package/dist/matomo-analytics.js +2 -0
  28. package/dist/meta-pixel.js +2 -0
  29. package/dist/microsoft-clarity.js +2 -0
  30. package/dist/microsoft-uet.js +2 -0
  31. package/dist/mixpanel-analytics.js +2 -0
  32. package/dist/one-dollar-stats.js +2 -0
  33. package/dist/openai-pixel.js +2 -0
  34. package/dist/pinterest-tag.js +2 -0
  35. package/dist/pirsch.js +2 -0
  36. package/dist/plausible-analytics.js +2 -0
  37. package/dist/posthog.js +2 -0
  38. package/dist/promptwatch.js +2 -0
  39. package/dist/reddit-pixel.js +2 -0
  40. package/dist/registry.js +2 -422
  41. package/dist/resolve.js +2 -33
  42. package/dist/rudderstack.js +2 -0
  43. package/dist/rybbit-analytics.js +2 -0
  44. package/dist/segment.js +2 -0
  45. package/dist/snapchat-pixel.js +2 -0
  46. package/dist/tiktok-pixel.js +2 -0
  47. package/dist/types.js +2 -16
  48. package/dist/umami-analytics.js +2 -0
  49. package/dist/vendors/_shared/attributes.js +2 -14
  50. package/dist/vendors/_shared/google-consent.js +2 -27
  51. package/dist/vendors/_shared/install-builders.js +2 -21
  52. package/dist/vendors/_shared/required-id.js +2 -0
  53. package/dist/vendors/_shared/script-url.js +2 -28
  54. package/dist/vendors/ads-and-pixels/linkedin-insights.js +2 -48
  55. package/dist/vendors/ads-and-pixels/meta-pixel.js +2 -153
  56. package/dist/vendors/ads-and-pixels/microsoft-uet.js +2 -110
  57. package/dist/vendors/ads-and-pixels/openai-pixel.js +2 -88
  58. package/dist/vendors/ads-and-pixels/pinterest-tag.js +2 -123
  59. package/dist/vendors/ads-and-pixels/reddit-pixel.js +2 -107
  60. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +2 -87
  61. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +2 -89
  62. package/dist/vendors/ads-and-pixels/x-pixel.js +2 -48
  63. package/dist/vendors/analytics/adobe-analytics.js +2 -49
  64. package/dist/vendors/analytics/ahrefs-analytics.js +2 -27
  65. package/dist/vendors/analytics/amplitude.js +2 -134
  66. package/dist/vendors/analytics/clearbit.js +2 -28
  67. package/dist/vendors/analytics/cloudflare-web-analytics.js +2 -32
  68. package/dist/vendors/analytics/databuddy.js +2 -103
  69. package/dist/vendors/analytics/fathom-analytics.js +2 -35
  70. package/dist/vendors/analytics/google-tag.js +2 -78
  71. package/dist/vendors/analytics/heap.js +2 -134
  72. package/dist/vendors/analytics/hightouch.js +2 -109
  73. package/dist/vendors/analytics/hotjar.js +2 -44
  74. package/dist/vendors/analytics/logrocket.js +2 -58
  75. package/dist/vendors/analytics/matomo-analytics.js +2 -191
  76. package/dist/vendors/analytics/microsoft-clarity.js +2 -100
  77. package/dist/vendors/analytics/mixpanel-analytics.js +2 -93
  78. package/dist/vendors/analytics/one-dollar-stats.js +2 -30
  79. package/dist/vendors/analytics/pirsch.js +2 -67
  80. package/dist/vendors/analytics/plausible-analytics.js +2 -81
  81. package/dist/vendors/analytics/posthog.js +2 -200
  82. package/dist/vendors/analytics/promptwatch.js +2 -29
  83. package/dist/vendors/analytics/rudderstack.js +2 -183
  84. package/dist/vendors/analytics/rybbit-analytics.js +2 -63
  85. package/dist/vendors/analytics/segment.js +2 -65
  86. package/dist/vendors/analytics/umami-analytics.js +2 -39
  87. package/dist/vendors/analytics/vercel-analytics.js +2 -53
  88. package/dist/vendors/email-and-sms/klaviyo.js +2 -0
  89. package/dist/vendors/functional/crisp.js +2 -100
  90. package/dist/vendors/functional/front-chat.js +2 -64
  91. package/dist/vendors/functional/intercom.js +2 -45
  92. package/dist/vendors/tag-managers/cloudflare-zaraz.js +2 -98
  93. package/dist/vendors/tag-managers/google-tag-manager.js +2 -73
  94. package/dist/vercel-analytics.js +2 -0
  95. package/dist/x-pixel.js +2 -0
  96. package/dist-types/adobe-analytics.d.ts +2 -0
  97. package/dist-types/ahrefs-analytics.d.ts +2 -0
  98. package/dist-types/amplitude.d.ts +2 -0
  99. package/dist-types/clearbit.d.ts +2 -0
  100. package/dist-types/cloudflare-web-analytics.d.ts +2 -0
  101. package/dist-types/cloudflare-zaraz.d.ts +2 -0
  102. package/dist-types/crisp.d.ts +2 -0
  103. package/dist-types/databuddy.d.ts +2 -0
  104. package/dist-types/e2e-test-utils.d.ts +2 -0
  105. package/dist-types/engine/compile.d.ts +2 -3
  106. package/dist-types/engine/runtime.d.ts +2 -3
  107. package/dist-types/events.d.ts +2 -46
  108. package/dist-types/fathom-analytics.d.ts +2 -0
  109. package/dist-types/front-chat.d.ts +2 -0
  110. package/dist-types/google-tag-manager.d.ts +2 -0
  111. package/dist-types/google-tag.d.ts +2 -0
  112. package/dist-types/heap.d.ts +2 -0
  113. package/dist-types/hightouch.d.ts +2 -0
  114. package/dist-types/hotjar.d.ts +2 -0
  115. package/dist-types/intercom.d.ts +2 -0
  116. package/dist-types/klaviyo.d.ts +2 -0
  117. package/dist-types/linkedin-insights.d.ts +2 -0
  118. package/dist-types/logrocket.d.ts +2 -0
  119. package/dist-types/matomo-analytics.d.ts +2 -0
  120. package/dist-types/meta-pixel.d.ts +2 -0
  121. package/dist-types/microsoft-clarity.d.ts +2 -0
  122. package/dist-types/microsoft-uet.d.ts +2 -0
  123. package/dist-types/mixpanel-analytics.d.ts +2 -0
  124. package/dist-types/one-dollar-stats.d.ts +2 -0
  125. package/dist-types/openai-pixel.d.ts +2 -0
  126. package/dist-types/pinterest-tag.d.ts +2 -0
  127. package/dist-types/pirsch.d.ts +2 -0
  128. package/dist-types/plausible-analytics.d.ts +2 -0
  129. package/dist-types/posthog.d.ts +2 -0
  130. package/dist-types/promptwatch.d.ts +2 -0
  131. package/dist-types/reddit-pixel.d.ts +2 -0
  132. package/dist-types/registry.d.ts +2 -485
  133. package/dist-types/resolve.d.ts +2 -9
  134. package/dist-types/rudderstack.d.ts +2 -0
  135. package/dist-types/rybbit-analytics.d.ts +2 -0
  136. package/dist-types/segment.d.ts +2 -0
  137. package/dist-types/snapchat-pixel.d.ts +2 -0
  138. package/dist-types/tiktok-pixel.d.ts +2 -0
  139. package/dist-types/types.d.ts +2 -314
  140. package/dist-types/umami-analytics.d.ts +2 -0
  141. package/dist-types/vendors/_shared/attributes.d.ts +2 -35
  142. package/dist-types/vendors/_shared/google-consent.d.ts +2 -47
  143. package/dist-types/vendors/_shared/install-builders.d.ts +2 -30
  144. package/dist-types/vendors/_shared/required-id.d.ts +2 -0
  145. package/dist-types/vendors/_shared/script-url.d.ts +2 -75
  146. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +2 -92
  147. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +2 -289
  148. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +2 -105
  149. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +2 -211
  150. package/dist-types/vendors/ads-and-pixels/pinterest-tag.d.ts +2 -295
  151. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +2 -210
  152. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +2 -171
  153. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +2 -106
  154. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +2 -183
  155. package/dist-types/vendors/analytics/adobe-analytics.d.ts +2 -75
  156. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +2 -62
  157. package/dist-types/vendors/analytics/amplitude.d.ts +2 -234
  158. package/dist-types/vendors/analytics/clearbit.d.ts +2 -60
  159. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +2 -67
  160. package/dist-types/vendors/analytics/databuddy.d.ts +2 -147
  161. package/dist-types/vendors/analytics/fathom-analytics.d.ts +2 -90
  162. package/dist-types/vendors/analytics/google-tag.d.ts +2 -95
  163. package/dist-types/vendors/analytics/heap.d.ts +2 -316
  164. package/dist-types/vendors/analytics/hightouch.d.ts +2 -285
  165. package/dist-types/vendors/analytics/hotjar.d.ts +2 -73
  166. package/dist-types/vendors/analytics/logrocket.d.ts +2 -101
  167. package/dist-types/vendors/analytics/matomo-analytics.d.ts +2 -41
  168. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +2 -97
  169. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +2 -113
  170. package/dist-types/vendors/analytics/one-dollar-stats.d.ts +2 -39
  171. package/dist-types/vendors/analytics/pirsch.d.ts +2 -96
  172. package/dist-types/vendors/analytics/plausible-analytics.d.ts +2 -122
  173. package/dist-types/vendors/analytics/posthog.d.ts +2 -175
  174. package/dist-types/vendors/analytics/promptwatch.d.ts +2 -36
  175. package/dist-types/vendors/analytics/rudderstack.d.ts +2 -330
  176. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +2 -82
  177. package/dist-types/vendors/analytics/segment.d.ts +2 -164
  178. package/dist-types/vendors/analytics/umami-analytics.d.ts +2 -93
  179. package/dist-types/vendors/analytics/vercel-analytics.d.ts +2 -66
  180. package/dist-types/vendors/email-and-sms/klaviyo.d.ts +2 -0
  181. package/dist-types/vendors/functional/crisp.d.ts +2 -78
  182. package/dist-types/vendors/functional/front-chat.d.ts +2 -62
  183. package/dist-types/vendors/functional/intercom.d.ts +2 -135
  184. package/dist-types/vendors/tag-managers/cloudflare-zaraz.d.ts +2 -39
  185. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +2 -96
  186. package/dist-types/vercel-analytics.d.ts +2 -0
  187. package/dist-types/x-pixel.d.ts +2 -0
  188. package/docs/README.md +129 -63
  189. package/docs/assets/v3/bottom-bar.png +0 -0
  190. package/docs/assets/v3/brand-card.png +0 -0
  191. package/docs/assets/v3/brand-preferences.png +0 -0
  192. package/docs/assets/v3/choice-wall.png +0 -0
  193. package/docs/assets/v3/headless-bar-html.png +0 -0
  194. package/docs/assets/v3/headless-bar-mobile.png +0 -0
  195. package/docs/assets/v3/headless-bar.png +0 -0
  196. package/docs/assets/v3/slim-bar.png +0 -0
  197. package/docs/concepts/choose-your-setup.md +87 -0
  198. package/docs/concepts/consent-categories.md +84 -0
  199. package/docs/{guides → concepts}/consent-state.md +71 -101
  200. package/docs/{guides → concepts}/data-fetching.md +31 -27
  201. package/docs/concepts/how-consent-works.md +123 -0
  202. package/docs/concepts/policies.md +71 -0
  203. package/docs/customization/class-names.md +202 -0
  204. package/docs/customization/dark-mode.md +157 -0
  205. package/docs/customization/motion.md +119 -0
  206. package/docs/customization/overview.md +67 -34
  207. package/docs/customization/recipes.md +839 -49
  208. package/docs/customization/slots.md +216 -35
  209. package/docs/customization/stylesheets.md +147 -0
  210. package/docs/customization/tailwind.md +842 -0
  211. package/docs/customization/tokens.md +163 -96
  212. package/docs/customization/translations.md +61 -3
  213. package/docs/frameworks/astro/embeds.md +160 -0
  214. package/docs/frameworks/astro/network-blocker.md +86 -0
  215. package/docs/frameworks/astro/scripts.md +146 -0
  216. package/docs/frameworks/html/embeds.md +142 -0
  217. package/docs/frameworks/html/network-blocker.md +105 -0
  218. package/docs/frameworks/html/scripts.md +164 -0
  219. package/docs/frameworks/javascript/scripts.md +119 -0
  220. package/docs/frameworks/next/embeds.md +90 -0
  221. package/docs/frameworks/next/network-blocker.md +153 -0
  222. package/docs/frameworks/next/scripts.md +196 -0
  223. package/docs/frameworks/nuxt/embeds.md +81 -0
  224. package/docs/frameworks/nuxt/network-blocker.md +97 -0
  225. package/docs/frameworks/nuxt/scripts.md +89 -0
  226. package/docs/frameworks/react/embeds.md +89 -0
  227. package/docs/frameworks/react/network-blocker.md +140 -0
  228. package/docs/frameworks/react/scripts.md +115 -0
  229. package/docs/frameworks/svelte/embeds.md +96 -0
  230. package/docs/frameworks/svelte/network-blocker.md +141 -0
  231. package/docs/frameworks/svelte/scripts.md +137 -0
  232. package/docs/frameworks/sveltekit/embeds.md +103 -0
  233. package/docs/frameworks/sveltekit/network-blocker.md +149 -0
  234. package/docs/frameworks/sveltekit/scripts.md +141 -0
  235. package/docs/frameworks/tanstack-start/embeds.md +96 -0
  236. package/docs/frameworks/tanstack-start/network-blocker.md +145 -0
  237. package/docs/frameworks/tanstack-start/scripts.md +103 -0
  238. package/docs/frameworks/vue/embeds.md +84 -0
  239. package/docs/frameworks/vue/network-blocker.md +99 -0
  240. package/docs/frameworks/vue/scripts.md +93 -0
  241. package/docs/guides/banner-experiments.md +654 -0
  242. package/docs/guides/troubleshooting.md +120 -47
  243. package/docs/guides/verify-consent.md +81 -49
  244. package/docs/integrations/adobe-analytics.md +167 -159
  245. package/docs/integrations/ahrefs-analytics.md +152 -154
  246. package/docs/integrations/amplitude.md +162 -156
  247. package/docs/integrations/building-integrations.md +136 -37
  248. package/docs/integrations/clearbit.md +154 -154
  249. package/docs/integrations/cloudflare-web-analytics.md +156 -156
  250. package/docs/integrations/cloudflare-zaraz.md +209 -261
  251. package/docs/integrations/crisp.md +164 -158
  252. package/docs/integrations/databuddy.md +157 -173
  253. package/docs/integrations/fathom-analytics.md +158 -156
  254. package/docs/integrations/front-chat.md +167 -167
  255. package/docs/integrations/google-maps.md +118 -83
  256. package/docs/integrations/google-tag-manager.md +178 -163
  257. package/docs/integrations/google-tag.md +163 -160
  258. package/docs/integrations/heap.md +163 -155
  259. package/docs/integrations/hightouch.md +161 -157
  260. package/docs/integrations/hotjar.md +159 -155
  261. package/docs/integrations/intercom.md +183 -153
  262. package/docs/integrations/klaviyo.md +486 -0
  263. package/docs/integrations/linkedin-insights.md +174 -150
  264. package/docs/integrations/logrocket.md +160 -156
  265. package/docs/integrations/matomo-analytics.md +188 -178
  266. package/docs/integrations/meta-pixel.md +188 -150
  267. package/docs/integrations/microsoft-clarity.md +163 -155
  268. package/docs/integrations/microsoft-uet.md +148 -154
  269. package/docs/integrations/mixpanel-analytics.md +155 -160
  270. package/docs/integrations/one-dollar-stats.md +166 -165
  271. package/docs/integrations/openai-pixel.md +204 -301
  272. package/docs/integrations/overview.md +137 -80
  273. package/docs/integrations/pinterest-tag.md +191 -183
  274. package/docs/integrations/pirsch.md +169 -159
  275. package/docs/integrations/plausible-analytics.md +172 -158
  276. package/docs/integrations/posthog.md +226 -241
  277. package/docs/integrations/promptwatch.md +154 -154
  278. package/docs/integrations/reddit-pixel.md +185 -157
  279. package/docs/integrations/rudderstack.md +201 -186
  280. package/docs/integrations/rybbit-analytics.md +171 -160
  281. package/docs/integrations/segment.md +182 -154
  282. package/docs/integrations/snapchat-pixel.md +186 -156
  283. package/docs/integrations/tiktok-pixel.md +171 -150
  284. package/docs/integrations/umami-analytics.md +163 -158
  285. package/docs/integrations/vercel-analytics.md +166 -157
  286. package/docs/integrations/x-pixel.md +176 -150
  287. package/docs/integrations/youtube.md +121 -86
  288. package/docs/upgrade-v3.md +475 -467
  289. package/package.json +10 -257
  290. package/dist-types/__tests__/helpers.d.ts +0 -141
  291. package/docs/assets/v3/brand-bar.png +0 -0
  292. package/docs/assets/v3/mobile-card.png +0 -0
  293. package/docs/assets/v3/preferences.png +0 -0
  294. package/docs/frameworks/javascript/script-loader.md +0 -100
  295. package/docs/frameworks/next/script-loader.md +0 -216
  296. package/docs/frameworks/react/script-loader.md +0 -69
  297. package/docs/guides/deployment-modes.md +0 -75
  298. package/docs/guides/shared-consent-controls.md +0 -158
  299. package/docs/integrations/clear-on-revocation.md +0 -167
  300. package/docs/integrations/granular-consent.md +0 -210
@@ -1,106 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- interface TikTokPixelFunction {
3
- grantConsent: () => void;
4
- revokeConsent: () => void;
5
- page: () => void;
6
- track: (eventName: string, properties?: Record<string, unknown>) => void;
7
- identify: (properties?: Record<string, unknown>) => void;
8
- instances: (...args: unknown[]) => void;
9
- debug: (...args: unknown[]) => void;
10
- on: (...args: unknown[]) => void;
11
- off: (...args: unknown[]) => void;
12
- once: (...args: unknown[]) => void;
13
- ready: (...args: unknown[]) => void;
14
- alias: (...args: unknown[]) => void;
15
- group: (...args: unknown[]) => void;
16
- enableCookie: (...args: unknown[]) => void;
17
- disableCookie: (...args: unknown[]) => void;
18
- holdConsent: (...args: unknown[]) => void;
19
- }
20
- declare global {
21
- interface Window {
22
- ttq: TikTokPixelFunction;
23
- }
24
- }
25
- /**
26
- * TikTok Pixel vendor manifest.
27
- *
28
- * Uses structured bootstrap steps and provides a consent API
29
- * via `ttq.grantConsent()` / `ttq.revokeConsent()`.
30
- */
31
- export declare const tiktokPixelManifest: {
32
- readonly kind: "c15t.vendor-manifest";
33
- readonly schemaVersion: 1;
34
- readonly afterLoad: [{
35
- readonly global: 'ttq';
36
- readonly method: 'grantConsent';
37
- readonly type: 'callGlobal';
38
- }];
39
- readonly bootstrap: [{
40
- readonly name: 'TiktokAnalyticsObject';
41
- readonly type: 'setGlobal';
42
- readonly value: 'ttq';
43
- }, {
44
- readonly ifUndefined: true;
45
- readonly name: 'ttq';
46
- readonly type: 'setGlobal';
47
- readonly value: readonly [];
48
- }, {
49
- readonly methods: ["page", "track", "identify", "instances", "debug", "on", "off", "once", "ready", "alias", "group", "enableCookie", "disableCookie", "holdConsent", "revokeConsent", "grantConsent"];
50
- readonly target: 'ttq';
51
- readonly type: 'defineQueueMethods';
52
- }];
53
- readonly category: 'marketing';
54
- readonly install: [{
55
- readonly global: 'ttq';
56
- readonly method: 'grantConsent';
57
- readonly type: 'callGlobal';
58
- }, {
59
- readonly global: 'ttq';
60
- readonly method: 'page';
61
- readonly type: 'callGlobal';
62
- }, {
63
- readonly async: true;
64
- readonly src: '{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq';
65
- readonly type: 'loadScript';
66
- }];
67
- readonly onConsentDenied: [{
68
- readonly global: 'ttq';
69
- readonly method: 'revokeConsent';
70
- readonly type: 'callGlobal';
71
- }];
72
- readonly onConsentGranted: [{
73
- readonly global: 'ttq';
74
- readonly method: 'grantConsent';
75
- readonly type: 'callGlobal';
76
- }];
77
- readonly persistAfterConsentRevoked: true;
78
- readonly vendor: 'tiktok-pixel';
79
- };
80
- export interface TikTokPixelOptions {
81
- /**
82
- * Your TikTok Pixel ID
83
- * @example `123456789012345`
84
- */
85
- pixelId: string;
86
- /** TikTok Pixel loader base URL. */
87
- scriptSrc?: string;
88
- }
89
- /**
90
- * Creates a Tiktok Pixel script.
91
- * This script is persistent after consent is revoked because it has built-in functionality to opt into and out of tracking based on consent, which allows us to not need to load the script again when consent is revoked.
92
- *
93
- * @param options - The options for the TikTok Pixel script
94
- * @returns The TikTok Pixel script configuration
95
- *
96
- * @example
97
- * ```ts
98
- * const tiktokPixelScript = tiktokPixel({
99
- * pixelId: '123456789012345',
100
- * });
101
- * ```
102
- *
103
- * @see {@link https://ads.tiktok.com/help/article/tiktok-pixel} TikTok Pixel documentation
104
- */
105
- export declare const tiktokPixel: ({ pixelId, scriptSrc, }: TikTokPixelOptions) => Script;
106
- export {};
1
+ /** @deprecated Use @c15t/integrations/vendors/ads-and-pixels/tiktok-pixel. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/ads-and-pixels/tiktok-pixel';
@@ -1,183 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- export interface XPixelContent {
3
- /**
4
- * Type of the content
5
- * @example "Animals & Pet Supplies > Pet Supplies > Cat Supplies > Cat Beds"
6
- * @see https://www.google.com/basepages/producttype/taxonomy.en-US.txt
7
- */
8
- content_type?: string;
9
- /**
10
- * ID of the content
11
- * For product catalog users: please pass SKU
12
- * For all other users: Please pass Global Trade Item Number (GTIN) if available, otherwise pass SKU
13
- * @example "1234567890"
14
- */
15
- content_id: string;
16
- /**
17
- * Name of a product or service
18
- * @example "Cat Bed"
19
- */
20
- content_name?: string;
21
- /**
22
- * Price of a product or service
23
- * @example 10.00
24
- */
25
- content_price?: number;
26
- /**
27
- * Quantity of the content
28
- * @example 1
29
- */
30
- num_items?: number;
31
- /**
32
- * ID associated with a group of product variants
33
- * @example "1234567890"
34
- */
35
- content_group_id?: string;
36
- }
37
- export interface XPixelEvent {
38
- /**
39
- * Total value of the conversion event (ex: $ value of the transaction in case of a purchase, etc.)
40
- * @example 10.00
41
- */
42
- value?: number;
43
- /**
44
- * Currency of the conversion event
45
- * ISO 4217 code (ex: USD, EUR, JPY, etc.)
46
- * @example USD
47
- */
48
- currency?: string;
49
- /**
50
- * Unique identifier for the event that can be used for deduplication purposes
51
- * @example tw-xxxx-xxxx
52
- */
53
- conversion_id?: string;
54
- /**
55
- * Search string of the conversion event
56
- * @example "search query"
57
- */
58
- search_string?: string;
59
- /**
60
- * Description of the conversion event
61
- * @example "purchase"
62
- */
63
- description?: string;
64
- /**
65
- * twclid of the conversion event
66
- * The X Pixel already automatically passes twclid from URL or first-party cookie. This parameter can be optionally used to force attribution to a certain ad click.
67
- * @example "twclid"
68
- */
69
- twclid?: string;
70
- /**
71
- * Status of the conversion event
72
- * Should be set to values like "started" or "completed".
73
- * @example "completed"
74
- */
75
- status?: 'started' | 'completed';
76
- /**
77
- * Email address used for user matching.
78
- * The X Pixel hashes this value before transmission.
79
- * @example "[email protected]"
80
- */
81
- email_address?: string;
82
- /**
83
- * Phone number used for user matching.
84
- * Include country code in E.164 format (for example, +11234567890).
85
- * The X Pixel hashes this value before transmission.
86
- * @example "+11234567890"
87
- */
88
- phone_number?: string;
89
- /**
90
- * Content/products associated with the conversion event
91
- * @example [{content_id: 'OT001', content_name: 'bird seed', content_price: 50, num_items: 1}]
92
- * @see {@link XPixelContent}
93
- */
94
- contents?: XPixelContent[];
95
- }
96
- declare global {
97
- interface Window {
98
- twq?: (event: string, ...args: unknown[]) => void;
99
- }
100
- }
101
- /**
102
- * X (Twitter) Pixel vendor manifest.
103
- *
104
- * Uses structured startup steps to load the X tracking pixel.
105
- * No consent API — the script simply loads or doesn't based on consent.
106
- */
107
- export declare const xPixelManifest: {
108
- readonly kind: "c15t.vendor-manifest";
109
- readonly schemaVersion: 1;
110
- readonly bootstrap: [{
111
- readonly dispatchProperty: 'exe';
112
- readonly ifUndefined: true;
113
- readonly name: 'twq';
114
- readonly properties: {
115
- readonly version: '1.1';
116
- };
117
- readonly queue: {
118
- readonly property: 'queue';
119
- };
120
- readonly type: 'defineStubFunction';
121
- }];
122
- readonly category: 'marketing';
123
- readonly install: [{
124
- readonly args: ["config", "{{pixelId}}"];
125
- readonly global: 'twq';
126
- readonly type: 'callGlobal';
127
- }, {
128
- readonly async: true;
129
- readonly src: '{{scriptSrc}}';
130
- readonly type: 'loadScript';
131
- }];
132
- readonly vendor: 'x-pixel';
133
- };
134
- export interface XPixelOptions {
135
- /**
136
- * Your X Pixel ID
137
- * @example `123456789012345`
138
- */
139
- pixelId: string;
140
- /** X Pixel loader URL. */
141
- scriptSrc?: string;
142
- }
143
- /**
144
- * Creates an X Pixel script.
145
- * This script loads only when consent is granted.
146
- * X Pixel does not expose a consent update API, so c15t treats it as a standard consent-gated loader.
147
- *
148
- * @param options - The options for the X Pixel script
149
- * @returns The X Pixel script configuration
150
- *
151
- * @example
152
- * ```ts
153
- * const xPixelScript = xPixel({
154
- * pixelId: '123456789012345',
155
- * });
156
- * ```
157
- *
158
- * @see {@link https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites} X conversion tracking documentation
159
- */
160
- export declare const xPixel: ({ pixelId, scriptSrc, }: XPixelOptions) => Script;
161
- /**
162
- * @param eventId - The event ID to track
163
- * @example 'tw-xxxx-xxxx'
164
- * @param metadata - Optional metadata to track
165
- *
166
- * @example
167
- * ```ts
168
- * xPixelEvent('tw-xxxx-xxxx', {
169
- * value: 200.00,
170
- * currency: 'USD',
171
- * contents: [
172
- * {content_id: 'OT001', content_name: 'bird seed', content_price: 50, num_items: 1},
173
- * {content_id: 'OT002', content_name: 'bird cage', content_price: 150, num_items: 1}
174
- * ]
175
- * });
176
- * ```
177
- *
178
- * @see {@link https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites#event-types-and-parameters}
179
- * @throws {Error} Throws when `window` is unavailable or `window.twq` is not a
180
- * function. Ensure marketing consent is granted and the X Pixel has loaded
181
- * before calling this helper.
182
- */
183
- export declare const xPixelEvent: (eventId: string, metadata?: XPixelEvent) => void;
1
+ /** @deprecated Use @c15t/integrations/vendors/ads-and-pixels/x-pixel. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/ads-and-pixels/x-pixel';
@@ -1,75 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- import type { VendorManifest } from '../../types.js';
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 const adobeAnalytics: (options: AdobeAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/adobe-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/adobe-analytics';
@@ -1,62 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- AhrefsAnalytics?: {
5
- sendEvent: (name: string, options?: {
6
- props?: Record<string, string>;
7
- meta?: Record<string, unknown>;
8
- }) => void;
9
- };
10
- }
11
- }
12
- /**
13
- * Ahrefs Analytics vendor manifest.
14
- *
15
- * Loads Ahrefs Web Analytics and passes the project key via `data-key`. Ahrefs
16
- * Web Analytics is cookieless, so the script is consent-gated on `measurement`
17
- * and unloaded when consent is revoked.
18
- */
19
- export declare const ahrefsAnalyticsManifest: {
20
- readonly kind: "c15t.vendor-manifest";
21
- readonly schemaVersion: 1;
22
- readonly category: 'measurement';
23
- readonly install: [{
24
- readonly async: true;
25
- readonly attributes: {
26
- readonly 'data-key': '{{key}}';
27
- };
28
- readonly src: '{{scriptUrl}}';
29
- readonly type: 'loadScript';
30
- }];
31
- readonly vendor: 'ahrefs-analytics';
32
- };
33
- export interface AhrefsAnalyticsOptions {
34
- /**
35
- * Your Ahrefs Web Analytics project key.
36
- */
37
- key: string;
38
- /**
39
- * Custom loader URL.
40
- * @default 'https://analytics.ahrefs.com/analytics.js'
41
- */
42
- scriptUrl?: string;
43
- }
44
- /**
45
- * Creates an Ahrefs Analytics script.
46
- *
47
- * The Ahrefs SDK exposes its runtime API on `window.AhrefsAnalytics` after
48
- * load. This helper only models the serializable script manifest.
49
- *
50
- * @see https://ahrefs.com/web-analytics
51
- *
52
- * @param options - The options for the Ahrefs Analytics script.
53
- * @returns The Ahrefs Analytics script.
54
- *
55
- * @example
56
- * ```ts
57
- * import { ahrefsAnalytics } from '@c15t/scripts/ahrefs-analytics';
58
- *
59
- * ahrefsAnalytics({ key: 'YOUR_PROJECT_KEY' });
60
- * ```
61
- */
62
- export declare const ahrefsAnalytics: (options: AhrefsAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/ahrefs-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/ahrefs-analytics';
@@ -1,234 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Browser SDK 2 version used by the default Amplitude CDN loader URL.
4
- *
5
- * The Amplitude Browser SDK 2 public bundle path is versioned. A
6
- * `analytics-browser-latest-min.js.gz` path is not publicly available, so c15t
7
- * pins a known Browser SDK 2 version by default and lets callers override the
8
- * loader through `scriptUrl`.
9
- */
10
- export declare const DEFAULT_AMPLITUDE_BROWSER_SDK_VERSION = "2.44.4";
11
- /**
12
- * Default Amplitude Browser SDK 2 loader URL.
13
- */
14
- export declare const DEFAULT_AMPLITUDE_SCRIPT_URL = "https://cdn.amplitude.com/libs/analytics-browser-2.44.4-min.js.gz";
15
- /**
16
- * Core Amplitude Browser SDK 2 methods queued before the real SDK loads.
17
- *
18
- * These methods use Amplitude's Browser SDK 2 snippet queue contract:
19
- * `window.amplitude._q` receives `{ name, args, resolve }` records, and the
20
- * loaded SDK drains that queue when `window.amplitude.invoked` is true.
21
- */
22
- export declare const AMPLITUDE_PROMISE_QUEUE_METHODS: readonly ['init', 'track', 'identify', 'flush'];
23
- /**
24
- * Queue methods Amplitude's snippet treats as synchronous — they queue the
25
- * call but return nothing.
26
- */
27
- export declare const AMPLITUDE_SYNC_QUEUE_METHODS: readonly ['setUserId', 'setOptOut'];
28
- export declare const AMPLITUDE_QUEUE_METHODS: readonly ["init", "track", "identify", "flush", "setUserId", "setOptOut"];
29
- /**
30
- * Amplitude Identify helper methods queued before the real SDK loads.
31
- */
32
- export declare const AMPLITUDE_IDENTIFY_METHODS: readonly ['set', 'setOnce', 'add', 'append', 'prepend', 'preInsert', 'postInsert', 'remove', 'unset', 'clearAll', 'getUserProperties'];
33
- /**
34
- * Queue entry consumed by Amplitude Browser SDK 2 at load time.
35
- */
36
- export interface AmplitudeQueueEntry {
37
- /** Name of the Amplitude method to invoke after the SDK loads. */
38
- name: (typeof AMPLITUDE_QUEUE_METHODS)[number];
39
- /** Arguments originally passed to the queued method. */
40
- args: unknown[];
41
- /** Promise resolver called by the SDK after the queued method runs. */
42
- resolve: (value: unknown) => void;
43
- }
44
- /**
45
- * Queue entry stored by an Amplitude Identify helper created before load.
46
- */
47
- export interface AmplitudeIdentifyQueueEntry {
48
- /** Identify helper method to replay after the SDK loads. */
49
- name: (typeof AMPLITUDE_IDENTIFY_METHODS)[number];
50
- /** Arguments originally passed to the helper method. */
51
- args: unknown[];
52
- }
53
- /**
54
- * Pre-load Amplitude Identify helper.
55
- */
56
- export interface AmplitudeIdentify {
57
- /** Queued Identify helper operations. */
58
- _q?: AmplitudeIdentifyQueueEntry[];
59
- /** Queue a `$set` identify operation. */
60
- set: (property: string, value: unknown) => this;
61
- /** Queue a `$setOnce` identify operation. */
62
- setOnce: (property: string, value: unknown) => this;
63
- /** Queue an `$add` identify operation. */
64
- add: (property: string, value: number) => this;
65
- /** Queue an `$append` identify operation. */
66
- append: (property: string, value: unknown) => this;
67
- /** Queue a `$prepend` identify operation. */
68
- prepend: (property: string, value: unknown) => this;
69
- /** Queue a `$preInsert` identify operation. */
70
- preInsert: (property: string, value: unknown) => this;
71
- /** Queue a `$postInsert` identify operation. */
72
- postInsert: (property: string, value: unknown) => this;
73
- /** Queue a `$remove` identify operation. */
74
- remove: (property: string, value: unknown) => this;
75
- /** Queue an `$unset` identify operation. */
76
- unset: (property: string) => this;
77
- /** Queue a `$clearAll` identify operation. */
78
- clearAll: () => this;
79
- /** Queue a read of the accumulated user property operations. */
80
- getUserProperties: () => this;
81
- }
82
- /**
83
- * Minimal public Amplitude Browser SDK 2 API exposed on `window.amplitude`.
84
- *
85
- * The real SDK replaces the pre-load stub with these methods after the loader
86
- * executes. Calls made before load return promises that resolve once the SDK
87
- * replays them.
88
- */
89
- export interface AmplitudeApi {
90
- /** Amplitude Browser SDK 2 pre-load queue. */
91
- _q?: AmplitudeQueueEntry[];
92
- /** Named-instance queue registry used by the official snippet contract. */
93
- _iq?: Record<string, unknown>;
94
- /** Marker that tells the SDK to replay snippet-queued calls. */
95
- invoked?: boolean;
96
- /** Pre-load Identify helper constructor. */
97
- Identify?: new () => AmplitudeIdentify;
98
- /** Initialize the default Amplitude instance. */
99
- init: (apiKey: string, options?: Record<string, unknown>) => Promise<unknown> | unknown;
100
- /** Track an event with optional event properties. */
101
- track: (eventInput: string | Record<string, unknown>, eventProperties?: Record<string, unknown>) => Promise<unknown> | unknown;
102
- /** Send an identify call. */
103
- identify: (identifyPayload: AmplitudeIdentify, eventOptions?: Record<string, unknown>) => Promise<unknown> | unknown;
104
- /** Set the current user identifier. */
105
- setUserId: (userId: string | undefined) => Promise<unknown> | unknown;
106
- /** Toggle runtime opt-out. */
107
- setOptOut: (optOut: boolean) => Promise<unknown> | unknown;
108
- /** Flush pending events. */
109
- flush: () => Promise<unknown> | unknown;
110
- }
111
- declare global {
112
- interface Window {
113
- amplitude?: AmplitudeApi;
114
- }
115
- }
116
- /**
117
- * Amplitude vendor manifest.
118
- *
119
- * Implements the essential Browser SDK 2 script-loader contract with
120
- * `window.amplitude.invoked`, an `_q` method-call queue, and an `_iq` registry
121
- * for named instances. It also defines the `Identify` queued helper used by
122
- * pre-load `identify()` calls. c15t gates the loader on `measurement` consent,
123
- * queues `init(apiKey, initOptions)` before the bundle loads, and uses
124
- * `setOptOut(false)` / `setOptOut(true)` for runtime consent changes after the
125
- * SDK has loaded.
126
- */
127
- export declare const amplitudeManifest: {
128
- readonly kind: "c15t.vendor-manifest";
129
- readonly schemaVersion: 1;
130
- readonly category: 'measurement';
131
- readonly install: [{
132
- readonly ifUndefined: true;
133
- readonly name: 'amplitude';
134
- readonly type: 'setGlobal';
135
- readonly value: {
136
- readonly _iq: {};
137
- readonly _q: readonly [];
138
- readonly invoked: true;
139
- };
140
- }, {
141
- readonly methods: ["set", "setOnce", "add", "append", "prepend", "preInsert", "postInsert", "remove", "unset", "clearAll", "getUserProperties"];
142
- readonly name: 'Identify';
143
- readonly queueProperty: '_q';
144
- readonly target: 'amplitude';
145
- readonly type: 'defineQueueClass';
146
- }, {
147
- readonly methods: ["init", "track", "identify", "flush"];
148
- readonly queue: {
149
- readonly property: '_q';
150
- };
151
- readonly queueFormat: 'wrappedMethodCall';
152
- readonly target: 'amplitude';
153
- readonly type: 'defineQueueMethods';
154
- }, {
155
- readonly type: 'defineQueueMethods';
156
- readonly target: 'amplitude';
157
- readonly queue: {
158
- readonly property: '_q';
159
- };
160
- readonly queueFormat: 'voidMethodCall';
161
- readonly methods: ["setUserId", "setOptOut"];
162
- }, {
163
- readonly args: ["{{apiKey}}", "{{initOptions}}"];
164
- readonly global: 'amplitude';
165
- readonly method: 'init';
166
- readonly type: 'callGlobal';
167
- }, {
168
- readonly async: true;
169
- readonly src: '{{scriptUrl}}';
170
- readonly type: 'loadScript';
171
- }];
172
- readonly onConsentDenied: [{
173
- readonly args: [true];
174
- readonly global: 'amplitude';
175
- readonly method: 'setOptOut';
176
- readonly type: 'callGlobal';
177
- }];
178
- readonly onConsentGranted: [{
179
- readonly args: [false];
180
- readonly global: 'amplitude';
181
- readonly method: 'setOptOut';
182
- readonly type: 'callGlobal';
183
- }];
184
- readonly onLoadDenied: [{
185
- readonly args: [true];
186
- readonly global: 'amplitude';
187
- readonly method: 'setOptOut';
188
- readonly type: 'callGlobal';
189
- }];
190
- readonly vendor: 'amplitude';
191
- };
192
- export interface AmplitudeOptions {
193
- /** Amplitude project API key. */
194
- apiKey: string;
195
- /**
196
- * Amplitude Browser SDK 2 initialization options.
197
- *
198
- * Values are serialized into the manifest, so use JSON-serializable values
199
- * only: plain objects, arrays, strings, numbers, booleans, and `null`.
200
- */
201
- initOptions?: Record<string, unknown>;
202
- /**
203
- * Optional Amplitude loader URL override.
204
- *
205
- * @default 'https://cdn.amplitude.com/libs/analytics-browser-2.44.4-min.js.gz'
206
- */
207
- scriptUrl?: string;
208
- }
209
- /**
210
- * Creates an Amplitude Browser SDK 2 script.
211
- *
212
- * @param options - The options for the Amplitude script.
213
- * @returns The Amplitude script configuration.
214
- * @throws {Error} When `apiKey` is missing or only whitespace.
215
- *
216
- * @remarks
217
- * The generated script is gated on `measurement` consent. It does not load the
218
- * Amplitude SDK until measurement consent is granted; after the SDK is loaded,
219
- * later consent changes call `amplitude.setOptOut(false)` or
220
- * `amplitude.setOptOut(true)`.
221
- *
222
- * @example
223
- * ```ts
224
- * import { amplitude } from '@c15t/scripts/amplitude';
225
- *
226
- * const script = amplitude({
227
- * apiKey: 'AMPLITUDE_API_KEY',
228
- * initOptions: {
229
- * autocapture: false,
230
- * },
231
- * });
232
- * ```
233
- */
234
- export declare const amplitude: ({ apiKey, initOptions, scriptUrl, }: AmplitudeOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/amplitude. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/amplitude';