@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.
- package/AGENTS.md +74 -48
- package/README.md +3 -3
- package/dist/e2e-test-utils.js +60 -24
- package/dist/engine/compile.js +45 -45
- package/dist/engine/runtime.js +119 -119
- package/dist/registry.js +186 -176
- package/dist/resolve.js +12 -12
- package/dist/vendors/_shared/attributes.js +5 -5
- package/dist/vendors/_shared/google-consent.js +10 -10
- package/dist/vendors/_shared/install-builders.js +9 -9
- package/dist/vendors/_shared/script-url.js +12 -12
- package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
- package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
- package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
- package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
- package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
- package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
- package/dist/vendors/analytics/adobe-analytics.js +17 -17
- package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
- package/dist/vendors/analytics/amplitude.js +39 -39
- package/dist/vendors/analytics/clearbit.js +11 -11
- package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
- package/dist/vendors/analytics/databuddy.js +45 -45
- package/dist/vendors/analytics/fathom-analytics.js +15 -15
- package/dist/vendors/analytics/google-tag.js +23 -23
- package/dist/vendors/analytics/heap.js +37 -37
- package/dist/vendors/analytics/hightouch.js +30 -30
- package/dist/vendors/analytics/hotjar.js +14 -14
- package/dist/vendors/analytics/logrocket.js +24 -24
- package/dist/vendors/analytics/matomo-analytics.js +51 -51
- package/dist/vendors/analytics/microsoft-clarity.js +31 -31
- package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
- package/dist/vendors/analytics/pirsch.js +27 -27
- package/dist/vendors/analytics/plausible-analytics.js +24 -24
- package/dist/vendors/analytics/posthog.js +84 -79
- package/dist/vendors/analytics/promptwatch.js +8 -8
- package/dist/vendors/analytics/rudderstack.js +50 -50
- package/dist/vendors/analytics/rybbit-analytics.js +30 -30
- package/dist/vendors/analytics/segment.js +16 -16
- package/dist/vendors/analytics/umami-analytics.js +16 -16
- package/dist/vendors/analytics/vercel-analytics.js +22 -22
- package/dist/vendors/functional/crisp.js +49 -51
- package/dist/vendors/functional/intercom.js +18 -18
- package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
- package/dist-types/__tests__/helpers.d.ts +10 -10
- package/dist-types/engine/compile.d.ts +2 -2
- package/dist-types/engine/runtime.d.ts +3 -3
- package/dist-types/registry.d.ts +182 -173
- package/dist-types/resolve.d.ts +2 -2
- package/dist-types/types.d.ts +2 -2
- package/dist-types/vendors/_shared/attributes.d.ts +2 -2
- package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
- package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
- package/dist-types/vendors/_shared/script-url.d.ts +6 -6
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
- package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
- package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
- package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
- package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
- package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
- package/dist-types/vendors/analytics/heap.d.ts +17 -17
- package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
- package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
- package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
- package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
- package/dist-types/vendors/analytics/posthog.d.ts +35 -32
- package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
- package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
- package/dist-types/vendors/analytics/segment.d.ts +11 -11
- package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
- package/dist-types/vendors/functional/crisp.d.ts +9 -9
- package/dist-types/vendors/functional/intercom.d.ts +12 -12
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
- package/docs/README.md +74 -48
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/customization/overview.md +45 -0
- package/docs/customization/recipes.md +79 -0
- package/docs/customization/slots.md +55 -0
- package/docs/customization/tokens.md +76 -0
- package/docs/customization/translations.md +49 -0
- package/docs/frameworks/javascript/script-loader.md +30 -339
- package/docs/frameworks/next/script-loader.md +134 -467
- package/docs/frameworks/react/script-loader.md +35 -535
- package/docs/guides/consent-state.md +60 -0
- package/docs/guides/data-fetching.md +163 -0
- package/docs/guides/deployment-modes.md +63 -0
- package/docs/guides/troubleshooting.md +68 -0
- package/docs/guides/verify-consent.md +62 -0
- package/docs/integrations/adobe-analytics.md +239 -105
- package/docs/integrations/ahrefs-analytics.md +238 -104
- package/docs/integrations/amplitude.md +219 -157
- package/docs/integrations/building-integrations.md +32 -224
- package/docs/integrations/clearbit.md +247 -86
- package/docs/integrations/cloudflare-web-analytics.md +250 -84
- package/docs/integrations/crisp.md +251 -97
- package/docs/integrations/databuddy.md +259 -153
- package/docs/integrations/fathom-analytics.md +239 -96
- package/docs/integrations/google-maps.md +328 -207
- package/docs/integrations/google-tag-manager.md +248 -96
- package/docs/integrations/google-tag.md +261 -90
- package/docs/integrations/heap.md +222 -149
- package/docs/integrations/hightouch.md +225 -131
- package/docs/integrations/hotjar.md +239 -90
- package/docs/integrations/intercom.md +239 -98
- package/docs/integrations/linkedin-insights.md +243 -113
- package/docs/integrations/logrocket.md +241 -123
- package/docs/integrations/matomo-analytics.md +256 -111
- package/docs/integrations/meta-pixel.md +197 -324
- package/docs/integrations/microsoft-clarity.md +233 -114
- package/docs/integrations/microsoft-uet.md +245 -110
- package/docs/integrations/mixpanel-analytics.md +252 -87
- package/docs/integrations/openai-pixel.md +441 -0
- package/docs/integrations/overview.md +95 -133
- package/docs/integrations/pirsch.md +249 -96
- package/docs/integrations/plausible-analytics.md +241 -100
- package/docs/integrations/posthog.md +353 -214
- package/docs/integrations/promptwatch.md +251 -81
- package/docs/integrations/reddit-pixel.md +226 -173
- package/docs/integrations/rudderstack.md +244 -187
- package/docs/integrations/rybbit-analytics.md +244 -91
- package/docs/integrations/segment.md +238 -92
- package/docs/integrations/snapchat-pixel.md +240 -110
- package/docs/integrations/tiktok-pixel.md +249 -81
- package/docs/integrations/umami-analytics.md +242 -95
- package/docs/integrations/vercel-analytics.md +242 -90
- package/docs/integrations/x-pixel.md +238 -104
- package/docs/integrations/youtube.md +354 -142
- package/docs/upgrade-v3.md +334 -0
- package/package.json +85 -78
- package/readme.json +2 -2
- package/dist/e2e-test-utils.cjs +0 -166
- package/dist/engine/compile.cjs +0 -130
- package/dist/engine/runtime.cjs +0 -475
- package/dist/registry.cjs +0 -423
- package/dist/resolve.cjs +0 -71
- package/dist/types.cjs +0 -69
- package/dist/vendors/_shared/attributes.cjs +0 -55
- package/dist/vendors/_shared/google-consent.cjs +0 -69
- package/dist/vendors/_shared/install-builders.cjs +0 -59
- package/dist/vendors/_shared/script-url.cjs +0 -78
- package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
- package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
- package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
- package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
- package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
- package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
- package/dist/vendors/analytics/amplitude.cjs +0 -193
- package/dist/vendors/analytics/clearbit.cjs +0 -69
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
- package/dist/vendors/analytics/databuddy.cjs +0 -144
- package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
- package/dist/vendors/analytics/google-tag.cjs +0 -107
- package/dist/vendors/analytics/heap.cjs +0 -181
- package/dist/vendors/analytics/hightouch.cjs +0 -153
- package/dist/vendors/analytics/hotjar.cjs +0 -85
- package/dist/vendors/analytics/logrocket.cjs +0 -99
- package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
- package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
- package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
- package/dist/vendors/analytics/pirsch.cjs +0 -108
- package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
- package/dist/vendors/analytics/posthog.cjs +0 -236
- package/dist/vendors/analytics/promptwatch.cjs +0 -70
- package/dist/vendors/analytics/rudderstack.cjs +0 -227
- package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
- package/dist/vendors/analytics/segment.cjs +0 -97
- package/dist/vendors/analytics/umami-analytics.cjs +0 -80
- package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
- package/dist/vendors/functional/crisp.cjs +0 -143
- package/dist/vendors/functional/intercom.cjs +0 -89
- package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
- package/docs/shared/react/guides/script-loader.md +0 -311
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
function
|
|
1
|
+
const script_url_trimToUndefined = function(value) {
|
|
2
2
|
if (void 0 === value) return;
|
|
3
3
|
const trimmed = value.trim();
|
|
4
4
|
if (0 === trimmed.length) return;
|
|
5
5
|
return trimmed;
|
|
6
|
-
}
|
|
7
|
-
function
|
|
6
|
+
};
|
|
7
|
+
const script_url_resolveScriptUrl = function(override, fallback) {
|
|
8
8
|
if (void 0 !== override) return override;
|
|
9
9
|
return fallback;
|
|
10
|
-
}
|
|
11
|
-
function
|
|
10
|
+
};
|
|
11
|
+
const script_url_stripLeadingSlashes = function(value) {
|
|
12
12
|
let index = 0;
|
|
13
13
|
while(index < value.length && 47 === value.charCodeAt(index))index += 1;
|
|
14
14
|
return 0 === index ? value : value.slice(index);
|
|
15
|
-
}
|
|
16
|
-
function
|
|
15
|
+
};
|
|
16
|
+
const script_url_stripTrailingSlashes = function(value) {
|
|
17
17
|
let end = value.length;
|
|
18
18
|
while(end > 0 && 47 === value.charCodeAt(end - 1))end -= 1;
|
|
19
19
|
return end === value.length ? value : value.slice(0, end);
|
|
20
|
-
}
|
|
21
|
-
function
|
|
20
|
+
};
|
|
21
|
+
const script_url_joinUrlPath = function(base, path) {
|
|
22
22
|
const trimmedBase = base.trim();
|
|
23
23
|
const trimmedPath = path.trim();
|
|
24
24
|
if (0 === trimmedBase.length) throw new TypeError(`joinUrlPath requires a non-empty base URL. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
25
25
|
if (0 === trimmedPath.length) throw new TypeError(`joinUrlPath requires a non-empty path. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
26
|
-
return `${
|
|
27
|
-
}
|
|
28
|
-
export { joinUrlPath, resolveScriptUrl, stripLeadingSlashes, stripTrailingSlashes, trimToUndefined };
|
|
26
|
+
return `${script_url_stripTrailingSlashes(trimmedBase)}/${script_url_stripLeadingSlashes(trimmedPath)}`;
|
|
27
|
+
};
|
|
28
|
+
export { script_url_joinUrlPath as joinUrlPath, script_url_resolveScriptUrl as resolveScriptUrl, script_url_stripLeadingSlashes as stripLeadingSlashes, script_url_stripTrailingSlashes as stripTrailingSlashes, script_url_trimToUndefined as trimToUndefined };
|
|
@@ -2,47 +2,47 @@ import { resolveManifest } from "../../resolve.js";
|
|
|
2
2
|
import { vendorManifestContract } from "../../types.js";
|
|
3
3
|
const linkedinInsightsManifest = {
|
|
4
4
|
...vendorManifestContract,
|
|
5
|
-
vendor: 'linkedin-insights',
|
|
6
5
|
category: 'marketing',
|
|
7
6
|
install: [
|
|
8
7
|
{
|
|
9
|
-
|
|
8
|
+
ifUndefined: false,
|
|
10
9
|
name: '_linkedin_partner_id',
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
type: 'setGlobal',
|
|
11
|
+
value: '{{id}}'
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
|
-
|
|
14
|
+
ifUndefined: true,
|
|
16
15
|
name: '_linkedin_data_partner_ids',
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
type: 'setGlobal',
|
|
17
|
+
value: []
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
|
-
type: 'pushToQueue',
|
|
22
20
|
queue: '_linkedin_data_partner_ids',
|
|
21
|
+
type: 'pushToQueue',
|
|
23
22
|
value: '{{id}}'
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
|
-
|
|
25
|
+
ifUndefined: true,
|
|
27
26
|
name: 'lintrk',
|
|
28
27
|
queue: {
|
|
29
28
|
property: 'q'
|
|
30
29
|
},
|
|
31
30
|
queueFormat: 'array',
|
|
32
|
-
|
|
31
|
+
type: 'defineStubFunction'
|
|
33
32
|
},
|
|
34
33
|
{
|
|
35
|
-
|
|
34
|
+
async: true,
|
|
36
35
|
src: "{{scriptSrc}}",
|
|
37
|
-
|
|
36
|
+
type: 'loadScript'
|
|
38
37
|
}
|
|
39
|
-
]
|
|
38
|
+
],
|
|
39
|
+
vendor: 'linkedin-insights'
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
const linkedin_insights_linkedinInsights = function({ id, scriptSrc }) {
|
|
42
42
|
const resolved = resolveManifest(linkedinInsightsManifest, {
|
|
43
43
|
id,
|
|
44
44
|
scriptSrc: scriptSrc ?? 'https://snap.licdn.com/li.lms-analytics/insight.min.js'
|
|
45
45
|
});
|
|
46
46
|
return resolved;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
47
|
+
};
|
|
48
|
+
export { linkedinInsightsManifest, linkedin_insights_linkedinInsights as linkedinInsights };
|
|
@@ -4,100 +4,99 @@ import { buildQueuePixelInstall } from "../_shared/install-builders.js";
|
|
|
4
4
|
import { resolveScriptUrl } from "../_shared/script-url.js";
|
|
5
5
|
const metaPixelManifest = {
|
|
6
6
|
...vendorManifestContract,
|
|
7
|
-
vendor: 'meta-pixel',
|
|
8
|
-
category: 'marketing',
|
|
9
|
-
persistAfterConsentRevoked: true,
|
|
10
7
|
bootstrap: [
|
|
11
8
|
{
|
|
12
|
-
type: 'defineStubFunction',
|
|
13
|
-
name: 'fbq',
|
|
14
|
-
queue: {
|
|
15
|
-
property: 'queue'
|
|
16
|
-
},
|
|
17
|
-
dispatchProperty: 'callMethod',
|
|
18
|
-
selfReferences: [
|
|
19
|
-
'push'
|
|
20
|
-
],
|
|
21
9
|
aliases: [
|
|
22
10
|
'_fbq'
|
|
23
11
|
],
|
|
12
|
+
dispatchProperty: 'callMethod',
|
|
13
|
+
ifUndefined: true,
|
|
14
|
+
name: 'fbq',
|
|
24
15
|
properties: {
|
|
25
16
|
loaded: true,
|
|
26
17
|
version: '2.0'
|
|
27
18
|
},
|
|
28
|
-
|
|
19
|
+
queue: {
|
|
20
|
+
property: 'queue'
|
|
21
|
+
},
|
|
22
|
+
selfReferences: [
|
|
23
|
+
'push'
|
|
24
|
+
],
|
|
25
|
+
type: 'defineStubFunction'
|
|
29
26
|
}
|
|
30
27
|
],
|
|
28
|
+
category: 'marketing',
|
|
31
29
|
install: [
|
|
32
30
|
{
|
|
33
|
-
type: 'callGlobal',
|
|
34
|
-
global: 'fbq',
|
|
35
31
|
args: [
|
|
36
32
|
'consent',
|
|
37
33
|
'grant'
|
|
38
|
-
]
|
|
34
|
+
],
|
|
35
|
+
global: 'fbq',
|
|
36
|
+
type: 'callGlobal'
|
|
39
37
|
},
|
|
40
38
|
{
|
|
41
|
-
type: 'callGlobal',
|
|
42
|
-
global: 'fbq',
|
|
43
39
|
args: [
|
|
44
40
|
'init',
|
|
45
41
|
'{{pixelId}}'
|
|
46
|
-
]
|
|
42
|
+
],
|
|
43
|
+
global: 'fbq',
|
|
44
|
+
type: 'callGlobal'
|
|
47
45
|
},
|
|
48
46
|
{
|
|
49
|
-
type: 'callGlobal',
|
|
50
|
-
global: 'fbq',
|
|
51
47
|
args: [
|
|
52
48
|
'track',
|
|
53
49
|
'PageView'
|
|
54
|
-
]
|
|
50
|
+
],
|
|
51
|
+
global: 'fbq',
|
|
52
|
+
type: 'callGlobal'
|
|
55
53
|
},
|
|
56
54
|
{
|
|
57
|
-
|
|
55
|
+
async: true,
|
|
58
56
|
src: "{{scriptSrc}}",
|
|
59
|
-
|
|
57
|
+
type: 'loadScript'
|
|
60
58
|
}
|
|
61
59
|
],
|
|
62
|
-
|
|
60
|
+
onConsentDenied: [
|
|
63
61
|
{
|
|
64
|
-
type: 'callGlobal',
|
|
65
|
-
global: 'fbq',
|
|
66
62
|
args: [
|
|
67
63
|
'consent',
|
|
68
|
-
'
|
|
69
|
-
]
|
|
64
|
+
'revoke'
|
|
65
|
+
],
|
|
66
|
+
global: 'fbq',
|
|
67
|
+
type: 'callGlobal'
|
|
70
68
|
}
|
|
71
69
|
],
|
|
72
|
-
|
|
70
|
+
onConsentGranted: [
|
|
73
71
|
{
|
|
74
|
-
type: 'callGlobal',
|
|
75
|
-
global: 'fbq',
|
|
76
72
|
args: [
|
|
77
73
|
'consent',
|
|
78
|
-
'
|
|
79
|
-
]
|
|
74
|
+
'grant'
|
|
75
|
+
],
|
|
76
|
+
global: 'fbq',
|
|
77
|
+
type: 'callGlobal'
|
|
80
78
|
}
|
|
81
|
-
]
|
|
79
|
+
],
|
|
80
|
+
persistAfterConsentRevoked: true,
|
|
81
|
+
vendor: 'meta-pixel'
|
|
82
82
|
};
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
const meta_pixel_getMetaPixelDataProcessingArgs = function({ options, country, state }) {
|
|
84
|
+
const args = [
|
|
85
|
+
'dataProcessingOptions',
|
|
86
|
+
options
|
|
87
|
+
];
|
|
88
|
+
if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
|
|
89
|
+
return args;
|
|
90
|
+
};
|
|
91
|
+
const meta_pixel_getMetaPixelPageViewStep = function(trackPageView) {
|
|
92
|
+
if (trackPageView) return {
|
|
93
|
+
args: [
|
|
94
|
+
'track',
|
|
95
|
+
'PageView'
|
|
96
|
+
]
|
|
92
97
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
initOptions,
|
|
96
|
-
scriptSrc: resolveScriptUrl(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
|
|
97
|
-
});
|
|
98
|
-
return resolved;
|
|
99
|
-
}
|
|
100
|
-
function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOptions }) {
|
|
98
|
+
};
|
|
99
|
+
const meta_pixel_buildMetaPixelInstall = function({ hasInitOptions, trackPageView, dataProcessingOptions }) {
|
|
101
100
|
const initArgs = [
|
|
102
101
|
'init',
|
|
103
102
|
'{{pixelId}}'
|
|
@@ -106,48 +105,49 @@ function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOp
|
|
|
106
105
|
const install = buildQueuePixelInstall({
|
|
107
106
|
global: 'fbq',
|
|
108
107
|
initArgs,
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
scriptPlaceholder: "{{scriptSrc}}",
|
|
109
|
+
trackStep: meta_pixel_getMetaPixelPageViewStep(trackPageView)
|
|
111
110
|
});
|
|
112
111
|
if (void 0 !== dataProcessingOptions) install.unshift({
|
|
113
|
-
|
|
112
|
+
args: meta_pixel_getMetaPixelDataProcessingArgs(dataProcessingOptions),
|
|
114
113
|
global: 'fbq',
|
|
115
|
-
|
|
114
|
+
type: 'callGlobal'
|
|
116
115
|
});
|
|
117
116
|
install.unshift({
|
|
118
|
-
type: 'callGlobal',
|
|
119
|
-
global: 'fbq',
|
|
120
117
|
args: [
|
|
121
118
|
'consent',
|
|
122
119
|
'grant'
|
|
123
|
-
]
|
|
120
|
+
],
|
|
121
|
+
global: 'fbq',
|
|
122
|
+
type: 'callGlobal'
|
|
124
123
|
});
|
|
125
124
|
return install;
|
|
126
|
-
}
|
|
127
|
-
function
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (trackPageView) return {
|
|
137
|
-
args: [
|
|
138
|
-
'track',
|
|
139
|
-
'PageView'
|
|
140
|
-
]
|
|
125
|
+
};
|
|
126
|
+
const meta_pixel_metaPixel = function({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
|
|
127
|
+
const install = meta_pixel_buildMetaPixelInstall({
|
|
128
|
+
dataProcessingOptions,
|
|
129
|
+
hasInitOptions: void 0 !== initOptions,
|
|
130
|
+
trackPageView
|
|
131
|
+
});
|
|
132
|
+
const manifest = {
|
|
133
|
+
...metaPixelManifest,
|
|
134
|
+
install
|
|
141
135
|
};
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
const resolved = resolveManifest(manifest, {
|
|
137
|
+
initOptions,
|
|
138
|
+
pixelId,
|
|
139
|
+
scriptSrc: resolveScriptUrl(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
|
|
140
|
+
});
|
|
141
|
+
return resolved;
|
|
142
|
+
};
|
|
143
|
+
const meta_pixel_resolveMetaPixelEventOptions = function(eventOptions) {
|
|
144
144
|
if ('string' == typeof eventOptions) return {
|
|
145
145
|
eventID: eventOptions
|
|
146
146
|
};
|
|
147
147
|
return eventOptions;
|
|
148
|
-
}
|
|
149
|
-
const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params,
|
|
150
|
-
const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params,
|
|
151
|
-
const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params,
|
|
152
|
-
const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params,
|
|
153
|
-
export {
|
|
148
|
+
};
|
|
149
|
+
const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, meta_pixel_resolveMetaPixelEventOptions(eventOptions));
|
|
150
|
+
const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, meta_pixel_resolveMetaPixelEventOptions(eventOptions));
|
|
151
|
+
const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, meta_pixel_resolveMetaPixelEventOptions(eventOptions));
|
|
152
|
+
const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, meta_pixel_resolveMetaPixelEventOptions(eventOptions));
|
|
153
|
+
export { metaPixelCustomEvent, metaPixelEvent, metaPixelManifest, metaPixelSingleCustomEvent, metaPixelSingleEvent, meta_pixel_metaPixel as metaPixel };
|
|
@@ -2,109 +2,109 @@ import { resolveManifest } from "../../resolve.js";
|
|
|
2
2
|
import { vendorManifestContract } from "../../types.js";
|
|
3
3
|
const microsoftUetManifest = {
|
|
4
4
|
...vendorManifestContract,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
afterLoad: [
|
|
6
|
+
{
|
|
7
|
+
args: [
|
|
8
|
+
{
|
|
9
|
+
enableAutoSpaTracking: true,
|
|
10
|
+
ti: '{{id}}'
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
assignTo: 'uetq',
|
|
14
|
+
constructor: 'UET',
|
|
15
|
+
copyAssignedValueToArgProperty: 'q',
|
|
16
|
+
type: 'constructGlobal'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
args: [
|
|
20
|
+
'pageLoad'
|
|
21
|
+
],
|
|
22
|
+
global: 'uetq',
|
|
23
|
+
method: 'push',
|
|
24
|
+
type: 'callGlobal'
|
|
25
|
+
}
|
|
26
|
+
],
|
|
7
27
|
alwaysLoad: true,
|
|
8
|
-
persistAfterConsentRevoked: true,
|
|
9
28
|
bootstrap: [
|
|
10
29
|
{
|
|
11
|
-
|
|
30
|
+
ifUndefined: true,
|
|
12
31
|
name: 'uetq',
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
type: 'setGlobal',
|
|
33
|
+
value: []
|
|
15
34
|
}
|
|
16
35
|
],
|
|
17
|
-
|
|
36
|
+
category: 'marketing',
|
|
37
|
+
install: [
|
|
18
38
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
args: [
|
|
23
|
-
'consent',
|
|
24
|
-
'default',
|
|
25
|
-
{
|
|
26
|
-
ad_storage: 'granted'
|
|
27
|
-
}
|
|
28
|
-
]
|
|
39
|
+
async: true,
|
|
40
|
+
src: "{{scriptSrc}}",
|
|
41
|
+
type: 'loadScript'
|
|
29
42
|
}
|
|
30
43
|
],
|
|
31
44
|
onBeforeLoadDenied: [
|
|
32
45
|
{
|
|
33
|
-
type: 'callGlobal',
|
|
34
|
-
global: 'uetq',
|
|
35
|
-
method: 'push',
|
|
36
46
|
args: [
|
|
37
47
|
'consent',
|
|
38
48
|
'default',
|
|
39
49
|
{
|
|
40
50
|
ad_storage: 'denied'
|
|
41
51
|
}
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
type: 'loadScript',
|
|
48
|
-
src: "{{scriptSrc}}",
|
|
49
|
-
async: true
|
|
52
|
+
],
|
|
53
|
+
global: 'uetq',
|
|
54
|
+
method: 'push',
|
|
55
|
+
type: 'callGlobal'
|
|
50
56
|
}
|
|
51
57
|
],
|
|
52
|
-
|
|
58
|
+
onBeforeLoadGranted: [
|
|
53
59
|
{
|
|
54
|
-
type: 'constructGlobal',
|
|
55
|
-
constructor: 'UET',
|
|
56
|
-
assignTo: 'uetq',
|
|
57
60
|
args: [
|
|
61
|
+
'consent',
|
|
62
|
+
'default',
|
|
58
63
|
{
|
|
59
|
-
|
|
60
|
-
enableAutoSpaTracking: true
|
|
64
|
+
ad_storage: 'granted'
|
|
61
65
|
}
|
|
62
66
|
],
|
|
63
|
-
copyAssignedValueToArgProperty: 'q'
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'callGlobal',
|
|
67
67
|
global: 'uetq',
|
|
68
68
|
method: 'push',
|
|
69
|
-
|
|
70
|
-
'pageLoad'
|
|
71
|
-
]
|
|
69
|
+
type: 'callGlobal'
|
|
72
70
|
}
|
|
73
71
|
],
|
|
74
|
-
|
|
72
|
+
onConsentDenied: [
|
|
75
73
|
{
|
|
76
|
-
type: 'callGlobal',
|
|
77
|
-
global: 'uetq',
|
|
78
|
-
method: 'push',
|
|
79
74
|
args: [
|
|
80
75
|
'consent',
|
|
81
76
|
'update',
|
|
82
77
|
{
|
|
83
|
-
ad_storage: '
|
|
78
|
+
ad_storage: 'denied'
|
|
84
79
|
}
|
|
85
|
-
]
|
|
80
|
+
],
|
|
81
|
+
global: 'uetq',
|
|
82
|
+
method: 'push',
|
|
83
|
+
type: 'callGlobal'
|
|
86
84
|
}
|
|
87
85
|
],
|
|
88
|
-
|
|
86
|
+
onConsentGranted: [
|
|
89
87
|
{
|
|
90
|
-
type: 'callGlobal',
|
|
91
|
-
global: 'uetq',
|
|
92
|
-
method: 'push',
|
|
93
88
|
args: [
|
|
94
89
|
'consent',
|
|
95
90
|
'update',
|
|
96
91
|
{
|
|
97
|
-
ad_storage: '
|
|
92
|
+
ad_storage: 'granted'
|
|
98
93
|
}
|
|
99
|
-
]
|
|
94
|
+
],
|
|
95
|
+
global: 'uetq',
|
|
96
|
+
method: 'push',
|
|
97
|
+
type: 'callGlobal'
|
|
100
98
|
}
|
|
101
|
-
]
|
|
99
|
+
],
|
|
100
|
+
persistAfterConsentRevoked: true,
|
|
101
|
+
vendor: 'microsoft-uet'
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
const microsoft_uet_microsoftUet = function({ id, scriptSrc }) {
|
|
104
104
|
const resolved = resolveManifest(microsoftUetManifest, {
|
|
105
105
|
id,
|
|
106
106
|
scriptSrc: scriptSrc ?? '//bat.bing.com/bat.js'
|
|
107
107
|
});
|
|
108
108
|
return resolved;
|
|
109
|
-
}
|
|
110
|
-
export {
|
|
109
|
+
};
|
|
110
|
+
export { microsoftUetManifest, microsoft_uet_microsoftUet as microsoftUet };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
import { resolveScriptUrl } from "../_shared/script-url.js";
|
|
4
|
+
const openaiPixelManifest = {
|
|
5
|
+
...vendorManifestContract,
|
|
6
|
+
bootstrap: [
|
|
7
|
+
{
|
|
8
|
+
ifUndefined: true,
|
|
9
|
+
name: 'oaiq',
|
|
10
|
+
queue: {
|
|
11
|
+
property: 'q'
|
|
12
|
+
},
|
|
13
|
+
type: 'defineStubFunction'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
args: [
|
|
17
|
+
'consent',
|
|
18
|
+
false
|
|
19
|
+
],
|
|
20
|
+
global: 'oaiq',
|
|
21
|
+
type: 'callGlobal'
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
category: 'marketing',
|
|
25
|
+
install: [
|
|
26
|
+
{
|
|
27
|
+
args: [
|
|
28
|
+
'init',
|
|
29
|
+
'{{initOptions}}'
|
|
30
|
+
],
|
|
31
|
+
global: 'oaiq',
|
|
32
|
+
type: 'callGlobal'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
async: true,
|
|
36
|
+
src: "{{scriptSrc}}",
|
|
37
|
+
type: 'loadScript'
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
onBeforeLoadGranted: [
|
|
41
|
+
{
|
|
42
|
+
args: [
|
|
43
|
+
'consent',
|
|
44
|
+
true
|
|
45
|
+
],
|
|
46
|
+
global: 'oaiq',
|
|
47
|
+
type: 'callGlobal'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
onConsentDenied: [
|
|
51
|
+
{
|
|
52
|
+
args: [
|
|
53
|
+
'consent',
|
|
54
|
+
false
|
|
55
|
+
],
|
|
56
|
+
global: 'oaiq',
|
|
57
|
+
type: 'callGlobal'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
onConsentGranted: [
|
|
61
|
+
{
|
|
62
|
+
args: [
|
|
63
|
+
'consent',
|
|
64
|
+
true
|
|
65
|
+
],
|
|
66
|
+
global: 'oaiq',
|
|
67
|
+
type: 'callGlobal'
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
persistAfterConsentRevoked: true,
|
|
71
|
+
vendor: 'openai-pixel'
|
|
72
|
+
};
|
|
73
|
+
const openai_pixel_openaiPixel = function({ pixelId, debug = false, user, scriptSrc }) {
|
|
74
|
+
const initOptions = {
|
|
75
|
+
debug,
|
|
76
|
+
pixelId
|
|
77
|
+
};
|
|
78
|
+
if (void 0 !== user) initOptions.user = user;
|
|
79
|
+
return resolveManifest(openaiPixelManifest, {
|
|
80
|
+
initOptions,
|
|
81
|
+
scriptSrc: resolveScriptUrl(scriptSrc, 'https://bzrcdn.openai.com/sdk/oaiq.min.js')
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const openai_pixel_openaiPixelEvent = function(...args) {
|
|
85
|
+
if ("u" < typeof window || 'function' != typeof window.oaiq) return;
|
|
86
|
+
window.oaiq('measure', ...args);
|
|
87
|
+
};
|
|
88
|
+
export { openaiPixelManifest, openai_pixel_openaiPixel as openaiPixel, openai_pixel_openaiPixelEvent as openaiPixelEvent };
|