@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.
- package/AGENTS.md +129 -59
- package/README.md +8 -29
- package/SKILL.md +33 -0
- package/dist/adobe-analytics.js +2 -0
- package/dist/ahrefs-analytics.js +2 -0
- package/dist/amplitude.js +2 -0
- package/dist/clearbit.js +2 -0
- package/dist/cloudflare-web-analytics.js +2 -0
- package/dist/cloudflare-zaraz.js +2 -0
- package/dist/crisp.js +2 -0
- package/dist/databuddy.js +2 -0
- package/dist/e2e-test-utils.js +2 -137
- package/dist/engine/compile.js +2 -89
- package/dist/engine/runtime.js +2 -448
- package/dist/events.js +2 -0
- package/dist/fathom-analytics.js +2 -0
- package/dist/front-chat.js +2 -0
- package/dist/google-tag-manager.js +2 -0
- package/dist/google-tag.js +2 -0
- package/dist/heap.js +2 -0
- package/dist/hightouch.js +2 -0
- package/dist/hotjar.js +2 -0
- package/dist/intercom.js +2 -0
- package/dist/klaviyo.js +2 -0
- package/dist/linkedin-insights.js +2 -0
- package/dist/logrocket.js +2 -0
- package/dist/matomo-analytics.js +2 -0
- package/dist/meta-pixel.js +2 -0
- package/dist/microsoft-clarity.js +2 -0
- package/dist/microsoft-uet.js +2 -0
- package/dist/mixpanel-analytics.js +2 -0
- package/dist/one-dollar-stats.js +2 -0
- package/dist/openai-pixel.js +2 -0
- package/dist/pinterest-tag.js +2 -0
- package/dist/pirsch.js +2 -0
- package/dist/plausible-analytics.js +2 -0
- package/dist/posthog.js +2 -0
- package/dist/promptwatch.js +2 -0
- package/dist/reddit-pixel.js +2 -0
- package/dist/registry.js +2 -392
- package/dist/resolve.js +2 -33
- package/dist/rudderstack.js +2 -0
- package/dist/rybbit-analytics.js +2 -0
- package/dist/segment.js +2 -0
- package/dist/snapchat-pixel.js +2 -0
- package/dist/tiktok-pixel.js +2 -0
- package/dist/types.js +2 -16
- package/dist/umami-analytics.js +2 -0
- package/dist/vendors/_shared/attributes.js +2 -14
- package/dist/vendors/_shared/google-consent.js +2 -27
- package/dist/vendors/_shared/install-builders.js +2 -21
- package/dist/vendors/_shared/required-id.js +2 -0
- package/dist/vendors/_shared/script-url.js +2 -28
- package/dist/vendors/ads-and-pixels/linkedin-insights.js +2 -48
- package/dist/vendors/ads-and-pixels/meta-pixel.js +2 -153
- package/dist/vendors/ads-and-pixels/microsoft-uet.js +2 -110
- package/dist/vendors/ads-and-pixels/openai-pixel.js +2 -88
- package/dist/vendors/ads-and-pixels/pinterest-tag.js +2 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +2 -107
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +2 -87
- package/dist/vendors/ads-and-pixels/tiktok-pixel.js +2 -89
- package/dist/vendors/ads-and-pixels/x-pixel.js +2 -48
- package/dist/vendors/analytics/adobe-analytics.js +2 -49
- package/dist/vendors/analytics/ahrefs-analytics.js +2 -27
- package/dist/vendors/analytics/amplitude.js +2 -134
- package/dist/vendors/analytics/clearbit.js +2 -28
- package/dist/vendors/analytics/cloudflare-web-analytics.js +2 -32
- package/dist/vendors/analytics/databuddy.js +2 -103
- package/dist/vendors/analytics/fathom-analytics.js +2 -35
- package/dist/vendors/analytics/google-tag.js +2 -66
- package/dist/vendors/analytics/heap.js +2 -134
- package/dist/vendors/analytics/hightouch.js +2 -109
- package/dist/vendors/analytics/hotjar.js +2 -44
- package/dist/vendors/analytics/logrocket.js +2 -58
- package/dist/vendors/analytics/matomo-analytics.js +2 -191
- package/dist/vendors/analytics/microsoft-clarity.js +2 -100
- package/dist/vendors/analytics/mixpanel-analytics.js +2 -93
- package/dist/vendors/analytics/one-dollar-stats.js +2 -0
- package/dist/vendors/analytics/pirsch.js +2 -67
- package/dist/vendors/analytics/plausible-analytics.js +2 -81
- package/dist/vendors/analytics/posthog.js +2 -200
- package/dist/vendors/analytics/promptwatch.js +2 -29
- package/dist/vendors/analytics/rudderstack.js +2 -183
- package/dist/vendors/analytics/rybbit-analytics.js +2 -63
- package/dist/vendors/analytics/segment.js +2 -56
- package/dist/vendors/analytics/umami-analytics.js +2 -39
- package/dist/vendors/analytics/vercel-analytics.js +2 -53
- package/dist/vendors/email-and-sms/klaviyo.js +2 -0
- package/dist/vendors/functional/crisp.js +2 -100
- package/dist/vendors/functional/front-chat.js +2 -0
- package/dist/vendors/functional/intercom.js +2 -45
- package/dist/vendors/tag-managers/cloudflare-zaraz.js +2 -98
- package/dist/vendors/tag-managers/google-tag-manager.js +2 -59
- package/dist/vercel-analytics.js +2 -0
- package/dist/x-pixel.js +2 -0
- package/dist-types/adobe-analytics.d.ts +2 -0
- package/dist-types/ahrefs-analytics.d.ts +2 -0
- package/dist-types/amplitude.d.ts +2 -0
- package/dist-types/clearbit.d.ts +2 -0
- package/dist-types/cloudflare-web-analytics.d.ts +2 -0
- package/dist-types/cloudflare-zaraz.d.ts +2 -0
- package/dist-types/crisp.d.ts +2 -0
- package/dist-types/databuddy.d.ts +2 -0
- package/dist-types/e2e-test-utils.d.ts +2 -0
- package/dist-types/engine/compile.d.ts +2 -3
- package/dist-types/engine/runtime.d.ts +2 -3
- package/dist-types/events.d.ts +2 -0
- package/dist-types/fathom-analytics.d.ts +2 -0
- package/dist-types/front-chat.d.ts +2 -0
- package/dist-types/google-tag-manager.d.ts +2 -0
- package/dist-types/google-tag.d.ts +2 -0
- package/dist-types/heap.d.ts +2 -0
- package/dist-types/hightouch.d.ts +2 -0
- package/dist-types/hotjar.d.ts +2 -0
- package/dist-types/intercom.d.ts +2 -0
- package/dist-types/klaviyo.d.ts +2 -0
- package/dist-types/linkedin-insights.d.ts +2 -0
- package/dist-types/logrocket.d.ts +2 -0
- package/dist-types/matomo-analytics.d.ts +2 -0
- package/dist-types/meta-pixel.d.ts +2 -0
- package/dist-types/microsoft-clarity.d.ts +2 -0
- package/dist-types/microsoft-uet.d.ts +2 -0
- package/dist-types/mixpanel-analytics.d.ts +2 -0
- package/dist-types/one-dollar-stats.d.ts +2 -0
- package/dist-types/openai-pixel.d.ts +2 -0
- package/dist-types/pinterest-tag.d.ts +2 -0
- package/dist-types/pirsch.d.ts +2 -0
- package/dist-types/plausible-analytics.d.ts +2 -0
- package/dist-types/posthog.d.ts +2 -0
- package/dist-types/promptwatch.d.ts +2 -0
- package/dist-types/reddit-pixel.d.ts +2 -0
- package/dist-types/registry.d.ts +2 -458
- package/dist-types/resolve.d.ts +2 -9
- package/dist-types/rudderstack.d.ts +2 -0
- package/dist-types/rybbit-analytics.d.ts +2 -0
- package/dist-types/segment.d.ts +2 -0
- package/dist-types/snapchat-pixel.d.ts +2 -0
- package/dist-types/tiktok-pixel.d.ts +2 -0
- package/dist-types/types.d.ts +2 -314
- package/dist-types/umami-analytics.d.ts +2 -0
- package/dist-types/vendors/_shared/attributes.d.ts +2 -35
- package/dist-types/vendors/_shared/google-consent.d.ts +2 -47
- package/dist-types/vendors/_shared/install-builders.d.ts +2 -30
- package/dist-types/vendors/_shared/required-id.d.ts +2 -0
- package/dist-types/vendors/_shared/script-url.d.ts +2 -75
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +2 -92
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +2 -289
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +2 -105
- package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +2 -211
- package/dist-types/vendors/ads-and-pixels/pinterest-tag.d.ts +2 -0
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +2 -210
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +2 -171
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +2 -106
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +2 -183
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +2 -75
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +2 -62
- package/dist-types/vendors/analytics/amplitude.d.ts +2 -234
- package/dist-types/vendors/analytics/clearbit.d.ts +2 -60
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +2 -67
- package/dist-types/vendors/analytics/databuddy.d.ts +2 -147
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +2 -90
- package/dist-types/vendors/analytics/google-tag.d.ts +2 -93
- package/dist-types/vendors/analytics/heap.d.ts +2 -316
- package/dist-types/vendors/analytics/hightouch.d.ts +2 -285
- package/dist-types/vendors/analytics/hotjar.d.ts +2 -73
- package/dist-types/vendors/analytics/logrocket.d.ts +2 -101
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +2 -41
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +2 -97
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +2 -113
- package/dist-types/vendors/analytics/one-dollar-stats.d.ts +2 -0
- package/dist-types/vendors/analytics/pirsch.d.ts +2 -96
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +2 -122
- package/dist-types/vendors/analytics/posthog.d.ts +2 -175
- package/dist-types/vendors/analytics/promptwatch.d.ts +2 -36
- package/dist-types/vendors/analytics/rudderstack.d.ts +2 -330
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +2 -82
- package/dist-types/vendors/analytics/segment.d.ts +2 -158
- package/dist-types/vendors/analytics/umami-analytics.d.ts +2 -93
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +2 -66
- package/dist-types/vendors/email-and-sms/klaviyo.d.ts +2 -0
- package/dist-types/vendors/functional/crisp.d.ts +2 -78
- package/dist-types/vendors/functional/front-chat.d.ts +2 -0
- package/dist-types/vendors/functional/intercom.d.ts +2 -135
- package/dist-types/vendors/tag-managers/cloudflare-zaraz.d.ts +2 -39
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +2 -94
- package/dist-types/vercel-analytics.d.ts +2 -0
- package/dist-types/x-pixel.d.ts +2 -0
- package/docs/README.md +129 -59
- package/docs/assets/v3/bottom-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/brand-preferences.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/headless-bar-html.png +0 -0
- package/docs/assets/v3/headless-bar-mobile.png +0 -0
- package/docs/assets/v3/headless-bar.png +0 -0
- package/docs/assets/v3/slim-bar.png +0 -0
- package/docs/concepts/choose-your-setup.md +87 -0
- package/docs/concepts/consent-categories.md +84 -0
- package/docs/concepts/consent-state.md +357 -0
- package/docs/{guides → concepts}/data-fetching.md +31 -27
- package/docs/concepts/how-consent-works.md +123 -0
- package/docs/concepts/policies.md +71 -0
- package/docs/customization/class-names.md +202 -0
- package/docs/customization/dark-mode.md +157 -0
- package/docs/customization/motion.md +119 -0
- package/docs/customization/overview.md +67 -33
- package/docs/customization/recipes.md +839 -47
- package/docs/customization/slots.md +216 -35
- package/docs/customization/stylesheets.md +147 -0
- package/docs/customization/tailwind.md +842 -0
- package/docs/customization/tokens.md +166 -36
- package/docs/customization/translations.md +61 -3
- package/docs/frameworks/astro/embeds.md +160 -0
- package/docs/frameworks/astro/network-blocker.md +86 -0
- package/docs/frameworks/astro/scripts.md +146 -0
- package/docs/frameworks/html/embeds.md +142 -0
- package/docs/frameworks/html/network-blocker.md +105 -0
- package/docs/frameworks/html/scripts.md +164 -0
- package/docs/frameworks/javascript/scripts.md +119 -0
- package/docs/frameworks/next/embeds.md +90 -0
- package/docs/frameworks/next/network-blocker.md +153 -0
- package/docs/frameworks/next/scripts.md +196 -0
- package/docs/frameworks/nuxt/embeds.md +81 -0
- package/docs/frameworks/nuxt/network-blocker.md +97 -0
- package/docs/frameworks/nuxt/scripts.md +89 -0
- package/docs/frameworks/react/embeds.md +89 -0
- package/docs/frameworks/react/network-blocker.md +140 -0
- package/docs/frameworks/react/scripts.md +115 -0
- package/docs/frameworks/svelte/embeds.md +96 -0
- package/docs/frameworks/svelte/network-blocker.md +141 -0
- package/docs/frameworks/svelte/scripts.md +137 -0
- package/docs/frameworks/sveltekit/embeds.md +103 -0
- package/docs/frameworks/sveltekit/network-blocker.md +149 -0
- package/docs/frameworks/sveltekit/scripts.md +141 -0
- package/docs/frameworks/tanstack-start/embeds.md +96 -0
- package/docs/frameworks/tanstack-start/network-blocker.md +145 -0
- package/docs/frameworks/tanstack-start/scripts.md +103 -0
- package/docs/frameworks/vue/embeds.md +84 -0
- package/docs/frameworks/vue/network-blocker.md +99 -0
- package/docs/frameworks/vue/scripts.md +93 -0
- package/docs/guides/banner-experiments.md +654 -0
- package/docs/guides/troubleshooting.md +120 -47
- package/docs/guides/verify-consent.md +81 -49
- package/docs/integrations/adobe-analytics.md +168 -160
- package/docs/integrations/ahrefs-analytics.md +153 -155
- package/docs/integrations/amplitude.md +163 -157
- package/docs/integrations/building-integrations.md +136 -37
- package/docs/integrations/clearbit.md +155 -155
- package/docs/integrations/cloudflare-web-analytics.md +157 -157
- package/docs/integrations/cloudflare-zaraz.md +210 -262
- package/docs/integrations/crisp.md +165 -159
- package/docs/integrations/databuddy.md +158 -174
- package/docs/integrations/fathom-analytics.md +159 -157
- package/docs/integrations/front-chat.md +322 -0
- package/docs/integrations/google-maps.md +119 -84
- package/docs/integrations/google-tag-manager.md +179 -164
- package/docs/integrations/google-tag.md +164 -161
- package/docs/integrations/heap.md +164 -156
- package/docs/integrations/hightouch.md +162 -158
- package/docs/integrations/hotjar.md +160 -156
- package/docs/integrations/intercom.md +184 -154
- package/docs/integrations/klaviyo.md +486 -0
- package/docs/integrations/linkedin-insights.md +175 -151
- package/docs/integrations/logrocket.md +161 -157
- package/docs/integrations/matomo-analytics.md +189 -179
- package/docs/integrations/meta-pixel.md +189 -151
- package/docs/integrations/microsoft-clarity.md +164 -156
- package/docs/integrations/microsoft-uet.md +149 -155
- package/docs/integrations/mixpanel-analytics.md +156 -161
- package/docs/integrations/one-dollar-stats.md +306 -0
- package/docs/integrations/openai-pixel.md +205 -302
- package/docs/integrations/overview.md +143 -83
- package/docs/integrations/pinterest-tag.md +329 -0
- package/docs/integrations/pirsch.md +170 -160
- package/docs/integrations/plausible-analytics.md +173 -159
- package/docs/integrations/posthog.md +227 -242
- package/docs/integrations/promptwatch.md +155 -155
- package/docs/integrations/reddit-pixel.md +186 -158
- package/docs/integrations/rudderstack.md +202 -187
- package/docs/integrations/rybbit-analytics.md +172 -161
- package/docs/integrations/segment.md +183 -155
- package/docs/integrations/snapchat-pixel.md +187 -157
- package/docs/integrations/tiktok-pixel.md +172 -151
- package/docs/integrations/umami-analytics.md +164 -159
- package/docs/integrations/vercel-analytics.md +167 -158
- package/docs/integrations/x-pixel.md +177 -151
- package/docs/integrations/youtube.md +122 -87
- package/docs/upgrade-v3.md +490 -354
- package/package.json +12 -236
- package/dist-types/__tests__/helpers.d.ts +0 -141
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/frameworks/javascript/script-loader.md +0 -94
- package/docs/frameworks/next/script-loader.md +0 -210
- package/docs/frameworks/react/script-loader.md +0 -63
- package/docs/guides/consent-state.md +0 -60
- package/docs/guides/deployment-modes.md +0 -75
- package/docs/integrations/clear-on-revocation.md +0 -167
- package/docs/integrations/granular-consent.md +0 -208
|
@@ -1,109 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
|
|
4
|
-
const DEFAULT_HIGHTOUCH_SCRIPT_URL = 'https://cdn.hightouch-events.com/browser/release/v1-latest/events.min.js';
|
|
5
|
-
const HIGHTOUCH_QUEUE_METHODS = [
|
|
6
|
-
'trackSubmit',
|
|
7
|
-
'trackClick',
|
|
8
|
-
'trackLink',
|
|
9
|
-
'trackForm',
|
|
10
|
-
'pageview',
|
|
11
|
-
'identify',
|
|
12
|
-
'reset',
|
|
13
|
-
'group',
|
|
14
|
-
'track',
|
|
15
|
-
'ready',
|
|
16
|
-
'alias',
|
|
17
|
-
'debug',
|
|
18
|
-
'page',
|
|
19
|
-
'once',
|
|
20
|
-
'off',
|
|
21
|
-
'on',
|
|
22
|
-
'addSourceMiddleware',
|
|
23
|
-
'addIntegrationMiddleware',
|
|
24
|
-
'setAnonymousId',
|
|
25
|
-
'addDestinationMiddleware',
|
|
26
|
-
'load'
|
|
27
|
-
];
|
|
28
|
-
const hightouchManifest = {
|
|
29
|
-
...vendorManifestContract,
|
|
30
|
-
bootstrap: [
|
|
31
|
-
{
|
|
32
|
-
ifUndefined: true,
|
|
33
|
-
name: 'htevents',
|
|
34
|
-
type: 'setGlobal',
|
|
35
|
-
value: []
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
methods: [
|
|
39
|
-
...HIGHTOUCH_QUEUE_METHODS
|
|
40
|
-
],
|
|
41
|
-
target: 'htevents',
|
|
42
|
-
type: 'defineQueueMethods'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
path: [
|
|
46
|
-
'htevents',
|
|
47
|
-
'_writeKey'
|
|
48
|
-
],
|
|
49
|
-
type: 'setGlobalPath',
|
|
50
|
-
value: '{{writeKey}}'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
path: [
|
|
54
|
-
'htevents',
|
|
55
|
-
'_loadOptions'
|
|
56
|
-
],
|
|
57
|
-
type: 'setGlobalPath',
|
|
58
|
-
value: '{{loadOptions}}'
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
category: 'measurement',
|
|
62
|
-
install: [
|
|
63
|
-
{
|
|
64
|
-
args: [
|
|
65
|
-
'{{writeKey}}',
|
|
66
|
-
'{{loadOptions}}'
|
|
67
|
-
],
|
|
68
|
-
global: 'htevents',
|
|
69
|
-
method: 'load',
|
|
70
|
-
type: 'callGlobal'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
global: 'htevents',
|
|
74
|
-
method: 'page',
|
|
75
|
-
type: 'callGlobal'
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
async: true,
|
|
79
|
-
src: "{{scriptUrl}}",
|
|
80
|
-
type: 'loadScript'
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
vendor: 'hightouch'
|
|
84
|
-
};
|
|
85
|
-
const hightouch_validateWriteKey = function(writeKey) {
|
|
86
|
-
const normalized = 'string' == typeof writeKey ? writeKey.trim() : '';
|
|
87
|
-
if (0 === normalized.length) throw new Error('hightouch: missing or invalid writeKey');
|
|
88
|
-
return normalized;
|
|
89
|
-
};
|
|
90
|
-
const hightouch_normalizeApiHost = function(apiHost) {
|
|
91
|
-
return trimToUndefined(apiHost);
|
|
92
|
-
};
|
|
93
|
-
const hightouch_hightouch = function({ writeKey, apiHost, trackPageView = true, scriptUrl }) {
|
|
94
|
-
const normalizedWriteKey = hightouch_validateWriteKey(writeKey);
|
|
95
|
-
const loadOptions = {
|
|
96
|
-
apiHost: hightouch_normalizeApiHost(apiHost)
|
|
97
|
-
};
|
|
98
|
-
let manifest = hightouchManifest;
|
|
99
|
-
if (!trackPageView) manifest = {
|
|
100
|
-
...hightouchManifest,
|
|
101
|
-
install: hightouchManifest.install.filter((step)=>!('callGlobal' === step.type && 'htevents' === step.global && 'page' === step.method))
|
|
102
|
-
};
|
|
103
|
-
return resolveManifest(manifest, {
|
|
104
|
-
loadOptions,
|
|
105
|
-
scriptUrl: resolveScriptUrl(trimToUndefined(scriptUrl), DEFAULT_HIGHTOUCH_SCRIPT_URL),
|
|
106
|
-
writeKey: normalizedWriteKey
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
export { HIGHTOUCH_QUEUE_METHODS, hightouchManifest, hightouch_hightouch as hightouch };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/hightouch. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/hightouch';
|
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { resolveScriptUrl } from "../_shared/script-url.js";
|
|
4
|
-
const hotjarManifest = {
|
|
5
|
-
...vendorManifestContract,
|
|
6
|
-
category: 'measurement',
|
|
7
|
-
install: [
|
|
8
|
-
{
|
|
9
|
-
ifUndefined: true,
|
|
10
|
-
name: '_hjSettings',
|
|
11
|
-
type: 'setGlobal',
|
|
12
|
-
value: {
|
|
13
|
-
hjid: '{{siteId}}',
|
|
14
|
-
hjsv: '{{version}}'
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
ifUndefined: true,
|
|
19
|
-
name: 'hj',
|
|
20
|
-
queue: {
|
|
21
|
-
property: 'q'
|
|
22
|
-
},
|
|
23
|
-
queueFormat: 'array',
|
|
24
|
-
type: 'defineStubFunction'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
async: true,
|
|
28
|
-
src: "{{scriptUrl}}",
|
|
29
|
-
type: 'loadScript'
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
vendor: 'hotjar'
|
|
33
|
-
};
|
|
34
|
-
const hotjar_hotjar = function({ siteId, version = 6, scriptUrl }) {
|
|
35
|
-
if (null == siteId) throw new Error('hotjar: missing or invalid siteId');
|
|
36
|
-
const normalizedSiteId = String(siteId).trim();
|
|
37
|
-
if (0 === normalizedSiteId.length || '0' === normalizedSiteId) throw new Error('hotjar: missing or invalid siteId');
|
|
38
|
-
return resolveManifest(hotjarManifest, {
|
|
39
|
-
scriptUrl: resolveScriptUrl(scriptUrl, `https://static.hotjar.com/c/hotjar-${normalizedSiteId}.js?sv=${version}`),
|
|
40
|
-
siteId: normalizedSiteId,
|
|
41
|
-
version
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
export { hotjarManifest, hotjar_hotjar as hotjar };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/hotjar. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/hotjar';
|
|
@@ -1,58 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
|
|
4
|
-
const DEFAULT_LOGROCKET_SCRIPT_URL = 'https://cdn.logrocket.io/LogRocket.min.js';
|
|
5
|
-
const logrocket_validateLogRocketAppId = function(appId) {
|
|
6
|
-
const normalized = 'string' == typeof appId ? appId.trim() : '';
|
|
7
|
-
const segments = normalized.split('/');
|
|
8
|
-
if (2 !== segments.length || segments.some((segment)=>0 === segment.length)) throw new Error("logRocket: invalid appId - must be a non-empty string in 'org/app' format");
|
|
9
|
-
return normalized;
|
|
10
|
-
};
|
|
11
|
-
const logRocketManifest = {
|
|
12
|
-
...vendorManifestContract,
|
|
13
|
-
afterLoad: [
|
|
14
|
-
{
|
|
15
|
-
args: [
|
|
16
|
-
'{{appId}}',
|
|
17
|
-
'{{initOptions}}'
|
|
18
|
-
],
|
|
19
|
-
global: 'LogRocket',
|
|
20
|
-
method: 'init',
|
|
21
|
-
type: 'callGlobal'
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
category: 'measurement',
|
|
25
|
-
install: [
|
|
26
|
-
{
|
|
27
|
-
attributes: {
|
|
28
|
-
crossorigin: 'anonymous'
|
|
29
|
-
},
|
|
30
|
-
src: "{{scriptUrl}}",
|
|
31
|
-
type: 'loadScript'
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
vendor: 'logrocket'
|
|
35
|
-
};
|
|
36
|
-
const logrocket_logRocket = function(options) {
|
|
37
|
-
const appId = logrocket_validateLogRocketAppId(options?.appId);
|
|
38
|
-
const asyncScriptUrl = trimToUndefined(options.asyncScriptUrl);
|
|
39
|
-
let manifest = logRocketManifest;
|
|
40
|
-
if (asyncScriptUrl) manifest = {
|
|
41
|
-
...logRocketManifest,
|
|
42
|
-
bootstrap: [
|
|
43
|
-
{
|
|
44
|
-
ifUndefined: false,
|
|
45
|
-
name: '_lrAsyncScript',
|
|
46
|
-
type: 'setGlobal',
|
|
47
|
-
value: '{{asyncScriptUrl}}'
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
};
|
|
51
|
-
return resolveManifest(manifest, {
|
|
52
|
-
appId,
|
|
53
|
-
asyncScriptUrl,
|
|
54
|
-
initOptions: options.initOptions ?? {},
|
|
55
|
-
scriptUrl: resolveScriptUrl(trimToUndefined(options.scriptUrl), DEFAULT_LOGROCKET_SCRIPT_URL)
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
export { logRocketManifest, logrocket_logRocket as logRocket };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/logrocket. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/logrocket';
|
|
@@ -1,191 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { joinUrlPath, stripTrailingSlashes } from "../_shared/script-url.js";
|
|
4
|
-
const matomo_analytics_stripProtocol = function(value) {
|
|
5
|
-
if (value.startsWith('https://')) return value.slice(8);
|
|
6
|
-
if (value.startsWith('http://')) return value.slice(7);
|
|
7
|
-
return value;
|
|
8
|
-
};
|
|
9
|
-
const matomo_analytics_resolveMatomoOrigin = function(options) {
|
|
10
|
-
if (options.matomoUrl) return stripTrailingSlashes(options.matomoUrl);
|
|
11
|
-
if (options.cloudId) {
|
|
12
|
-
const cleanedCloudId = stripTrailingSlashes(matomo_analytics_stripProtocol(options.cloudId));
|
|
13
|
-
if (cleanedCloudId.endsWith('.matomo.cloud')) return `https://${cleanedCloudId}`;
|
|
14
|
-
return `https://cdn.matomo.cloud/${cleanedCloudId}`;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const matomo_analytics_buildInstallSteps = function(options) {
|
|
18
|
-
const install = [
|
|
19
|
-
{
|
|
20
|
-
ifUndefined: true,
|
|
21
|
-
name: '_paq',
|
|
22
|
-
type: 'setGlobal',
|
|
23
|
-
value: []
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
queue: '_paq',
|
|
27
|
-
type: 'pushToQueue',
|
|
28
|
-
value: [
|
|
29
|
-
'setTrackerUrl',
|
|
30
|
-
'{{trackerUrl}}'
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
queue: '_paq',
|
|
35
|
-
type: 'pushToQueue',
|
|
36
|
-
value: [
|
|
37
|
-
'setSiteId',
|
|
38
|
-
'{{siteId}}'
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
if (options.enableLinkTracking) install.push({
|
|
43
|
-
queue: '_paq',
|
|
44
|
-
type: 'pushToQueue',
|
|
45
|
-
value: [
|
|
46
|
-
'enableLinkTracking'
|
|
47
|
-
]
|
|
48
|
-
});
|
|
49
|
-
if (options.disableCookies) install.push({
|
|
50
|
-
queue: '_paq',
|
|
51
|
-
type: 'pushToQueue',
|
|
52
|
-
value: [
|
|
53
|
-
'disableCookies'
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
if (options.enableConsentMode && !options.consentInitiallyGiven) install.push({
|
|
57
|
-
queue: '_paq',
|
|
58
|
-
type: 'pushToQueue',
|
|
59
|
-
value: [
|
|
60
|
-
'requireConsent'
|
|
61
|
-
]
|
|
62
|
-
});
|
|
63
|
-
if (options.enableConsentMode && options.consentInitiallyGiven) {
|
|
64
|
-
install.push({
|
|
65
|
-
queue: '_paq',
|
|
66
|
-
type: 'pushToQueue',
|
|
67
|
-
value: [
|
|
68
|
-
'setConsentGiven'
|
|
69
|
-
]
|
|
70
|
-
});
|
|
71
|
-
if (options.trackPageView) install.push({
|
|
72
|
-
queue: '_paq',
|
|
73
|
-
type: 'pushToQueue',
|
|
74
|
-
value: [
|
|
75
|
-
'trackPageView'
|
|
76
|
-
]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (options.trackPageView && !options.enableConsentMode) install.push({
|
|
80
|
-
queue: '_paq',
|
|
81
|
-
type: 'pushToQueue',
|
|
82
|
-
value: [
|
|
83
|
-
'trackPageView'
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
install.push({
|
|
87
|
-
async: true,
|
|
88
|
-
src: "{{scriptUrl}}",
|
|
89
|
-
type: 'loadScript'
|
|
90
|
-
});
|
|
91
|
-
return install;
|
|
92
|
-
};
|
|
93
|
-
const matomo_analytics_buildGrantedHooks = function(options) {
|
|
94
|
-
const onBeforeLoadGranted = [];
|
|
95
|
-
if (options.enableConsentMode && !options.consentInitiallyGiven) onBeforeLoadGranted.push({
|
|
96
|
-
queue: '_paq',
|
|
97
|
-
type: 'pushToQueue',
|
|
98
|
-
value: [
|
|
99
|
-
'setConsentGiven'
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
if (options.trackPageView && options.enableConsentMode && !options.consentInitiallyGiven) onBeforeLoadGranted.push({
|
|
103
|
-
queue: '_paq',
|
|
104
|
-
type: 'pushToQueue',
|
|
105
|
-
value: [
|
|
106
|
-
'trackPageView'
|
|
107
|
-
]
|
|
108
|
-
});
|
|
109
|
-
const onConsentGranted = [];
|
|
110
|
-
if (options.enableConsentMode) {
|
|
111
|
-
onConsentGranted.push({
|
|
112
|
-
queue: '_paq',
|
|
113
|
-
type: 'pushToQueue',
|
|
114
|
-
value: [
|
|
115
|
-
'setConsentGiven'
|
|
116
|
-
]
|
|
117
|
-
});
|
|
118
|
-
if (options.trackPageView) onConsentGranted.push({
|
|
119
|
-
queue: '_paq',
|
|
120
|
-
type: 'pushToQueue',
|
|
121
|
-
value: [
|
|
122
|
-
'trackPageView'
|
|
123
|
-
]
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
onBeforeLoadGranted,
|
|
128
|
-
onConsentGranted
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
const matomo_analytics_buildDeniedHooks = function(options) {
|
|
132
|
-
const onConsentDenied = [];
|
|
133
|
-
if (options.enableConsentMode) onConsentDenied.push({
|
|
134
|
-
queue: '_paq',
|
|
135
|
-
type: 'pushToQueue',
|
|
136
|
-
value: [
|
|
137
|
-
'forgetConsentGiven'
|
|
138
|
-
]
|
|
139
|
-
});
|
|
140
|
-
return onConsentDenied;
|
|
141
|
-
};
|
|
142
|
-
const matomo_analytics_createMatomoAnalyticsManifest = function(options) {
|
|
143
|
-
const { onBeforeLoadGranted, onConsentGranted } = matomo_analytics_buildGrantedHooks(options);
|
|
144
|
-
let alwaysLoad;
|
|
145
|
-
let persistAfterConsentRevoked;
|
|
146
|
-
if (options.enableConsentMode) {
|
|
147
|
-
alwaysLoad = true;
|
|
148
|
-
persistAfterConsentRevoked = true;
|
|
149
|
-
}
|
|
150
|
-
return {
|
|
151
|
-
...vendorManifestContract,
|
|
152
|
-
alwaysLoad,
|
|
153
|
-
category: 'measurement',
|
|
154
|
-
install: matomo_analytics_buildInstallSteps(options),
|
|
155
|
-
onBeforeLoadGranted,
|
|
156
|
-
onConsentDenied: matomo_analytics_buildDeniedHooks(options),
|
|
157
|
-
onConsentGranted,
|
|
158
|
-
persistAfterConsentRevoked,
|
|
159
|
-
vendor: 'matomo-analytics'
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
const matomoAnalyticsManifest = matomo_analytics_createMatomoAnalyticsManifest({
|
|
163
|
-
consentInitiallyGiven: false,
|
|
164
|
-
disableCookies: false,
|
|
165
|
-
enableConsentMode: false,
|
|
166
|
-
enableLinkTracking: false,
|
|
167
|
-
trackPageView: true
|
|
168
|
-
});
|
|
169
|
-
const matomo_analytics_matomoAnalytics = function(options = {}) {
|
|
170
|
-
const origin = matomo_analytics_resolveMatomoOrigin(options);
|
|
171
|
-
let { trackerUrl } = options;
|
|
172
|
-
if (!trackerUrl && origin) trackerUrl = joinUrlPath(origin, 'matomo.php');
|
|
173
|
-
let { scriptUrl } = options;
|
|
174
|
-
if (!scriptUrl && origin) scriptUrl = joinUrlPath(origin, 'matomo.js');
|
|
175
|
-
if (!trackerUrl || !scriptUrl) throw new Error("matomoAnalytics requires `matomoUrl`, `cloudId`, or explicit `trackerUrl` and `scriptUrl` values.");
|
|
176
|
-
const enableConsentMode = 'required' === options.defaultConsent || 'given' === options.defaultConsent;
|
|
177
|
-
const consentInitiallyGiven = 'given' === options.defaultConsent;
|
|
178
|
-
const manifest = matomo_analytics_createMatomoAnalyticsManifest({
|
|
179
|
-
consentInitiallyGiven,
|
|
180
|
-
disableCookies: options.disableCookies ?? false,
|
|
181
|
-
enableConsentMode,
|
|
182
|
-
enableLinkTracking: options.enableLinkTracking ?? false,
|
|
183
|
-
trackPageView: options.trackPageView ?? true
|
|
184
|
-
});
|
|
185
|
-
return resolveManifest(manifest, {
|
|
186
|
-
scriptUrl,
|
|
187
|
-
siteId: String(options.siteId ?? 1),
|
|
188
|
-
trackerUrl
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
export { matomoAnalyticsManifest, matomo_analytics_matomoAnalytics as matomoAnalytics };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/matomo-analytics. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/matomo-analytics';
|
|
@@ -1,100 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const microsoft_clarity_toClarityConsentState = function(value) {
|
|
4
|
-
if (true === value) return 'granted';
|
|
5
|
-
if (false === value) return 'denied';
|
|
6
|
-
if ('string' != typeof value) return;
|
|
7
|
-
const normalized = value.toLowerCase();
|
|
8
|
-
if ('granted' === normalized || 'true' === normalized) return 'granted';
|
|
9
|
-
if ('denied' === normalized || 'false' === normalized) return 'denied';
|
|
10
|
-
};
|
|
11
|
-
const microsoft_clarity_getConsentValue = function(value, keys) {
|
|
12
|
-
for (const key of keys){
|
|
13
|
-
const consent = microsoft_clarity_toClarityConsentState(value[key]);
|
|
14
|
-
if (consent) return consent;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const microsoft_clarity_getConsentPayloadFromState = function(consents) {
|
|
18
|
-
let adStorage;
|
|
19
|
-
adStorage = consents.marketing ? 'granted' : 'denied';
|
|
20
|
-
let analyticsStorage;
|
|
21
|
-
analyticsStorage = consents.measurement ? 'granted' : 'denied';
|
|
22
|
-
return {
|
|
23
|
-
ad_Storage: adStorage,
|
|
24
|
-
analytics_Storage: analyticsStorage
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
const microsoft_clarity_getClarityConsentPayload = function(consents, defaultConsent) {
|
|
28
|
-
const fallback = microsoft_clarity_getConsentPayloadFromState(consents);
|
|
29
|
-
if (void 0 === defaultConsent) return fallback;
|
|
30
|
-
const booleanConsent = microsoft_clarity_toClarityConsentState(defaultConsent);
|
|
31
|
-
if (booleanConsent) return {
|
|
32
|
-
ad_Storage: booleanConsent,
|
|
33
|
-
analytics_Storage: booleanConsent
|
|
34
|
-
};
|
|
35
|
-
if (null !== defaultConsent && 'object' == typeof defaultConsent) return {
|
|
36
|
-
ad_Storage: microsoft_clarity_getConsentValue(defaultConsent, [
|
|
37
|
-
'ad_Storage',
|
|
38
|
-
'ad_storage',
|
|
39
|
-
'marketing'
|
|
40
|
-
]) ?? fallback.ad_Storage,
|
|
41
|
-
analytics_Storage: microsoft_clarity_getConsentValue(defaultConsent, [
|
|
42
|
-
'analytics_Storage',
|
|
43
|
-
'analytics_storage',
|
|
44
|
-
'measurement',
|
|
45
|
-
'analytics'
|
|
46
|
-
]) ?? fallback.analytics_Storage
|
|
47
|
-
};
|
|
48
|
-
return fallback;
|
|
49
|
-
};
|
|
50
|
-
const microsoft_clarity_syncClarityConsent = function(info, defaultConsent) {
|
|
51
|
-
window.clarity?.('consentv2', info.vendor?.granted === false ? {
|
|
52
|
-
ad_Storage: 'denied',
|
|
53
|
-
analytics_Storage: 'denied'
|
|
54
|
-
} : microsoft_clarity_getClarityConsentPayload(info.consents, defaultConsent));
|
|
55
|
-
};
|
|
56
|
-
const clarityManifest = {
|
|
57
|
-
...vendorManifestContract,
|
|
58
|
-
bootstrap: [
|
|
59
|
-
{
|
|
60
|
-
ifUndefined: true,
|
|
61
|
-
name: 'clarity',
|
|
62
|
-
queue: {
|
|
63
|
-
property: 'q'
|
|
64
|
-
},
|
|
65
|
-
queueFormat: 'array',
|
|
66
|
-
type: 'defineStubFunction'
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
category: 'measurement',
|
|
70
|
-
install: [
|
|
71
|
-
{
|
|
72
|
-
async: true,
|
|
73
|
-
src: "{{scriptUrl}}",
|
|
74
|
-
type: 'loadScript'
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
persistAfterConsentRevoked: true,
|
|
78
|
-
vendor: 'microsoft-clarity'
|
|
79
|
-
};
|
|
80
|
-
const microsoft_clarity_clarity = function({ id, defaultConsent, scriptUrl }) {
|
|
81
|
-
const normalizedId = id.trim();
|
|
82
|
-
if (void 0 === scriptUrl && 0 === normalizedId.length) throw new Error(`Invalid Clarity id value "${id}". A non-empty id is required to construct the Clarity loader URL when scriptUrl is not provided.`);
|
|
83
|
-
const resolved = resolveManifest(clarityManifest, {
|
|
84
|
-
scriptUrl: scriptUrl ?? `https://www.clarity.ms/tag/${normalizedId}`
|
|
85
|
-
});
|
|
86
|
-
const { onBeforeLoad } = resolved;
|
|
87
|
-
const { onConsentChange } = resolved;
|
|
88
|
-
return {
|
|
89
|
-
...resolved,
|
|
90
|
-
onBeforeLoad: (info)=>{
|
|
91
|
-
onBeforeLoad?.(info);
|
|
92
|
-
microsoft_clarity_syncClarityConsent(info, defaultConsent);
|
|
93
|
-
},
|
|
94
|
-
onConsentChange: (info)=>{
|
|
95
|
-
onConsentChange?.(info);
|
|
96
|
-
microsoft_clarity_syncClarityConsent(info);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
export { clarityManifest, microsoft_clarity_clarity as clarity };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/microsoft-clarity. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/microsoft-clarity';
|
|
@@ -1,93 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const mixpanelAnalyticsManifest = {
|
|
4
|
-
...vendorManifestContract,
|
|
5
|
-
alwaysLoad: true,
|
|
6
|
-
category: 'measurement',
|
|
7
|
-
install: [
|
|
8
|
-
{
|
|
9
|
-
ifUndefined: true,
|
|
10
|
-
name: 'mixpanel',
|
|
11
|
-
type: 'setGlobal',
|
|
12
|
-
value: []
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
path: [
|
|
16
|
-
'mixpanel',
|
|
17
|
-
'__SV'
|
|
18
|
-
],
|
|
19
|
-
type: 'setGlobalPath',
|
|
20
|
-
value: 1.2
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
path: [
|
|
24
|
-
'mixpanel',
|
|
25
|
-
'_i'
|
|
26
|
-
],
|
|
27
|
-
type: 'setGlobalPath',
|
|
28
|
-
value: [
|
|
29
|
-
[
|
|
30
|
-
'{{token}}',
|
|
31
|
-
'{{initOptions}}',
|
|
32
|
-
'mixpanel'
|
|
33
|
-
]
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
methods: [
|
|
38
|
-
'track',
|
|
39
|
-
'identify',
|
|
40
|
-
'reset',
|
|
41
|
-
'register',
|
|
42
|
-
'opt_in_tracking',
|
|
43
|
-
'opt_out_tracking'
|
|
44
|
-
],
|
|
45
|
-
target: 'mixpanel',
|
|
46
|
-
type: 'defineQueueMethods'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
async: true,
|
|
50
|
-
src: "{{scriptUrl}}",
|
|
51
|
-
type: 'loadScript'
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
onConsentDenied: [
|
|
55
|
-
{
|
|
56
|
-
global: 'mixpanel',
|
|
57
|
-
method: 'opt_out_tracking',
|
|
58
|
-
type: 'callGlobal'
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
onConsentGranted: [
|
|
62
|
-
{
|
|
63
|
-
global: 'mixpanel',
|
|
64
|
-
method: 'opt_in_tracking',
|
|
65
|
-
type: 'callGlobal'
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
onLoadDenied: [
|
|
69
|
-
{
|
|
70
|
-
global: 'mixpanel',
|
|
71
|
-
method: 'opt_out_tracking',
|
|
72
|
-
type: 'callGlobal'
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
onLoadGranted: [
|
|
76
|
-
{
|
|
77
|
-
global: 'mixpanel',
|
|
78
|
-
method: 'opt_in_tracking',
|
|
79
|
-
type: 'callGlobal'
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
vendor: 'mixpanel-analytics'
|
|
83
|
-
};
|
|
84
|
-
const mixpanel_analytics_mixpanelAnalytics = function({ token, initOptions, scriptUrl }) {
|
|
85
|
-
const normalizedToken = token.trim();
|
|
86
|
-
if (!/^[a-f0-9]{32}$/iu.test(normalizedToken)) throw new Error("mixpanelAnalytics: token must be a non-empty 32-character hexadecimal string");
|
|
87
|
-
return resolveManifest(mixpanelAnalyticsManifest, {
|
|
88
|
-
initOptions: initOptions ?? {},
|
|
89
|
-
scriptUrl: scriptUrl ?? 'https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js',
|
|
90
|
-
token: normalizedToken
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
export { mixpanelAnalyticsManifest, mixpanel_analytics_mixpanelAnalytics as mixpanelAnalytics };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/mixpanel-analytics. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/mixpanel-analytics';
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
|
|
4
|
-
const DEFAULT_PIRSCH_SCRIPT_URL = 'https://api.pirsch.io/pa.js';
|
|
5
|
-
const DEFAULT_PIRSCH_EXTENDED_SCRIPT_URL = 'https://api.pirsch.io/pirsch-extended.js';
|
|
6
|
-
const pirschManifest = {
|
|
7
|
-
...vendorManifestContract,
|
|
8
|
-
category: 'measurement',
|
|
9
|
-
install: [
|
|
10
|
-
{
|
|
11
|
-
attributes: {
|
|
12
|
-
'data-code': '{{identificationCode}}',
|
|
13
|
-
'data-dev': '{{dev}}',
|
|
14
|
-
'data-disable-page-views': '{{disablePageViews}}',
|
|
15
|
-
'data-domain': '{{domain}}',
|
|
16
|
-
'data-event-endpoint': '{{eventEndpoint}}',
|
|
17
|
-
'data-hit-endpoint': '{{hitEndpoint}}',
|
|
18
|
-
id: "{{scriptElementId}}"
|
|
19
|
-
},
|
|
20
|
-
defer: true,
|
|
21
|
-
src: "{{scriptUrl}}",
|
|
22
|
-
type: 'loadScript'
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
vendor: 'pirsch'
|
|
26
|
-
};
|
|
27
|
-
const pirsch_commaListDataAttribute = function(value) {
|
|
28
|
-
if (void 0 === value) return;
|
|
29
|
-
if (Array.isArray(value)) {
|
|
30
|
-
const items = value.map((item)=>item.trim()).filter((item)=>item.length > 0);
|
|
31
|
-
if (0 === items.length) return;
|
|
32
|
-
return items.join(',');
|
|
33
|
-
}
|
|
34
|
-
return trimToUndefined(value);
|
|
35
|
-
};
|
|
36
|
-
const pirsch_presenceDataAttribute = function(value) {
|
|
37
|
-
if (true === value) return '';
|
|
38
|
-
};
|
|
39
|
-
const pirsch_getPirschScriptElementId = function(options) {
|
|
40
|
-
if (true === options.extended) return 'pirschextendedjs';
|
|
41
|
-
return 'pianjs';
|
|
42
|
-
};
|
|
43
|
-
const pirsch_getPirschScriptUrl = function(options) {
|
|
44
|
-
const defaultScriptUrl = true === options.extended ? DEFAULT_PIRSCH_EXTENDED_SCRIPT_URL : DEFAULT_PIRSCH_SCRIPT_URL;
|
|
45
|
-
return resolveScriptUrl(trimToUndefined(options.scriptUrl), defaultScriptUrl);
|
|
46
|
-
};
|
|
47
|
-
const pirsch_pirsch = function(options) {
|
|
48
|
-
const identificationCode = options.identificationCode.trim();
|
|
49
|
-
if (0 === identificationCode.length) throw new Error('pirsch: invalid identificationCode - must be a non-empty string');
|
|
50
|
-
const resolved = resolveManifest(pirschManifest, {
|
|
51
|
-
dev: trimToUndefined(options.dev),
|
|
52
|
-
disablePageViews: pirsch_presenceDataAttribute(options.disablePageViews),
|
|
53
|
-
domain: pirsch_commaListDataAttribute(options.domain),
|
|
54
|
-
eventEndpoint: trimToUndefined(options.eventEndpoint),
|
|
55
|
-
hitEndpoint: trimToUndefined(options.hitEndpoint),
|
|
56
|
-
identificationCode,
|
|
57
|
-
scriptElementId: pirsch_getPirschScriptElementId(options),
|
|
58
|
-
scriptUrl: pirsch_getPirschScriptUrl(options)
|
|
59
|
-
});
|
|
60
|
-
const manifestOnLoad = resolved.onLoad;
|
|
61
|
-
resolved.onLoad = (info)=>{
|
|
62
|
-
manifestOnLoad?.(info);
|
|
63
|
-
if ('loading' !== document.readyState) window.pirschInit?.();
|
|
64
|
-
};
|
|
65
|
-
return resolved;
|
|
66
|
-
};
|
|
67
|
-
export { pirschManifest, pirsch_pirsch as pirsch };
|
|
1
|
+
/** @deprecated Use @c15t/integrations/vendors/analytics/pirsch. Compatibility ends in v4. */
|
|
2
|
+
export * from '@c15t/integrations/vendors/analytics/pirsch';
|