@c15t/scripts 3.0.0-alpha.1 → 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 -59
  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 -137
  13. package/dist/engine/compile.js +2 -89
  14. package/dist/engine/runtime.js +2 -448
  15. package/dist/events.js +2 -0
  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 -392
  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 -0
  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 -66
  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 -0
  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 -56
  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 -0
  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 -59
  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 -0
  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 -458
  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 -0
  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 -93
  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 -0
  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 -158
  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 -0
  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 -94
  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 -59
  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/concepts/consent-state.md +357 -0
  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 -33
  207. package/docs/customization/recipes.md +839 -47
  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 +166 -36
  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 +168 -160
  245. package/docs/integrations/ahrefs-analytics.md +153 -155
  246. package/docs/integrations/amplitude.md +163 -157
  247. package/docs/integrations/building-integrations.md +136 -37
  248. package/docs/integrations/clearbit.md +155 -155
  249. package/docs/integrations/cloudflare-web-analytics.md +157 -157
  250. package/docs/integrations/cloudflare-zaraz.md +210 -262
  251. package/docs/integrations/crisp.md +165 -159
  252. package/docs/integrations/databuddy.md +158 -174
  253. package/docs/integrations/fathom-analytics.md +159 -157
  254. package/docs/integrations/front-chat.md +322 -0
  255. package/docs/integrations/google-maps.md +119 -84
  256. package/docs/integrations/google-tag-manager.md +179 -164
  257. package/docs/integrations/google-tag.md +164 -161
  258. package/docs/integrations/heap.md +164 -156
  259. package/docs/integrations/hightouch.md +162 -158
  260. package/docs/integrations/hotjar.md +160 -156
  261. package/docs/integrations/intercom.md +184 -154
  262. package/docs/integrations/klaviyo.md +486 -0
  263. package/docs/integrations/linkedin-insights.md +175 -151
  264. package/docs/integrations/logrocket.md +161 -157
  265. package/docs/integrations/matomo-analytics.md +189 -179
  266. package/docs/integrations/meta-pixel.md +189 -151
  267. package/docs/integrations/microsoft-clarity.md +164 -156
  268. package/docs/integrations/microsoft-uet.md +149 -155
  269. package/docs/integrations/mixpanel-analytics.md +156 -161
  270. package/docs/integrations/one-dollar-stats.md +306 -0
  271. package/docs/integrations/openai-pixel.md +205 -302
  272. package/docs/integrations/overview.md +143 -83
  273. package/docs/integrations/pinterest-tag.md +329 -0
  274. package/docs/integrations/pirsch.md +170 -160
  275. package/docs/integrations/plausible-analytics.md +173 -159
  276. package/docs/integrations/posthog.md +227 -242
  277. package/docs/integrations/promptwatch.md +155 -155
  278. package/docs/integrations/reddit-pixel.md +186 -158
  279. package/docs/integrations/rudderstack.md +202 -187
  280. package/docs/integrations/rybbit-analytics.md +172 -161
  281. package/docs/integrations/segment.md +183 -155
  282. package/docs/integrations/snapchat-pixel.md +187 -157
  283. package/docs/integrations/tiktok-pixel.md +172 -151
  284. package/docs/integrations/umami-analytics.md +164 -159
  285. package/docs/integrations/vercel-analytics.md +167 -158
  286. package/docs/integrations/x-pixel.md +177 -151
  287. package/docs/integrations/youtube.md +122 -87
  288. package/docs/upgrade-v3.md +490 -354
  289. package/package.json +12 -236
  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 -94
  295. package/docs/frameworks/next/script-loader.md +0 -210
  296. package/docs/frameworks/react/script-loader.md +0 -63
  297. package/docs/guides/consent-state.md +0 -60
  298. package/docs/guides/deployment-modes.md +0 -75
  299. package/docs/integrations/clear-on-revocation.md +0 -167
  300. package/docs/integrations/granular-consent.md +0 -208
@@ -1,90 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- fathom?: {
5
- blockTrackingForMe: () => void;
6
- enableTrackingForMe: () => void;
7
- trackEvent: (eventName: string, opts?: {
8
- _value?: number;
9
- }) => void;
10
- trackGoal: (goalId: string, cents: number) => void;
11
- trackPageview: (opts?: {
12
- url: string;
13
- referrer?: string;
14
- }) => void;
15
- };
16
- }
17
- }
18
- /**
19
- * Fathom Analytics vendor manifest.
20
- *
21
- * Configures Fathom via script `data-*` attributes. Fathom is a cookieless
22
- * analytics product, so the script is consent-gated on `measurement` and
23
- * unloaded when consent is revoked.
24
- */
25
- export declare const fathomAnalyticsManifest: {
26
- readonly kind: "c15t.vendor-manifest";
27
- readonly schemaVersion: 1;
28
- readonly category: 'measurement';
29
- readonly install: [{
30
- readonly attributes: {
31
- readonly 'data-auto': '{{autoAttribute}}';
32
- readonly 'data-canonical': '{{canonicalAttribute}}';
33
- readonly 'data-honor-dnt': '{{honorDntAttribute}}';
34
- readonly 'data-site': '{{site}}';
35
- readonly 'data-spa': '{{spa}}';
36
- };
37
- readonly defer: true;
38
- readonly src: '{{scriptUrl}}';
39
- readonly type: 'loadScript';
40
- }];
41
- readonly vendor: 'fathom-analytics';
42
- };
43
- export interface FathomAnalyticsOptions {
44
- /**
45
- * Your Fathom Analytics site ID.
46
- */
47
- site: string;
48
- /**
49
- * The SPA tracking mode. When undefined, SPA auto-routing is disabled and
50
- * the `data-spa` attribute is omitted.
51
- */
52
- spa?: 'auto' | 'history' | 'hash';
53
- /**
54
- * Automatically track page views.
55
- */
56
- auto?: boolean;
57
- /**
58
- * Enable canonical URL tracking.
59
- */
60
- canonical?: boolean;
61
- /**
62
- * Honor Do Not Track requests.
63
- */
64
- honorDnt?: boolean;
65
- /**
66
- * Custom loader URL.
67
- * @default 'https://cdn.usefathom.com/script.js'
68
- */
69
- scriptUrl?: string;
70
- }
71
- /**
72
- * Creates a Fathom Analytics script.
73
- *
74
- * @see https://usefathom.com/docs/script/script-settings
75
- *
76
- * @param options - The options for the Fathom Analytics script.
77
- * @returns The Fathom Analytics script.
78
- *
79
- * @example
80
- * ```ts
81
- * import { fathomAnalytics } from '@c15t/scripts/fathom-analytics';
82
- *
83
- * fathomAnalytics({
84
- * site: 'SITE123',
85
- * spa: 'history',
86
- * canonical: true,
87
- * });
88
- * ```
89
- */
90
- export declare const fathomAnalytics: (options: FathomAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/fathom-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/fathom-analytics';
@@ -1,93 +1,2 @@
1
- import type { AllConsentNames, Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- dataLayer: unknown[];
5
- gtag: (...args: unknown[]) => void;
6
- }
7
- }
8
- /**
9
- * Google Tag (gtag.js) vendor manifest.
10
- *
11
- * Similar to GTM but for direct Google product integration (Analytics, Ads, Floodlight).
12
- * Uses the same Consent Mode v2 mapping.
13
- */
14
- export declare const gtagManifest: {
15
- readonly kind: "c15t.vendor-manifest";
16
- readonly schemaVersion: 1;
17
- readonly alwaysLoad: true;
18
- readonly bootstrap: [{
19
- readonly ifUndefined: true;
20
- readonly name: 'dataLayer';
21
- readonly type: 'setGlobal';
22
- readonly value: readonly [];
23
- }, {
24
- readonly ifUndefined: true;
25
- readonly name: 'gtag';
26
- readonly queue: 'dataLayer';
27
- readonly type: 'defineQueueFunction';
28
- }];
29
- readonly category: '{{category}}';
30
- readonly consentMapping: Record<string, string[]>;
31
- readonly consentSignal: 'gtag';
32
- readonly install: [{
33
- readonly args: ["js", {
34
- readonly kind: "c15t.runtime-value";
35
- readonly value: 'date';
36
- }];
37
- readonly global: 'gtag';
38
- readonly type: 'callGlobal';
39
- }, {
40
- readonly args: ["config", "{{id}}"];
41
- readonly global: 'gtag';
42
- readonly type: 'callGlobal';
43
- }, {
44
- readonly async: true;
45
- readonly src: 'https://www.googletagmanager.com/gtag/js?id={{id}}';
46
- readonly type: 'loadScript';
47
- }];
48
- readonly persistAfterConsentRevoked: true;
49
- readonly vendor: 'gtag';
50
- };
51
- export interface GtagOptions {
52
- /**
53
- * Your gtag id
54
- * @example `G-XXXXXXX`
55
- */
56
- id: string;
57
- /**
58
- * The consent category to use for the gtag script. This is typically marketing (Ads & Floodlight) or measurement (Analytics)
59
- * @example 'marketing'
60
- */
61
- category: AllConsentNames;
62
- /**
63
- * Custom mapping from c15t consent categories to Google Consent Mode v2 types.
64
- * Overrides the default mapping when provided.
65
- *
66
- * @default
67
- * ```ts
68
- * {
69
- * necessary: ['security_storage'],
70
- * functionality: ['functionality_storage'],
71
- * measurement: ['analytics_storage'],
72
- * marketing: ['ad_storage', 'ad_user_data', 'ad_personalization'],
73
- * experience: ['personalization_storage'],
74
- * }
75
- * ```
76
- */
77
- consentMapping?: Record<string, string[]>;
78
- /**
79
- * Deprecated script-level overrides preserved for backwards compatibility.
80
- *
81
- * Prefer manifest-backed options instead of this generic override bag.
82
- * @deprecated
83
- */
84
- script?: Partial<Script>;
85
- }
86
- /**
87
- * Creates a Google Tag (gtag.js) script.
88
- * Allows you to send data website to linked Google products like Analytics, Ads & Floodlight.
89
- *
90
- * @param options - The options for the gtag script.
91
- * @returns The Google Tag Manager script.
92
- */
93
- export declare const gtag: ({ id, category, consentMapping, script, }: GtagOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/google-tag. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/google-tag';
@@ -1,316 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Default Heap config-loader base URL.
4
- *
5
- * Heap's current web installation snippet loads account configuration from a
6
- * per-environment `heap_config.js` URL. That configuration then chain-loads the
7
- * versioned heap.js runtime selected for the environment.
8
- */
9
- export declare const DEFAULT_HEAP_CONFIG_BASE_URL = "https://cdn.us.heap-api.com/config";
10
- /**
11
- * Current heap.js v5 method stubs from Heap's official web snippet.
12
- *
13
- * These methods do not push `[method, args]` tuples into `window.heap`. They
14
- * push `{ name, fn }` records into `window.heapReadyCb`; each callback replays
15
- * the original call against the loaded `window.heap` runtime.
16
- */
17
- export declare const HEAP_QUEUE_METHODS: readonly ['init', 'startTracking', 'stopTracking', 'track', 'resetIdentity', 'identify', 'identifyHashed', 'getSessionId', 'getUserId', 'getIdentity', 'addUserProperties', 'addEventProperties', 'removeEventProperty', 'clearEventProperties', 'addAccountProperties', 'addAdapter', 'addTransformer', 'addTransformerFn', 'onReady', 'addPageviewProperties', 'removePageviewProperty', 'clearPageviewProperties', 'trackPageview'];
18
- type JsonPrimitive = string | number | boolean | null;
19
- type JsonValue = JsonPrimitive | JsonValue[] | {
20
- [key: string]: JsonValue;
21
- };
22
- interface JsonRecord {
23
- [key: string]: JsonValue;
24
- }
25
- export interface HeapReadyCallback {
26
- /** Heap method name captured by the pre-load snippet stub. */
27
- name: (typeof HEAP_QUEUE_METHODS)[number];
28
- /** Callback invoked by heap.js after the runtime is ready. */
29
- fn: () => void;
30
- }
31
- /**
32
- * Minimal public heap.js API exposed on `window.heap`.
33
- *
34
- * Before the real SDK loads, c15t creates an array-backed stub with these
35
- * methods. The config loader calls `heap.init(envId, clientConfig,
36
- * serverConfig)`, and heap.js drains `window.heapReadyCb` by invoking each
37
- * stored callback.
38
- */
39
- export interface HeapApi {
40
- /** Environment/app id selected for this Heap installation. */
41
- envId?: string;
42
- /** Legacy alias used by some Heap runtime paths. */
43
- appid?: string;
44
- /** Client configuration passed into `heap.load()`. */
45
- clientConfig?: JsonRecord;
46
- /** Server configuration assigned by `heap_config.js` before heap.js loads. */
47
- serverConfig?: Record<string, unknown>;
48
- /**
49
- * Initializes the heap.js runtime.
50
- *
51
- * @param envId - Heap environment/app id.
52
- * @param clientConfig - Client-side configuration options.
53
- * @param serverConfig - Server-side configuration loaded by Heap.
54
- * @returns Vendor-specific runtime result.
55
- */
56
- init: (envId: string, clientConfig?: JsonRecord, serverConfig?: Record<string, unknown>) => unknown;
57
- /**
58
- * Starts Heap autocapture and event delivery.
59
- *
60
- * @returns Vendor-specific runtime result.
61
- */
62
- startTracking: () => unknown;
63
- /**
64
- * Stops Heap tracking for the current runtime session.
65
- *
66
- * @returns Vendor-specific runtime result.
67
- */
68
- stopTracking: () => unknown;
69
- /**
70
- * Tracks a custom Heap event.
71
- *
72
- * @param event - Event name to record.
73
- * @param properties - Optional event properties.
74
- * @returns Vendor-specific runtime result.
75
- */
76
- track: (event: string, properties?: Record<string, unknown>) => unknown;
77
- /**
78
- * Clears the current Heap identity.
79
- *
80
- * @returns Vendor-specific runtime result.
81
- */
82
- resetIdentity: () => unknown;
83
- /**
84
- * Identifies the current user.
85
- *
86
- * @param identity - Stable user identity.
87
- * @returns Vendor-specific runtime result.
88
- */
89
- identify: (identity: string) => unknown;
90
- /**
91
- * Identifies the current user with a hashed identity.
92
- *
93
- * @param identity - Hashed user identity.
94
- * @returns Vendor-specific runtime result.
95
- */
96
- identifyHashed: (identity: string) => unknown;
97
- /**
98
- * Reads the current Heap session id.
99
- *
100
- * @returns Current session id when available.
101
- */
102
- getSessionId: () => unknown;
103
- /**
104
- * Reads the current Heap user id.
105
- *
106
- * @returns Current Heap user id when available.
107
- */
108
- getUserId: () => unknown;
109
- /**
110
- * Reads the current Heap identity.
111
- *
112
- * @returns Current identity when available.
113
- */
114
- getIdentity: () => unknown;
115
- /**
116
- * Adds properties to the current user.
117
- *
118
- * @param properties - User properties to merge.
119
- * @returns Vendor-specific runtime result.
120
- */
121
- addUserProperties: (properties: Record<string, unknown>) => unknown;
122
- /**
123
- * Adds properties to every subsequent event.
124
- *
125
- * @param properties - Event properties to merge.
126
- * @returns Vendor-specific runtime result.
127
- */
128
- addEventProperties: (properties: Record<string, unknown>) => unknown;
129
- /**
130
- * Removes a single persisted event property.
131
- *
132
- * @param property - Event property name to remove.
133
- * @returns Vendor-specific runtime result.
134
- */
135
- removeEventProperty: (property: string) => unknown;
136
- /**
137
- * Clears persisted event properties.
138
- *
139
- * @returns Vendor-specific runtime result.
140
- */
141
- clearEventProperties: () => unknown;
142
- /**
143
- * Adds properties to the current account.
144
- *
145
- * @param properties - Account properties to merge.
146
- * @returns Vendor-specific runtime result.
147
- */
148
- addAccountProperties: (properties: Record<string, unknown>) => unknown;
149
- /**
150
- * Adds a Heap adapter.
151
- *
152
- * @param adapter - Adapter implementation accepted by heap.js.
153
- * @returns Vendor-specific runtime result.
154
- */
155
- addAdapter: (adapter: unknown) => unknown;
156
- /**
157
- * Adds a Heap event transformer.
158
- *
159
- * @param transformer - Transformer implementation accepted by heap.js.
160
- * @returns Vendor-specific runtime result.
161
- */
162
- addTransformer: (transformer: unknown) => unknown;
163
- /**
164
- * Adds a Heap transformer function.
165
- *
166
- * @param transformer - Transformer callback accepted by heap.js.
167
- * @returns Vendor-specific runtime result.
168
- */
169
- addTransformerFn: (transformer: (...args: unknown[]) => unknown) => unknown;
170
- /**
171
- * Registers a callback for Heap readiness.
172
- *
173
- * @param callback - Function to call once Heap is ready.
174
- * @returns Vendor-specific runtime result.
175
- */
176
- onReady: (callback: () => void) => unknown;
177
- /**
178
- * Adds properties to subsequent pageview events.
179
- *
180
- * @param properties - Pageview properties to merge.
181
- * @returns Vendor-specific runtime result.
182
- */
183
- addPageviewProperties: (properties: Record<string, unknown>) => unknown;
184
- /**
185
- * Removes a single persisted pageview property.
186
- *
187
- * @param property - Pageview property name to remove.
188
- * @returns Vendor-specific runtime result.
189
- */
190
- removePageviewProperty: (property: string) => unknown;
191
- /**
192
- * Clears persisted pageview properties.
193
- *
194
- * @returns Vendor-specific runtime result.
195
- */
196
- clearPageviewProperties: () => unknown;
197
- /**
198
- * Tracks a pageview event.
199
- *
200
- * @param properties - Optional pageview properties.
201
- * @returns Vendor-specific runtime result.
202
- */
203
- trackPageview: (properties?: Record<string, unknown>) => unknown;
204
- }
205
- declare global {
206
- interface Window {
207
- heap?: HeapApi;
208
- heapReadyCb?: HeapReadyCallback[];
209
- }
210
- }
211
- /**
212
- * Heap vendor manifest.
213
- *
214
- * Reproduces the heap.js v5 snippet contract consumed by
215
- * `heap_config.js`: `window.heapReadyCb` receives `{ name, fn }` callback
216
- * records, `window.heap` stores `envId`/`appid` and `clientConfig`, and the
217
- * Heap configuration script chain-loads the versioned heap.js runtime.
218
- *
219
- * Heap does not document a browser opt-out API that can make an already loaded
220
- * runtime inert for c15t's purposes, so c15t gates the load on `measurement`
221
- * consent and unloads the script when that consent is revoked.
222
- */
223
- export declare const heapManifest: {
224
- readonly kind: "c15t.vendor-manifest";
225
- readonly schemaVersion: 1;
226
- readonly category: 'measurement';
227
- readonly install: [{
228
- readonly ifUndefined: true;
229
- readonly name: 'heapReadyCb';
230
- readonly type: 'setGlobal';
231
- readonly value: readonly [];
232
- }, {
233
- readonly ifUndefined: true;
234
- readonly name: 'heap';
235
- readonly type: 'setGlobal';
236
- readonly value: readonly [];
237
- }, {
238
- readonly path: ["heap", "envId"];
239
- readonly type: 'setGlobalPath';
240
- readonly value: '{{envId}}';
241
- }, {
242
- readonly path: ["heap", "appid"];
243
- readonly type: 'setGlobalPath';
244
- readonly value: '{{envId}}';
245
- }, {
246
- readonly path: ["heap", "clientConfig"];
247
- readonly type: 'setGlobalPath';
248
- readonly value: '{{clientConfig}}';
249
- }, {
250
- readonly methods: ["init", "startTracking", "stopTracking", "track", "resetIdentity", "identify", "identifyHashed", "getSessionId", "getUserId", "getIdentity", "addUserProperties", "addEventProperties", "removeEventProperty", "clearEventProperties", "addAccountProperties", "addAdapter", "addTransformer", "addTransformerFn", "onReady", "addPageviewProperties", "removePageviewProperty", "clearPageviewProperties", "trackPageview"];
251
- readonly queue: {
252
- readonly global: 'heapReadyCb';
253
- };
254
- readonly queueFormat: 'callback';
255
- readonly target: 'heap';
256
- readonly type: 'defineQueueMethods';
257
- }, {
258
- readonly async: true;
259
- readonly src: '{{scriptUrl}}';
260
- readonly type: 'loadScript';
261
- }];
262
- readonly vendor: 'heap';
263
- };
264
- export interface HeapOptions {
265
- /**
266
- * Heap environment/app id.
267
- *
268
- * Heap's app UI commonly shows this as a numeric string. c15t validates only
269
- * that the value is a non-empty string after trimming because Heap's public
270
- * install docs describe it generically as `YOUR_APP_ID`.
271
- */
272
- envId: string;
273
- /**
274
- * Optional heap.js client configuration.
275
- *
276
- * Values must be JSON-serializable: plain objects, arrays, strings, finite
277
- * numbers, booleans, and `null`. c15t adds `shouldFetchServerConfig: false`
278
- * to match Heap's current web installation snippet.
279
- */
280
- clientConfig?: Record<string, unknown>;
281
- /**
282
- * Optional full Heap config-loader URL override.
283
- *
284
- * @default 'https://cdn.us.heap-api.com/config/{envId}/heap_config.js'
285
- */
286
- scriptUrl?: string;
287
- }
288
- /**
289
- * Creates a Heap web analytics script.
290
- *
291
- * @see https://developers.heap.io/docs/web
292
- *
293
- * @param options - The options for the Heap script.
294
- * @returns The Heap script configuration.
295
- * @throws {Error} When `envId` is missing or only whitespace.
296
- * @throws {TypeError} When `clientConfig` contains non-JSON values.
297
- *
298
- * @remarks
299
- * Heap autocaptures interactions as soon as heap.js loads. c15t therefore
300
- * gates the config loader on `measurement` consent and unloads the script when
301
- * that consent is revoked.
302
- *
303
- * @example
304
- * ```ts
305
- * import { heap } from '@c15t/scripts/heap';
306
- *
307
- * const script = heap({
308
- * envId: '123456789',
309
- * clientConfig: {
310
- * disableTextCapture: true,
311
- * },
312
- * });
313
- * ```
314
- */
315
- export declare const heap: ({ envId, clientConfig, scriptUrl, }: HeapOptions) => Script;
316
- export {};
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/heap. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/heap';