@c15t/scripts 2.0.1 → 2.1.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/README.md +9 -9
- package/dist/engine/runtime.cjs +11 -0
- package/dist/engine/runtime.js +11 -0
- package/dist/registry.cjs +338 -0
- package/dist/registry.js +292 -0
- package/dist/types.cjs +18 -0
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +51 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +64 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +55 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +74 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +2 -2
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +202 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +31 -14
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +147 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +127 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +2 -2
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +6 -3
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/ahrefs-analytics.cjs +64 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +69 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +3 -3
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +72 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +7 -28
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/hotjar.cjs +81 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +228 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +110 -0
- package/dist/vendors/analytics/microsoft-clarity.js +73 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +119 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +82 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +118 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/{posthog.cjs → vendors/analytics/posthog.cjs} +69 -6
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +66 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +100 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +93 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +76 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +90 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +139 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +85 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +6 -27
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +368 -0
- package/dist-types/types.d.ts +13 -0
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/{linkedin-insights.d.ts → vendors/ads-and-pixels/linkedin-insights.d.ts} +22 -9
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +21 -10
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +20 -5
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +21 -4
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +5 -8
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +86 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +101 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/{posthog.d.ts → vendors/analytics/posthog.d.ts} +47 -5
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +5 -8
- package/package.json +165 -4
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.js +0 -100
- package/dist-types/meta-pixel.d.ts +0 -185
- /package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +0 -0
|
@@ -27,8 +27,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
linkedinInsights: ()=>linkedinInsights,
|
|
28
28
|
linkedinInsightsManifest: ()=>linkedinInsightsManifest
|
|
29
29
|
});
|
|
30
|
-
const external_resolve_cjs_namespaceObject = require("
|
|
31
|
-
const external_types_cjs_namespaceObject = require("
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
32
|
const linkedinInsightsManifest = {
|
|
33
33
|
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
34
|
vendor: 'linkedin-insights',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveManifest } from "
|
|
2
|
-
import { vendorManifestContract } from "
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
3
|
const linkedinInsightsManifest = {
|
|
4
4
|
...vendorManifestContract,
|
|
5
5
|
vendor: 'linkedin-insights',
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
metaPixelManifest: ()=>metaPixelManifest,
|
|
28
|
+
metaPixelEvent: ()=>metaPixelEvent,
|
|
29
|
+
metaPixel: ()=>metaPixel,
|
|
30
|
+
metaPixelCustomEvent: ()=>metaPixelCustomEvent,
|
|
31
|
+
metaPixelSingleEvent: ()=>metaPixelSingleEvent,
|
|
32
|
+
metaPixelSingleCustomEvent: ()=>metaPixelSingleCustomEvent
|
|
33
|
+
});
|
|
34
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
35
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
36
|
+
const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
|
|
37
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
38
|
+
const metaPixelManifest = {
|
|
39
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
40
|
+
vendor: 'meta-pixel',
|
|
41
|
+
category: 'marketing',
|
|
42
|
+
persistAfterConsentRevoked: true,
|
|
43
|
+
bootstrap: [
|
|
44
|
+
{
|
|
45
|
+
type: 'defineStubFunction',
|
|
46
|
+
name: 'fbq',
|
|
47
|
+
queue: {
|
|
48
|
+
property: 'queue'
|
|
49
|
+
},
|
|
50
|
+
dispatchProperty: 'callMethod',
|
|
51
|
+
selfReferences: [
|
|
52
|
+
'push'
|
|
53
|
+
],
|
|
54
|
+
aliases: [
|
|
55
|
+
'_fbq'
|
|
56
|
+
],
|
|
57
|
+
properties: {
|
|
58
|
+
loaded: true,
|
|
59
|
+
version: '2.0'
|
|
60
|
+
},
|
|
61
|
+
ifUndefined: true
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
install: [
|
|
65
|
+
{
|
|
66
|
+
type: 'callGlobal',
|
|
67
|
+
global: 'fbq',
|
|
68
|
+
args: [
|
|
69
|
+
'consent',
|
|
70
|
+
'grant'
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'callGlobal',
|
|
75
|
+
global: 'fbq',
|
|
76
|
+
args: [
|
|
77
|
+
'init',
|
|
78
|
+
'{{pixelId}}'
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: 'callGlobal',
|
|
83
|
+
global: 'fbq',
|
|
84
|
+
args: [
|
|
85
|
+
'track',
|
|
86
|
+
'PageView'
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'loadScript',
|
|
91
|
+
src: "{{scriptSrc}}",
|
|
92
|
+
async: true
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
onConsentGranted: [
|
|
96
|
+
{
|
|
97
|
+
type: 'callGlobal',
|
|
98
|
+
global: 'fbq',
|
|
99
|
+
args: [
|
|
100
|
+
'consent',
|
|
101
|
+
'grant'
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
onConsentDenied: [
|
|
106
|
+
{
|
|
107
|
+
type: 'callGlobal',
|
|
108
|
+
global: 'fbq',
|
|
109
|
+
args: [
|
|
110
|
+
'consent',
|
|
111
|
+
'revoke'
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
116
|
+
function metaPixel({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
|
|
117
|
+
const install = buildMetaPixelInstall({
|
|
118
|
+
hasInitOptions: void 0 !== initOptions,
|
|
119
|
+
trackPageView,
|
|
120
|
+
dataProcessingOptions
|
|
121
|
+
});
|
|
122
|
+
const manifest = {
|
|
123
|
+
...metaPixelManifest,
|
|
124
|
+
install
|
|
125
|
+
};
|
|
126
|
+
const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
|
|
127
|
+
pixelId,
|
|
128
|
+
initOptions,
|
|
129
|
+
scriptSrc: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
|
|
130
|
+
});
|
|
131
|
+
return resolved;
|
|
132
|
+
}
|
|
133
|
+
function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOptions }) {
|
|
134
|
+
const initArgs = [
|
|
135
|
+
'init',
|
|
136
|
+
'{{pixelId}}'
|
|
137
|
+
];
|
|
138
|
+
if (hasInitOptions) initArgs.push('{{initOptions}}');
|
|
139
|
+
const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
|
|
140
|
+
global: 'fbq',
|
|
141
|
+
initArgs,
|
|
142
|
+
trackStep: getMetaPixelPageViewStep(trackPageView),
|
|
143
|
+
scriptPlaceholder: "{{scriptSrc}}"
|
|
144
|
+
});
|
|
145
|
+
if (void 0 !== dataProcessingOptions) install.unshift({
|
|
146
|
+
type: 'callGlobal',
|
|
147
|
+
global: 'fbq',
|
|
148
|
+
args: getMetaPixelDataProcessingArgs(dataProcessingOptions)
|
|
149
|
+
});
|
|
150
|
+
install.unshift({
|
|
151
|
+
type: 'callGlobal',
|
|
152
|
+
global: 'fbq',
|
|
153
|
+
args: [
|
|
154
|
+
'consent',
|
|
155
|
+
'grant'
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
return install;
|
|
159
|
+
}
|
|
160
|
+
function getMetaPixelDataProcessingArgs({ options, country, state }) {
|
|
161
|
+
const args = [
|
|
162
|
+
'dataProcessingOptions',
|
|
163
|
+
options
|
|
164
|
+
];
|
|
165
|
+
if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
|
|
166
|
+
return args;
|
|
167
|
+
}
|
|
168
|
+
function getMetaPixelPageViewStep(trackPageView) {
|
|
169
|
+
if (trackPageView) return {
|
|
170
|
+
args: [
|
|
171
|
+
'track',
|
|
172
|
+
'PageView'
|
|
173
|
+
]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function resolveMetaPixelEventOptions(eventOptions) {
|
|
177
|
+
if ('string' == typeof eventOptions) return {
|
|
178
|
+
eventID: eventOptions
|
|
179
|
+
};
|
|
180
|
+
return eventOptions;
|
|
181
|
+
}
|
|
182
|
+
const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
183
|
+
const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
184
|
+
const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
185
|
+
const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
186
|
+
exports.metaPixel = __webpack_exports__.metaPixel;
|
|
187
|
+
exports.metaPixelCustomEvent = __webpack_exports__.metaPixelCustomEvent;
|
|
188
|
+
exports.metaPixelEvent = __webpack_exports__.metaPixelEvent;
|
|
189
|
+
exports.metaPixelManifest = __webpack_exports__.metaPixelManifest;
|
|
190
|
+
exports.metaPixelSingleCustomEvent = __webpack_exports__.metaPixelSingleCustomEvent;
|
|
191
|
+
exports.metaPixelSingleEvent = __webpack_exports__.metaPixelSingleEvent;
|
|
192
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
193
|
+
"metaPixel",
|
|
194
|
+
"metaPixelCustomEvent",
|
|
195
|
+
"metaPixelEvent",
|
|
196
|
+
"metaPixelManifest",
|
|
197
|
+
"metaPixelSingleCustomEvent",
|
|
198
|
+
"metaPixelSingleEvent"
|
|
199
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
200
|
+
Object.defineProperty(exports, '__esModule', {
|
|
201
|
+
value: true
|
|
202
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
import { buildQueuePixelInstall } from "../_shared/install-builders.js";
|
|
4
|
+
import { resolveScriptUrl } from "../_shared/script-url.js";
|
|
5
|
+
const metaPixelManifest = {
|
|
6
|
+
...vendorManifestContract,
|
|
7
|
+
vendor: 'meta-pixel',
|
|
8
|
+
category: 'marketing',
|
|
9
|
+
persistAfterConsentRevoked: true,
|
|
10
|
+
bootstrap: [
|
|
11
|
+
{
|
|
12
|
+
type: 'defineStubFunction',
|
|
13
|
+
name: 'fbq',
|
|
14
|
+
queue: {
|
|
15
|
+
property: 'queue'
|
|
16
|
+
},
|
|
17
|
+
dispatchProperty: 'callMethod',
|
|
18
|
+
selfReferences: [
|
|
19
|
+
'push'
|
|
20
|
+
],
|
|
21
|
+
aliases: [
|
|
22
|
+
'_fbq'
|
|
23
|
+
],
|
|
24
|
+
properties: {
|
|
25
|
+
loaded: true,
|
|
26
|
+
version: '2.0'
|
|
27
|
+
},
|
|
28
|
+
ifUndefined: true
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
install: [
|
|
32
|
+
{
|
|
33
|
+
type: 'callGlobal',
|
|
34
|
+
global: 'fbq',
|
|
35
|
+
args: [
|
|
36
|
+
'consent',
|
|
37
|
+
'grant'
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'callGlobal',
|
|
42
|
+
global: 'fbq',
|
|
43
|
+
args: [
|
|
44
|
+
'init',
|
|
45
|
+
'{{pixelId}}'
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'callGlobal',
|
|
50
|
+
global: 'fbq',
|
|
51
|
+
args: [
|
|
52
|
+
'track',
|
|
53
|
+
'PageView'
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'loadScript',
|
|
58
|
+
src: "{{scriptSrc}}",
|
|
59
|
+
async: true
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
onConsentGranted: [
|
|
63
|
+
{
|
|
64
|
+
type: 'callGlobal',
|
|
65
|
+
global: 'fbq',
|
|
66
|
+
args: [
|
|
67
|
+
'consent',
|
|
68
|
+
'grant'
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
onConsentDenied: [
|
|
73
|
+
{
|
|
74
|
+
type: 'callGlobal',
|
|
75
|
+
global: 'fbq',
|
|
76
|
+
args: [
|
|
77
|
+
'consent',
|
|
78
|
+
'revoke'
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
function metaPixel({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
|
|
84
|
+
const install = buildMetaPixelInstall({
|
|
85
|
+
hasInitOptions: void 0 !== initOptions,
|
|
86
|
+
trackPageView,
|
|
87
|
+
dataProcessingOptions
|
|
88
|
+
});
|
|
89
|
+
const manifest = {
|
|
90
|
+
...metaPixelManifest,
|
|
91
|
+
install
|
|
92
|
+
};
|
|
93
|
+
const resolved = resolveManifest(manifest, {
|
|
94
|
+
pixelId,
|
|
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 }) {
|
|
101
|
+
const initArgs = [
|
|
102
|
+
'init',
|
|
103
|
+
'{{pixelId}}'
|
|
104
|
+
];
|
|
105
|
+
if (hasInitOptions) initArgs.push('{{initOptions}}');
|
|
106
|
+
const install = buildQueuePixelInstall({
|
|
107
|
+
global: 'fbq',
|
|
108
|
+
initArgs,
|
|
109
|
+
trackStep: getMetaPixelPageViewStep(trackPageView),
|
|
110
|
+
scriptPlaceholder: "{{scriptSrc}}"
|
|
111
|
+
});
|
|
112
|
+
if (void 0 !== dataProcessingOptions) install.unshift({
|
|
113
|
+
type: 'callGlobal',
|
|
114
|
+
global: 'fbq',
|
|
115
|
+
args: getMetaPixelDataProcessingArgs(dataProcessingOptions)
|
|
116
|
+
});
|
|
117
|
+
install.unshift({
|
|
118
|
+
type: 'callGlobal',
|
|
119
|
+
global: 'fbq',
|
|
120
|
+
args: [
|
|
121
|
+
'consent',
|
|
122
|
+
'grant'
|
|
123
|
+
]
|
|
124
|
+
});
|
|
125
|
+
return install;
|
|
126
|
+
}
|
|
127
|
+
function getMetaPixelDataProcessingArgs({ options, country, state }) {
|
|
128
|
+
const args = [
|
|
129
|
+
'dataProcessingOptions',
|
|
130
|
+
options
|
|
131
|
+
];
|
|
132
|
+
if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
|
|
133
|
+
return args;
|
|
134
|
+
}
|
|
135
|
+
function getMetaPixelPageViewStep(trackPageView) {
|
|
136
|
+
if (trackPageView) return {
|
|
137
|
+
args: [
|
|
138
|
+
'track',
|
|
139
|
+
'PageView'
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function resolveMetaPixelEventOptions(eventOptions) {
|
|
144
|
+
if ('string' == typeof eventOptions) return {
|
|
145
|
+
eventID: eventOptions
|
|
146
|
+
};
|
|
147
|
+
return eventOptions;
|
|
148
|
+
}
|
|
149
|
+
const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
150
|
+
const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
151
|
+
const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
152
|
+
const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
153
|
+
export { metaPixel, metaPixelCustomEvent, metaPixelEvent, metaPixelManifest, metaPixelSingleCustomEvent, metaPixelSingleEvent };
|
|
@@ -27,12 +27,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
microsoftUetManifest: ()=>microsoftUetManifest,
|
|
28
28
|
microsoftUet: ()=>microsoftUet
|
|
29
29
|
});
|
|
30
|
-
const external_resolve_cjs_namespaceObject = require("
|
|
31
|
-
const external_types_cjs_namespaceObject = require("
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
32
|
const microsoftUetManifest = {
|
|
33
33
|
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
34
|
vendor: 'microsoft-uet',
|
|
35
35
|
category: 'marketing',
|
|
36
|
+
alwaysLoad: true,
|
|
36
37
|
persistAfterConsentRevoked: true,
|
|
37
38
|
bootstrap: [
|
|
38
39
|
{
|
|
@@ -42,6 +43,34 @@ const microsoftUetManifest = {
|
|
|
42
43
|
ifUndefined: true
|
|
43
44
|
}
|
|
44
45
|
],
|
|
46
|
+
onBeforeLoadGranted: [
|
|
47
|
+
{
|
|
48
|
+
type: 'callGlobal',
|
|
49
|
+
global: 'uetq',
|
|
50
|
+
method: 'push',
|
|
51
|
+
args: [
|
|
52
|
+
'consent',
|
|
53
|
+
'default',
|
|
54
|
+
{
|
|
55
|
+
ad_storage: 'granted'
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
onBeforeLoadDenied: [
|
|
61
|
+
{
|
|
62
|
+
type: 'callGlobal',
|
|
63
|
+
global: 'uetq',
|
|
64
|
+
method: 'push',
|
|
65
|
+
args: [
|
|
66
|
+
'consent',
|
|
67
|
+
'default',
|
|
68
|
+
{
|
|
69
|
+
ad_storage: 'denied'
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
45
74
|
install: [
|
|
46
75
|
{
|
|
47
76
|
type: 'loadScript',
|
|
@@ -69,18 +98,6 @@ const microsoftUetManifest = {
|
|
|
69
98
|
args: [
|
|
70
99
|
'pageLoad'
|
|
71
100
|
]
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'callGlobal',
|
|
75
|
-
global: 'uetq',
|
|
76
|
-
method: 'push',
|
|
77
|
-
args: [
|
|
78
|
-
'consent',
|
|
79
|
-
'default',
|
|
80
|
-
{
|
|
81
|
-
ad_storage: 'granted'
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
101
|
}
|
|
85
102
|
],
|
|
86
103
|
onConsentGranted: [
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { resolveManifest } from "
|
|
2
|
-
import { vendorManifestContract } from "
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
3
|
const microsoftUetManifest = {
|
|
4
4
|
...vendorManifestContract,
|
|
5
5
|
vendor: 'microsoft-uet',
|
|
6
6
|
category: 'marketing',
|
|
7
|
+
alwaysLoad: true,
|
|
7
8
|
persistAfterConsentRevoked: true,
|
|
8
9
|
bootstrap: [
|
|
9
10
|
{
|
|
@@ -13,6 +14,34 @@ const microsoftUetManifest = {
|
|
|
13
14
|
ifUndefined: true
|
|
14
15
|
}
|
|
15
16
|
],
|
|
17
|
+
onBeforeLoadGranted: [
|
|
18
|
+
{
|
|
19
|
+
type: 'callGlobal',
|
|
20
|
+
global: 'uetq',
|
|
21
|
+
method: 'push',
|
|
22
|
+
args: [
|
|
23
|
+
'consent',
|
|
24
|
+
'default',
|
|
25
|
+
{
|
|
26
|
+
ad_storage: 'granted'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
onBeforeLoadDenied: [
|
|
32
|
+
{
|
|
33
|
+
type: 'callGlobal',
|
|
34
|
+
global: 'uetq',
|
|
35
|
+
method: 'push',
|
|
36
|
+
args: [
|
|
37
|
+
'consent',
|
|
38
|
+
'default',
|
|
39
|
+
{
|
|
40
|
+
ad_storage: 'denied'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
16
45
|
install: [
|
|
17
46
|
{
|
|
18
47
|
type: 'loadScript',
|
|
@@ -40,18 +69,6 @@ const microsoftUetManifest = {
|
|
|
40
69
|
args: [
|
|
41
70
|
'pageLoad'
|
|
42
71
|
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: 'callGlobal',
|
|
46
|
-
global: 'uetq',
|
|
47
|
-
method: 'push',
|
|
48
|
-
args: [
|
|
49
|
-
'consent',
|
|
50
|
-
'default',
|
|
51
|
-
{
|
|
52
|
-
ad_storage: 'granted'
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
72
|
}
|
|
56
73
|
],
|
|
57
74
|
onConsentGranted: [
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
redditPixel: ()=>redditPixel,
|
|
28
|
+
redditPixelEvent: ()=>redditPixelEvent,
|
|
29
|
+
redditPixelManifest: ()=>redditPixelManifest
|
|
30
|
+
});
|
|
31
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
32
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
33
|
+
const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
|
|
34
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
35
|
+
const redditPixelManifest = {
|
|
36
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
37
|
+
vendor: 'reddit-pixel',
|
|
38
|
+
category: 'marketing',
|
|
39
|
+
persistAfterConsentRevoked: true,
|
|
40
|
+
bootstrap: [
|
|
41
|
+
{
|
|
42
|
+
type: 'defineStubFunction',
|
|
43
|
+
name: 'rdt',
|
|
44
|
+
queue: {
|
|
45
|
+
property: 'callQueue'
|
|
46
|
+
},
|
|
47
|
+
dispatchProperty: 'sendEvent',
|
|
48
|
+
queueFormat: 'array',
|
|
49
|
+
ifUndefined: true
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
install: [
|
|
53
|
+
{
|
|
54
|
+
type: 'callGlobal',
|
|
55
|
+
global: 'rdt',
|
|
56
|
+
args: [
|
|
57
|
+
'init',
|
|
58
|
+
'{{pixelId}}'
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'callGlobal',
|
|
63
|
+
global: 'rdt',
|
|
64
|
+
args: [
|
|
65
|
+
'track',
|
|
66
|
+
'PageVisit'
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: 'loadScript',
|
|
71
|
+
src: "{{scriptUrl}}",
|
|
72
|
+
async: true
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
onConsentGranted: [
|
|
76
|
+
{
|
|
77
|
+
type: 'callGlobal',
|
|
78
|
+
global: 'rdt',
|
|
79
|
+
args: [
|
|
80
|
+
'enableFirstPartyCookies'
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
onConsentDenied: [
|
|
85
|
+
{
|
|
86
|
+
type: 'callGlobal',
|
|
87
|
+
global: 'rdt',
|
|
88
|
+
args: [
|
|
89
|
+
'disableFirstPartyCookies'
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirstPartyCookies, scriptUrl }) {
|
|
95
|
+
let trackStep;
|
|
96
|
+
if (trackPageVisit) trackStep = {
|
|
97
|
+
args: [
|
|
98
|
+
'track',
|
|
99
|
+
'PageVisit'
|
|
100
|
+
]
|
|
101
|
+
};
|
|
102
|
+
const resolvedInitOptions = getRedditPixelInitOptions({
|
|
103
|
+
initOptions,
|
|
104
|
+
disableFirstPartyCookies
|
|
105
|
+
});
|
|
106
|
+
const initArgs = [
|
|
107
|
+
'init',
|
|
108
|
+
'{{pixelId}}'
|
|
109
|
+
];
|
|
110
|
+
if (void 0 !== resolvedInitOptions) initArgs.push('{{initOptions}}');
|
|
111
|
+
const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
|
|
112
|
+
global: 'rdt',
|
|
113
|
+
initArgs,
|
|
114
|
+
trackStep
|
|
115
|
+
});
|
|
116
|
+
const manifest = {
|
|
117
|
+
...redditPixelManifest,
|
|
118
|
+
install
|
|
119
|
+
};
|
|
120
|
+
return (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
|
|
121
|
+
pixelId,
|
|
122
|
+
initOptions: resolvedInitOptions,
|
|
123
|
+
scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptUrl, 'https://www.redditstatic.com/ads/pixel.js')
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function getRedditPixelInitOptions({ initOptions, disableFirstPartyCookies }) {
|
|
127
|
+
if (void 0 === disableFirstPartyCookies) return initOptions;
|
|
128
|
+
return {
|
|
129
|
+
...initOptions,
|
|
130
|
+
disableFirstPartyCookies
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const redditPixelEvent = (eventName, metadata)=>{
|
|
134
|
+
if ("u" < typeof window || 'function' != typeof window.rdt) return;
|
|
135
|
+
window.rdt('track', eventName, metadata);
|
|
136
|
+
};
|
|
137
|
+
exports.redditPixel = __webpack_exports__.redditPixel;
|
|
138
|
+
exports.redditPixelEvent = __webpack_exports__.redditPixelEvent;
|
|
139
|
+
exports.redditPixelManifest = __webpack_exports__.redditPixelManifest;
|
|
140
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
141
|
+
"redditPixel",
|
|
142
|
+
"redditPixelEvent",
|
|
143
|
+
"redditPixelManifest"
|
|
144
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
145
|
+
Object.defineProperty(exports, '__esModule', {
|
|
146
|
+
value: true
|
|
147
|
+
});
|