@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
@@ -4,64 +4,71 @@ import { buildQueuePixelInstall } from "../_shared/install-builders.js";
4
4
  import { resolveScriptUrl } from "../_shared/script-url.js";
5
5
  const redditPixelManifest = {
6
6
  ...vendorManifestContract,
7
- vendor: 'reddit-pixel',
8
- category: 'marketing',
9
- persistAfterConsentRevoked: true,
10
7
  bootstrap: [
11
8
  {
12
- type: 'defineStubFunction',
9
+ dispatchProperty: 'sendEvent',
10
+ ifUndefined: true,
13
11
  name: 'rdt',
14
12
  queue: {
15
13
  property: 'callQueue'
16
14
  },
17
- dispatchProperty: 'sendEvent',
18
15
  queueFormat: 'array',
19
- ifUndefined: true
16
+ type: 'defineStubFunction'
20
17
  }
21
18
  ],
19
+ category: 'marketing',
22
20
  install: [
23
21
  {
24
- type: 'callGlobal',
25
- global: 'rdt',
26
22
  args: [
27
23
  'init',
28
24
  '{{pixelId}}'
29
- ]
25
+ ],
26
+ global: 'rdt',
27
+ type: 'callGlobal'
30
28
  },
31
29
  {
32
- type: 'callGlobal',
33
- global: 'rdt',
34
30
  args: [
35
31
  'track',
36
32
  'PageVisit'
37
- ]
33
+ ],
34
+ global: 'rdt',
35
+ type: 'callGlobal'
38
36
  },
39
37
  {
40
- type: 'loadScript',
38
+ async: true,
41
39
  src: "{{scriptUrl}}",
42
- async: true
40
+ type: 'loadScript'
43
41
  }
44
42
  ],
45
- onConsentGranted: [
43
+ onConsentDenied: [
46
44
  {
47
- type: 'callGlobal',
48
- global: 'rdt',
49
45
  args: [
50
- 'enableFirstPartyCookies'
51
- ]
46
+ 'disableFirstPartyCookies'
47
+ ],
48
+ global: 'rdt',
49
+ type: 'callGlobal'
52
50
  }
53
51
  ],
54
- onConsentDenied: [
52
+ onConsentGranted: [
55
53
  {
56
- type: 'callGlobal',
57
- global: 'rdt',
58
54
  args: [
59
- 'disableFirstPartyCookies'
60
- ]
55
+ 'enableFirstPartyCookies'
56
+ ],
57
+ global: 'rdt',
58
+ type: 'callGlobal'
61
59
  }
62
- ]
60
+ ],
61
+ persistAfterConsentRevoked: true,
62
+ vendor: 'reddit-pixel'
63
+ };
64
+ const reddit_pixel_getRedditPixelInitOptions = function({ initOptions, disableFirstPartyCookies }) {
65
+ if (void 0 === disableFirstPartyCookies) return initOptions;
66
+ return {
67
+ ...initOptions,
68
+ disableFirstPartyCookies
69
+ };
63
70
  };
64
- function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirstPartyCookies, scriptUrl }) {
71
+ const reddit_pixel_redditPixel = function({ pixelId, trackPageVisit = true, initOptions, disableFirstPartyCookies, scriptUrl }) {
65
72
  let trackStep;
66
73
  if (trackPageVisit) trackStep = {
67
74
  args: [
@@ -69,9 +76,9 @@ function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirst
69
76
  'PageVisit'
70
77
  ]
71
78
  };
72
- const resolvedInitOptions = getRedditPixelInitOptions({
73
- initOptions,
74
- disableFirstPartyCookies
79
+ const resolvedInitOptions = reddit_pixel_getRedditPixelInitOptions({
80
+ disableFirstPartyCookies,
81
+ initOptions
75
82
  });
76
83
  const initArgs = [
77
84
  'init',
@@ -88,20 +95,13 @@ function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirst
88
95
  install
89
96
  };
90
97
  return resolveManifest(manifest, {
91
- pixelId,
92
98
  initOptions: resolvedInitOptions,
99
+ pixelId,
93
100
  scriptUrl: resolveScriptUrl(scriptUrl, 'https://www.redditstatic.com/ads/pixel.js')
94
101
  });
95
- }
96
- function getRedditPixelInitOptions({ initOptions, disableFirstPartyCookies }) {
97
- if (void 0 === disableFirstPartyCookies) return initOptions;
98
- return {
99
- ...initOptions,
100
- disableFirstPartyCookies
101
- };
102
- }
102
+ };
103
103
  const redditPixelEvent = (eventName, metadata)=>{
104
104
  if ("u" < typeof window || 'function' != typeof window.rdt) return;
105
105
  window.rdt('track', eventName, metadata);
106
106
  };
107
- export { redditPixel, redditPixelEvent, redditPixelManifest };
107
+ export { redditPixelEvent, redditPixelManifest, reddit_pixel_redditPixel as redditPixel };
@@ -4,55 +4,55 @@ import { buildQueuePixelInstall } from "../_shared/install-builders.js";
4
4
  import { resolveScriptUrl } from "../_shared/script-url.js";
5
5
  const snapchatPixelManifest = {
6
6
  ...vendorManifestContract,
7
- vendor: 'snapchat-pixel',
8
- category: 'marketing',
9
7
  bootstrap: [
10
8
  {
11
- type: 'defineStubFunction',
9
+ aliases: [
10
+ '_snaptr'
11
+ ],
12
+ dispatchProperty: 'handleRequest',
13
+ ifUndefined: true,
12
14
  name: 'snaptr',
15
+ properties: {
16
+ loaded: true,
17
+ version: '1.0'
18
+ },
13
19
  queue: {
14
20
  property: 'queue'
15
21
  },
16
- dispatchProperty: 'handleRequest',
17
22
  queueFormat: 'array',
18
- aliases: [
19
- '_snaptr'
20
- ],
21
23
  selfReferences: [
22
24
  'push'
23
25
  ],
24
- properties: {
25
- loaded: true,
26
- version: '1.0'
27
- },
28
- ifUndefined: true
26
+ type: 'defineStubFunction'
29
27
  }
30
28
  ],
29
+ category: 'marketing',
31
30
  install: [
32
31
  {
33
- type: 'callGlobal',
34
- global: 'snaptr',
35
32
  args: [
36
33
  'init',
37
34
  '{{pixelId}}'
38
- ]
35
+ ],
36
+ global: 'snaptr',
37
+ type: 'callGlobal'
39
38
  },
40
39
  {
41
- type: 'callGlobal',
42
- global: 'snaptr',
43
40
  args: [
44
41
  'track',
45
42
  'PAGE_VIEW'
46
- ]
43
+ ],
44
+ global: 'snaptr',
45
+ type: 'callGlobal'
47
46
  },
48
47
  {
49
- type: 'loadScript',
48
+ async: true,
50
49
  src: "{{scriptUrl}}",
51
- async: true
50
+ type: 'loadScript'
52
51
  }
53
- ]
52
+ ],
53
+ vendor: 'snapchat-pixel'
54
54
  };
55
- function snapchatPixel({ pixelId, initOptions, trackPageView = true, scriptUrl }) {
55
+ const snapchat_pixel_snapchatPixel = function({ pixelId, initOptions, trackPageView = true, scriptUrl }) {
56
56
  const initArgs = [
57
57
  'init',
58
58
  '{{pixelId}}'
@@ -75,13 +75,13 @@ function snapchatPixel({ pixelId, initOptions, trackPageView = true, scriptUrl }
75
75
  install
76
76
  };
77
77
  return resolveManifest(manifest, {
78
- pixelId,
79
78
  initOptions,
79
+ pixelId,
80
80
  scriptUrl: resolveScriptUrl(scriptUrl, 'https://sc-static.net/scevent.min.js')
81
81
  });
82
- }
82
+ };
83
83
  const snapchatPixelEvent = (eventName, properties)=>{
84
84
  if ("u" < typeof window || 'function' != typeof window.snaptr) return;
85
85
  window.snaptr('track', eventName, properties);
86
86
  };
87
- export { snapchatPixel, snapchatPixelEvent, snapchatPixelManifest };
87
+ export { snapchatPixelEvent, snapchatPixelManifest, snapchat_pixel_snapchatPixel as snapchatPixel };
@@ -2,24 +2,26 @@ import { resolveManifest } from "../../resolve.js";
2
2
  import { vendorManifestContract } from "../../types.js";
3
3
  const tiktokPixelManifest = {
4
4
  ...vendorManifestContract,
5
- vendor: 'tiktok-pixel',
6
- category: 'marketing',
7
- persistAfterConsentRevoked: true,
5
+ afterLoad: [
6
+ {
7
+ global: 'ttq',
8
+ method: 'grantConsent',
9
+ type: 'callGlobal'
10
+ }
11
+ ],
8
12
  bootstrap: [
9
13
  {
10
- type: 'setGlobal',
11
14
  name: 'TiktokAnalyticsObject',
15
+ type: 'setGlobal',
12
16
  value: 'ttq'
13
17
  },
14
18
  {
15
- type: 'setGlobal',
19
+ ifUndefined: true,
16
20
  name: 'ttq',
17
- value: [],
18
- ifUndefined: true
21
+ type: 'setGlobal',
22
+ value: []
19
23
  },
20
24
  {
21
- type: 'defineQueueMethods',
22
- target: 'ttq',
23
25
  methods: [
24
26
  'page',
25
27
  'track',
@@ -37,53 +39,51 @@ const tiktokPixelManifest = {
37
39
  'holdConsent',
38
40
  'revokeConsent',
39
41
  'grantConsent'
40
- ]
42
+ ],
43
+ target: 'ttq',
44
+ type: 'defineQueueMethods'
41
45
  }
42
46
  ],
47
+ category: 'marketing',
43
48
  install: [
44
49
  {
45
- type: 'callGlobal',
46
50
  global: 'ttq',
47
- method: 'grantConsent'
51
+ method: 'grantConsent',
52
+ type: 'callGlobal'
48
53
  },
49
54
  {
50
- type: 'callGlobal',
51
55
  global: 'ttq',
52
- method: 'page'
56
+ method: 'page',
57
+ type: 'callGlobal'
53
58
  },
54
59
  {
55
- type: 'loadScript',
60
+ async: true,
56
61
  src: "{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq",
57
- async: true
62
+ type: 'loadScript'
58
63
  }
59
64
  ],
60
- afterLoad: [
65
+ onConsentDenied: [
61
66
  {
62
- type: 'callGlobal',
63
67
  global: 'ttq',
64
- method: 'grantConsent'
68
+ method: 'revokeConsent',
69
+ type: 'callGlobal'
65
70
  }
66
71
  ],
67
72
  onConsentGranted: [
68
73
  {
69
- type: 'callGlobal',
70
74
  global: 'ttq',
71
- method: 'grantConsent'
75
+ method: 'grantConsent',
76
+ type: 'callGlobal'
72
77
  }
73
78
  ],
74
- onConsentDenied: [
75
- {
76
- type: 'callGlobal',
77
- global: 'ttq',
78
- method: 'revokeConsent'
79
- }
80
- ]
79
+ persistAfterConsentRevoked: true,
80
+ vendor: 'tiktok-pixel'
81
81
  };
82
- function tiktokPixel({ pixelId, scriptSrc }) {
82
+ const tiktok_pixel_tiktokPixel = function({ pixelId, scriptSrc }) {
83
83
  const resolved = resolveManifest(tiktokPixelManifest, {
84
84
  pixelId,
85
85
  scriptSrc: scriptSrc ?? 'https://analytics.tiktok.com/i18n/pixel/events.js'
86
86
  });
87
87
  return resolved;
88
- }
89
- export { tiktokPixel, tiktokPixelManifest };
88
+ };
89
+ export { tiktokPixelManifest, tiktok_pixel_tiktokPixel as tiktokPixel };
@@ -2,47 +2,47 @@ import { resolveManifest } from "../../resolve.js";
2
2
  import { vendorManifestContract } from "../../types.js";
3
3
  const xPixelManifest = {
4
4
  ...vendorManifestContract,
5
- vendor: 'x-pixel',
6
- category: 'marketing',
7
5
  bootstrap: [
8
6
  {
9
- type: 'defineStubFunction',
10
- name: 'twq',
11
- queue: {
12
- property: 'queue'
13
- },
14
7
  dispatchProperty: 'exe',
8
+ ifUndefined: true,
9
+ name: 'twq',
15
10
  properties: {
16
11
  version: '1.1'
17
12
  },
18
- ifUndefined: true
13
+ queue: {
14
+ property: 'queue'
15
+ },
16
+ type: 'defineStubFunction'
19
17
  }
20
18
  ],
19
+ category: 'marketing',
21
20
  install: [
22
21
  {
23
- type: 'callGlobal',
24
- global: 'twq',
25
22
  args: [
26
23
  'config',
27
24
  '{{pixelId}}'
28
- ]
25
+ ],
26
+ global: 'twq',
27
+ type: 'callGlobal'
29
28
  },
30
29
  {
31
- type: 'loadScript',
30
+ async: true,
32
31
  src: "{{scriptSrc}}",
33
- async: true
32
+ type: 'loadScript'
34
33
  }
35
- ]
34
+ ],
35
+ vendor: 'x-pixel'
36
36
  };
37
- function xPixel({ pixelId, scriptSrc }) {
37
+ const x_pixel_xPixel = function({ pixelId, scriptSrc }) {
38
38
  const resolved = resolveManifest(xPixelManifest, {
39
39
  pixelId,
40
40
  scriptSrc: scriptSrc ?? 'https://static.ads-twitter.com/uwt.js'
41
41
  });
42
42
  return resolved;
43
- }
43
+ };
44
44
  const xPixelEvent = (eventId, metadata)=>{
45
45
  if ("u" < typeof window || 'function' != typeof window.twq) throw new Error('X Pixel (twq) is not loaded. Ensure marketing consent is granted before calling xPixelEvent.');
46
46
  window.twq('event', eventId, metadata);
47
47
  };
48
- export { xPixel, xPixelEvent, xPixelManifest };
48
+ export { xPixelEvent, xPixelManifest, x_pixel_xPixel as xPixel };
@@ -1,6 +1,6 @@
1
1
  import { resolveManifest } from "../../resolve.js";
2
2
  import { vendorManifestContract } from "../../types.js";
3
- function validateAdobeAnalyticsScriptUrl(scriptUrl) {
3
+ const adobe_analytics_validateAdobeAnalyticsScriptUrl = function(scriptUrl) {
4
4
  const trimmed = scriptUrl.trim();
5
5
  if (0 === trimmed.length) throw new Error("adobeAnalytics: invalid scriptUrl - must be a non-empty https URL from your Adobe Data Collection embed code");
6
6
  let parsed;
@@ -11,39 +11,39 @@ function validateAdobeAnalyticsScriptUrl(scriptUrl) {
11
11
  }
12
12
  if ('https:' !== parsed.protocol) throw new Error("adobeAnalytics: invalid scriptUrl - must use https: from your Adobe Data Collection embed code");
13
13
  return trimmed;
14
- }
15
- function createAdobeAnalyticsManifest(options) {
14
+ };
15
+ const adobe_analytics_createAdobeAnalyticsManifest = function(options) {
16
16
  const install = [];
17
17
  if (options.seedAdobeDataLayer) install.push({
18
- type: 'setGlobal',
18
+ ifUndefined: true,
19
19
  name: 'adobeDataLayer',
20
- value: [],
21
- ifUndefined: true
20
+ type: 'setGlobal',
21
+ value: []
22
22
  });
23
23
  install.push({
24
- type: 'loadScript',
24
+ async: options.async,
25
25
  src: "{{scriptUrl}}",
26
- async: options.async
26
+ type: 'loadScript'
27
27
  });
28
28
  return {
29
29
  ...vendorManifestContract,
30
- vendor: 'adobe-analytics',
31
30
  category: 'measurement',
32
- install
31
+ install,
32
+ vendor: 'adobe-analytics'
33
33
  };
34
- }
35
- const adobeAnalyticsManifest = createAdobeAnalyticsManifest({
34
+ };
35
+ const adobeAnalyticsManifest = adobe_analytics_createAdobeAnalyticsManifest({
36
36
  async: true,
37
37
  seedAdobeDataLayer: true
38
38
  });
39
- function adobeAnalytics(options) {
40
- const scriptUrl = validateAdobeAnalyticsScriptUrl(options.scriptUrl);
41
- const manifest = createAdobeAnalyticsManifest({
39
+ const adobe_analytics_adobeAnalytics = function(options) {
40
+ const scriptUrl = adobe_analytics_validateAdobeAnalyticsScriptUrl(options.scriptUrl);
41
+ const manifest = adobe_analytics_createAdobeAnalyticsManifest({
42
42
  async: options.async ?? true,
43
43
  seedAdobeDataLayer: options.seedAdobeDataLayer ?? true
44
44
  });
45
45
  return resolveManifest(manifest, {
46
46
  scriptUrl
47
47
  });
48
- }
49
- export { adobeAnalytics, adobeAnalyticsManifest };
48
+ };
49
+ export { adobeAnalyticsManifest, adobe_analytics_adobeAnalytics as adobeAnalytics };
@@ -3,25 +3,25 @@ import { vendorManifestContract } from "../../types.js";
3
3
  import { resolveScriptUrl } from "../_shared/script-url.js";
4
4
  const ahrefsAnalyticsManifest = {
5
5
  ...vendorManifestContract,
6
- vendor: 'ahrefs-analytics',
7
6
  category: 'measurement',
8
7
  install: [
9
8
  {
10
- type: 'loadScript',
11
- src: "{{scriptUrl}}",
12
9
  async: true,
13
10
  attributes: {
14
11
  'data-key': '{{key}}'
15
- }
12
+ },
13
+ src: "{{scriptUrl}}",
14
+ type: 'loadScript'
16
15
  }
17
- ]
16
+ ],
17
+ vendor: 'ahrefs-analytics'
18
18
  };
19
- function ahrefsAnalytics(options) {
19
+ const ahrefs_analytics_ahrefsAnalytics = function(options) {
20
20
  const key = 'string' == typeof options.key ? options.key.trim() : '';
21
21
  if (0 === key.length) throw new Error('ahrefsAnalytics: missing or invalid key');
22
22
  return resolveManifest(ahrefsAnalyticsManifest, {
23
23
  key,
24
24
  scriptUrl: resolveScriptUrl(options.scriptUrl, 'https://analytics.ahrefs.com/analytics.js')
25
25
  });
26
- }
27
- export { ahrefsAnalytics, ahrefsAnalyticsManifest };
26
+ };
27
+ export { ahrefsAnalyticsManifest, ahrefs_analytics_ahrefsAnalytics as ahrefsAnalytics };
@@ -32,38 +32,37 @@ const AMPLITUDE_IDENTIFY_METHODS = [
32
32
  ];
33
33
  const amplitudeManifest = {
34
34
  ...vendorManifestContract,
35
- vendor: 'amplitude',
36
35
  category: 'measurement',
37
36
  install: [
38
37
  {
39
- type: 'setGlobal',
38
+ ifUndefined: true,
40
39
  name: 'amplitude',
40
+ type: 'setGlobal',
41
41
  value: {
42
- _q: [],
43
42
  _iq: {},
43
+ _q: [],
44
44
  invoked: true
45
- },
46
- ifUndefined: true
45
+ }
47
46
  },
48
47
  {
49
- type: 'defineQueueClass',
50
- target: 'amplitude',
51
- name: 'Identify',
52
- queueProperty: '_q',
53
48
  methods: [
54
49
  ...AMPLITUDE_IDENTIFY_METHODS
55
- ]
50
+ ],
51
+ name: 'Identify',
52
+ queueProperty: '_q',
53
+ target: 'amplitude',
54
+ type: 'defineQueueClass'
56
55
  },
57
56
  {
58
- type: 'defineQueueMethods',
59
- target: 'amplitude',
57
+ methods: [
58
+ ...AMPLITUDE_PROMISE_QUEUE_METHODS
59
+ ],
60
60
  queue: {
61
61
  property: '_q'
62
62
  },
63
63
  queueFormat: 'wrappedMethodCall',
64
- methods: [
65
- ...AMPLITUDE_PROMISE_QUEUE_METHODS
66
- ]
64
+ target: 'amplitude',
65
+ type: 'defineQueueMethods'
67
66
  },
68
67
  {
69
68
  type: 'defineQueueMethods',
@@ -77,52 +76,53 @@ const amplitudeManifest = {
77
76
  ]
78
77
  },
79
78
  {
80
- type: 'callGlobal',
81
- global: 'amplitude',
82
- method: 'init',
83
79
  args: [
84
80
  '{{apiKey}}',
85
81
  '{{initOptions}}'
86
- ]
82
+ ],
83
+ global: 'amplitude',
84
+ method: 'init',
85
+ type: 'callGlobal'
87
86
  },
88
87
  {
89
- type: 'loadScript',
88
+ async: true,
90
89
  src: "{{scriptUrl}}",
91
- async: true
90
+ type: 'loadScript'
92
91
  }
93
92
  ],
94
- onLoadDenied: [
93
+ onConsentDenied: [
95
94
  {
96
- type: 'callGlobal',
97
- global: 'amplitude',
98
- method: 'setOptOut',
99
95
  args: [
100
96
  true
101
- ]
97
+ ],
98
+ global: 'amplitude',
99
+ method: 'setOptOut',
100
+ type: 'callGlobal'
102
101
  }
103
102
  ],
104
103
  onConsentGranted: [
105
104
  {
106
- type: 'callGlobal',
107
- global: 'amplitude',
108
- method: 'setOptOut',
109
105
  args: [
110
106
  false
111
- ]
107
+ ],
108
+ global: 'amplitude',
109
+ method: 'setOptOut',
110
+ type: 'callGlobal'
112
111
  }
113
112
  ],
114
- onConsentDenied: [
113
+ onLoadDenied: [
115
114
  {
116
- type: 'callGlobal',
117
- global: 'amplitude',
118
- method: 'setOptOut',
119
115
  args: [
120
116
  true
121
- ]
117
+ ],
118
+ global: 'amplitude',
119
+ method: 'setOptOut',
120
+ type: 'callGlobal'
122
121
  }
123
- ]
122
+ ],
123
+ vendor: 'amplitude'
124
124
  };
125
- function amplitude({ apiKey, initOptions = {}, scriptUrl }) {
125
+ const amplitude_amplitude = function({ apiKey, initOptions = {}, scriptUrl }) {
126
126
  const normalizedApiKey = 'string' == typeof apiKey ? apiKey.trim() : '';
127
127
  if (0 === normalizedApiKey.length) throw new Error('amplitude: missing or invalid apiKey');
128
128
  return resolveManifest(amplitudeManifest, {
@@ -130,5 +130,5 @@ function amplitude({ apiKey, initOptions = {}, scriptUrl }) {
130
130
  initOptions,
131
131
  scriptUrl: resolveScriptUrl(trimToUndefined(scriptUrl), DEFAULT_AMPLITUDE_SCRIPT_URL)
132
132
  });
133
- }
134
- export { AMPLITUDE_IDENTIFY_METHODS, AMPLITUDE_PROMISE_QUEUE_METHODS, AMPLITUDE_QUEUE_METHODS, AMPLITUDE_SYNC_QUEUE_METHODS, DEFAULT_AMPLITUDE_BROWSER_SDK_VERSION, DEFAULT_AMPLITUDE_SCRIPT_URL, amplitude, amplitudeManifest };
133
+ };
134
+ export { AMPLITUDE_IDENTIFY_METHODS, AMPLITUDE_PROMISE_QUEUE_METHODS, AMPLITUDE_QUEUE_METHODS, AMPLITUDE_SYNC_QUEUE_METHODS, DEFAULT_AMPLITUDE_BROWSER_SDK_VERSION, DEFAULT_AMPLITUDE_SCRIPT_URL, amplitudeManifest, amplitude_amplitude as amplitude };
@@ -1,28 +1,28 @@
1
1
  import { resolveManifest } from "../../resolve.js";
2
2
  import { vendorManifestContract } from "../../types.js";
3
3
  import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
4
- function getDefaultClearbitScriptUrl(publishableKey) {
4
+ const clearbit_getDefaultClearbitScriptUrl = function(publishableKey) {
5
5
  return `https://tag.clearbitscripts.com/v1/${encodeURIComponent(publishableKey)}/tags.js`;
6
- }
6
+ };
7
7
  const clearbitManifest = {
8
8
  ...vendorManifestContract,
9
- vendor: 'clearbit',
10
9
  category: 'marketing',
11
10
  install: [
12
11
  {
13
- type: 'loadScript',
14
- src: "{{scriptUrl}}",
15
12
  attributes: {
16
13
  referrerpolicy: 'strict-origin-when-cross-origin'
17
- }
14
+ },
15
+ src: "{{scriptUrl}}",
16
+ type: 'loadScript'
18
17
  }
19
- ]
18
+ ],
19
+ vendor: 'clearbit'
20
20
  };
21
- function clearbit(options) {
21
+ const clearbit_clearbit = function(options) {
22
22
  const publishableKey = 'string' == typeof options.publishableKey ? options.publishableKey.trim() : '';
23
23
  if (0 === publishableKey.length) throw new Error('clearbit: invalid publishableKey - must be a non-empty string');
24
24
  return resolveManifest(clearbitManifest, {
25
- scriptUrl: resolveScriptUrl(trimToUndefined(options.scriptUrl), getDefaultClearbitScriptUrl(publishableKey))
25
+ scriptUrl: resolveScriptUrl(trimToUndefined(options.scriptUrl), clearbit_getDefaultClearbitScriptUrl(publishableKey))
26
26
  });
27
- }
28
- export { clearbit, clearbitManifest };
27
+ };
28
+ export { clearbitManifest, clearbit_clearbit as clearbit };