@codecademy/tracking 1.0.45 → 1.0.46-alpha.24afd9bda1.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/dist/events/track.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
-
function _defineProperty(
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
function _slicedToArray(
|
|
6
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
7
7
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
function _unsupportedIterableToArray(
|
|
9
|
-
function _arrayLikeToArray(
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
10
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
-
function _arrayWithHoles(
|
|
11
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12
12
|
import { getClientType } from '../integrations/device';
|
|
13
13
|
const browserSupportsKeepalive = () => 'keepalive' in window.Request.prototype;
|
|
14
14
|
export const createTracker = _ref => {
|
|
@@ -32,7 +32,7 @@ export const createTracker = _ref => {
|
|
|
32
32
|
if (navigator.sendBeacon && navigator.sendBeacon(uri, form)) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
} catch {
|
|
35
|
+
} catch (_unused) {
|
|
36
36
|
// Even with the proper scoping, Chrome 79-80 still gives "Illegal invocation" crashes. Sigh.
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -74,7 +74,7 @@ export const createTracker = _ref => {
|
|
|
74
74
|
client: getClientType()
|
|
75
75
|
}) : userData;
|
|
76
76
|
if (verbose) {
|
|
77
|
-
console.groupCollapsed(
|
|
77
|
+
console.groupCollapsed("%cTracking Event Fired: ".concat(category, ":").concat(event), 'color: #4b35ef; font-style: italic;');
|
|
78
78
|
console.log({
|
|
79
79
|
category,
|
|
80
80
|
event,
|
|
@@ -90,14 +90,14 @@ export const createTracker = _ref => {
|
|
|
90
90
|
if (typeof window !== 'undefined') {
|
|
91
91
|
// This allows the UTM query params to get registered in the user session.
|
|
92
92
|
const queryParams = window.location.search;
|
|
93
|
-
beacon(
|
|
93
|
+
beacon("".concat(basePath, "/").concat(category).concat(queryParams), {
|
|
94
94
|
category,
|
|
95
95
|
event,
|
|
96
96
|
properties: JSON.stringify(properties),
|
|
97
|
-
gdpr_safe:
|
|
97
|
+
gdpr_safe: "".concat(options.gdprSafe)
|
|
98
98
|
});
|
|
99
99
|
} else {
|
|
100
|
-
serverSideBeacon(
|
|
100
|
+
serverSideBeacon("".concat(basePath, "/").concat(category), {
|
|
101
101
|
category,
|
|
102
102
|
event,
|
|
103
103
|
properties: JSON.stringify(properties)
|
|
@@ -110,7 +110,8 @@ export const createTracker = _ref => {
|
|
|
110
110
|
impression: data => event('user', 'impression', data),
|
|
111
111
|
visit: data => event('user', 'visit', data),
|
|
112
112
|
pushDataLayerEvent: eventName => {
|
|
113
|
-
|
|
113
|
+
var _ref6;
|
|
114
|
+
((_ref6 = window).dataLayer || (_ref6.dataLayer = [])).push({
|
|
114
115
|
event: eventName
|
|
115
116
|
});
|
|
116
117
|
}
|
package/dist/events/user.js
CHANGED
package/dist/integrations/gtm.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export const OPT_OUT_DATALAYER_VAR = 'user_opted_out_external_tracking';
|
|
2
2
|
export const initializeGTM = _ref => {
|
|
3
|
+
var _scope$dataLayer;
|
|
3
4
|
let scope = _ref.scope,
|
|
4
5
|
environment = _ref.environment,
|
|
5
6
|
optedOutExternalTracking = _ref.optedOutExternalTracking,
|
|
6
7
|
enablePartytown = _ref.enablePartytown;
|
|
7
|
-
scope.dataLayer
|
|
8
|
+
(_scope$dataLayer = scope.dataLayer) !== null && _scope$dataLayer !== void 0 ? _scope$dataLayer : scope.dataLayer = [];
|
|
8
9
|
scope.dataLayer.push({
|
|
9
10
|
'gtm.start': new Date().getTime(),
|
|
10
11
|
event: 'gtm.js'
|
|
@@ -21,7 +22,7 @@ export const initializeGTM = _ref => {
|
|
|
21
22
|
preview_env = '>m_auth=VrQuCDuWXkLlTwNHJYEKTg>m_preview=env-232';
|
|
22
23
|
}
|
|
23
24
|
const gtm = document.createElement('script');
|
|
24
|
-
gtm.src =
|
|
25
|
+
gtm.src = "https://www.googletagmanager.com/gtm.js?id=GTM-KTLK85W".concat(preview_env);
|
|
25
26
|
if (enablePartytown) {
|
|
26
27
|
gtm.type = 'text/partytown';
|
|
27
28
|
} else {
|
|
@@ -11,15 +11,15 @@ export const initializeOneTrust = async _ref => {
|
|
|
11
11
|
script.setAttribute('async', 'true');
|
|
12
12
|
script.setAttribute('src', 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js');
|
|
13
13
|
script.setAttribute('type', 'text/javascript');
|
|
14
|
-
script.setAttribute('data-domain-script',
|
|
14
|
+
script.setAttribute('data-domain-script', "".concat(scriptId).concat(environment === 'production' ? '' : '-test'));
|
|
15
15
|
document.body.appendChild(script);
|
|
16
16
|
const style = document.createElement('style');
|
|
17
17
|
style.textContent = rawStyles;
|
|
18
18
|
document.body.appendChild(style);
|
|
19
19
|
return new Promise(resolve => {
|
|
20
20
|
scope.OptanonWrapper = () => {
|
|
21
|
-
var _script$parentNode;
|
|
22
|
-
scope.dataLayer
|
|
21
|
+
var _scope$dataLayer, _script$parentNode;
|
|
22
|
+
(_scope$dataLayer = scope.dataLayer) !== null && _scope$dataLayer !== void 0 ? _scope$dataLayer : scope.dataLayer = [];
|
|
23
23
|
scope.dataLayer.push({
|
|
24
24
|
event: 'OneTrustGroupsUpdated'
|
|
25
25
|
});
|
|
@@ -31,181 +31,4 @@ export const initializeOneTrust = async _ref => {
|
|
|
31
31
|
|
|
32
32
|
// For now, these three values duplicate theme colors from gamut-styles
|
|
33
33
|
// We don't want to take a full dependency on that package here...
|
|
34
|
-
const rawStyles =
|
|
35
|
-
:root {
|
|
36
|
-
--onetrust-brand-purple: #3A10E5;
|
|
37
|
-
--onetrust-color-gray-500: #828285;
|
|
38
|
-
--onetrust-color-white: #fff;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
#onetrust-banner-sdk {
|
|
42
|
-
padding: 1rem !important;
|
|
43
|
-
}
|
|
44
|
-
#onetrust-banner-sdk > .ot-sdk-container {
|
|
45
|
-
width: 100% !important;
|
|
46
|
-
}
|
|
47
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {
|
|
48
|
-
display: flex !important;
|
|
49
|
-
flex-direction: column !important;
|
|
50
|
-
align-items: center !important;
|
|
51
|
-
max-width: 1436px !important;
|
|
52
|
-
margin: 0 auto !important;
|
|
53
|
-
}
|
|
54
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row:after {
|
|
55
|
-
content: none !important;
|
|
56
|
-
}
|
|
57
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {
|
|
58
|
-
display: flex !important;
|
|
59
|
-
flex-direction: column !important;
|
|
60
|
-
align-items: center !important;
|
|
61
|
-
max-width: 1436px !important;
|
|
62
|
-
margin: 0 auto !important;
|
|
63
|
-
}
|
|
64
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row:after {
|
|
65
|
-
content: none !important;
|
|
66
|
-
}
|
|
67
|
-
#onetrust-group-container {
|
|
68
|
-
display: flex !important;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
float: none !important;
|
|
71
|
-
width: 100% !important;
|
|
72
|
-
max-width: 1148px !important;
|
|
73
|
-
margin-left: 0 !important;
|
|
74
|
-
margin-bottom: 0.625rem !important;
|
|
75
|
-
}
|
|
76
|
-
#onetrust-policy,
|
|
77
|
-
#onetrust-policy-text {
|
|
78
|
-
margin: 0 !important;
|
|
79
|
-
font-size: 0.875rem !important;
|
|
80
|
-
line-height: 1.375rem !important;
|
|
81
|
-
text-align: center !important;
|
|
82
|
-
float: none !important;
|
|
83
|
-
}
|
|
84
|
-
#onetrust-policy-text a {
|
|
85
|
-
text-decoration: none;
|
|
86
|
-
line-height: 26px !important;
|
|
87
|
-
margin-left: 0 !important;
|
|
88
|
-
}
|
|
89
|
-
#onetrust-button-group-parent {
|
|
90
|
-
position: relative !important;
|
|
91
|
-
top: initial !important;
|
|
92
|
-
left: initial !important;
|
|
93
|
-
transform: initial !important;
|
|
94
|
-
width: 264px !important;
|
|
95
|
-
margin: 0 !important;
|
|
96
|
-
padding: 0 !important;
|
|
97
|
-
float: none !important;
|
|
98
|
-
}
|
|
99
|
-
#onetrust-button-group {
|
|
100
|
-
display: flex !important;
|
|
101
|
-
margin: 0 !important;
|
|
102
|
-
}
|
|
103
|
-
#onetrust-pc-btn-handler, #onetrust-accept-btn-handler {
|
|
104
|
-
min-width: initial !important;
|
|
105
|
-
padding: 0.375rem 1rem !important;
|
|
106
|
-
margin: 0 !important;
|
|
107
|
-
opacity: 1 !important;
|
|
108
|
-
border-radius: 2px !important;
|
|
109
|
-
line-height: 1.5 !important;
|
|
110
|
-
user-select: none !important;
|
|
111
|
-
font-size: 1rem !important;
|
|
112
|
-
}
|
|
113
|
-
#onetrust-pc-btn-handler:focus, #onetrust-accept-btn-handler:focus {
|
|
114
|
-
box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);
|
|
115
|
-
text-decoration: none !important;
|
|
116
|
-
outline: none !important;
|
|
117
|
-
}
|
|
118
|
-
#onetrust-pc-btn-handler{
|
|
119
|
-
color: var(--onetrust-brand-purple) !important;
|
|
120
|
-
border: 1px solid var(--onetrust-brand-purple)!important;
|
|
121
|
-
background: var(--onetrust-color-white) !important
|
|
122
|
-
}
|
|
123
|
-
#onetrust-accept-btn-handler {
|
|
124
|
-
color: var(--onetrust-color-white) !important;
|
|
125
|
-
background: var(--onetrust-brand-purple)!important;
|
|
126
|
-
margin-left: 1rem !important;
|
|
127
|
-
}
|
|
128
|
-
#onetrust-close-btn-container {
|
|
129
|
-
display: none !important;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.pc-logo {
|
|
133
|
-
display: none !important;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
#accept-recommended-btn-handler,
|
|
137
|
-
.ot-pc-refuse-all-handler,
|
|
138
|
-
.save-preference-btn-handler {
|
|
139
|
-
margin-left: 4px !important;
|
|
140
|
-
font-size: 14px !important;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
#accept-recommended-btn-handler:focus,
|
|
144
|
-
#onetrust-pc-sdk .ot-pc-refuse-all-handler:focus,
|
|
145
|
-
#onetrust-pc-sdk .save-preference-btn-handler:focus {
|
|
146
|
-
box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);
|
|
147
|
-
text-decoration: none !important;
|
|
148
|
-
outline: none !important;
|
|
149
|
-
opacity: 1 !important;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.ot-switch-label {
|
|
153
|
-
border: 1px solid var(--onetrust-color-gray-500) !important;
|
|
154
|
-
background-color: var(--onetrust-color-gray-500) !important;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.ot-switch-nob {
|
|
158
|
-
background: var(--onetrust-color-white) !important;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.ot-switch-inner:before {
|
|
162
|
-
background-color: var(--onetrust-brand-purple) !important;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.switch-checkbox:checked+.ot-switch-label .ot-switch-nob {
|
|
166
|
-
border-color: var(--onetrust-brand-purple) !important;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.ot-pc-footer-logo {
|
|
170
|
-
display: none !important;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
#onetrust-banner-sdk>.ot-sdk-container {
|
|
174
|
-
overflow: visible !important;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
@media (max-width: 30rem) {
|
|
178
|
-
#accept-recommended-btn-handler,
|
|
179
|
-
.ot-pc-refuse-all-handler,
|
|
180
|
-
.save-preference-btn-handler {
|
|
181
|
-
width: 96% !important;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
@media (min-width: 37.5rem) {
|
|
186
|
-
#onetrust-banner-sdk {
|
|
187
|
-
padding: 0.875rem 1rem !important;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
@media (min-width: 48rem) {
|
|
191
|
-
#onetrust-banner-sdk {
|
|
192
|
-
padding: 0.875rem 1.25rem !important;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
@media (min-width: 1650px) {
|
|
196
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {
|
|
197
|
-
flex-direction: row !important;
|
|
198
|
-
justify-content: space-between !important;
|
|
199
|
-
}
|
|
200
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {
|
|
201
|
-
flex-direction: row !important;
|
|
202
|
-
justify-content: space-between !important;
|
|
203
|
-
}
|
|
204
|
-
#onetrust-group-container {
|
|
205
|
-
margin-bottom: 0 !important;
|
|
206
|
-
}
|
|
207
|
-
#onetrust-button-group {
|
|
208
|
-
flex-direction: row !important;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
`;
|
|
34
|
+
const rawStyles = "\n:root {\n --onetrust-brand-purple: #3A10E5;\n --onetrust-color-gray-500: #828285;\n --onetrust-color-white: #fff;\n}\n\n#onetrust-banner-sdk {\n padding: 1rem !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container {\n width: 100% !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n max-width: 1436px !important;\n margin: 0 auto !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row:after {\n content: none !important;\n}\n#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n max-width: 1436px !important;\n margin: 0 auto !important;\n}\n#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row:after {\n content: none !important;\n}\n#onetrust-group-container {\n display: flex !important;\n justify-content: center;\n float: none !important;\n width: 100% !important;\n max-width: 1148px !important;\n margin-left: 0 !important;\n margin-bottom: 0.625rem !important;\n}\n\n#onetrust-policy,\n#onetrust-policy-text {\n margin: 0 !important;\n font-size: 0.875rem !important;\n line-height: 1.375rem !important;\n text-align: center !important;\n float: none !important;\n}\n#onetrust-policy-text a {\n text-decoration: none;\n line-height: 26px !important;\n margin-left: 0 !important;\n}\n#onetrust-button-group-parent {\n position: relative !important;\n top: initial !important;\n left: initial !important;\n transform: initial !important;\n width: 264px !important;\n margin: 0 !important;\n padding: 0 !important;\n float: none !important;\n}\n#onetrust-button-group {\n display: flex !important;\n margin: 0 !important;\n}\n#onetrust-pc-btn-handler, #onetrust-accept-btn-handler {\n min-width: initial !important;\n padding: 0.375rem 1rem !important;\n margin: 0 !important;\n opacity: 1 !important;\n border-radius: 2px !important;\n line-height: 1.5 !important;\n user-select: none !important;\n font-size: 1rem !important;\n}\n#onetrust-pc-btn-handler:focus, #onetrust-accept-btn-handler:focus {\n box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);\n text-decoration: none !important;\n outline: none !important;\n}\n#onetrust-pc-btn-handler{\n color: var(--onetrust-brand-purple) !important;\n border: 1px solid var(--onetrust-brand-purple)!important;\n background: var(--onetrust-color-white) !important\n}\n#onetrust-accept-btn-handler {\n color: var(--onetrust-color-white) !important;\n background: var(--onetrust-brand-purple)!important;\n margin-left: 1rem !important;\n}\n#onetrust-close-btn-container {\n display: none !important;\n}\n\n.pc-logo {\n display: none !important;\n}\n\n#accept-recommended-btn-handler,\n.ot-pc-refuse-all-handler,\n.save-preference-btn-handler {\n margin-left: 4px !important;\n font-size: 14px !important;\n}\n\n#accept-recommended-btn-handler:focus,\n#onetrust-pc-sdk .ot-pc-refuse-all-handler:focus,\n#onetrust-pc-sdk .save-preference-btn-handler:focus {\n box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);\n text-decoration: none !important;\n outline: none !important;\n opacity: 1 !important;\n}\n\n.ot-switch-label {\n border: 1px solid var(--onetrust-color-gray-500) !important;\n background-color: var(--onetrust-color-gray-500) !important;\n}\n\n.ot-switch-nob {\n background: var(--onetrust-color-white) !important;\n}\n\n.ot-switch-inner:before {\n background-color: var(--onetrust-brand-purple) !important;\n}\n\n.switch-checkbox:checked+.ot-switch-label .ot-switch-nob {\n border-color: var(--onetrust-brand-purple) !important;\n}\n\n.ot-pc-footer-logo {\n display: none !important;\n}\n\n#onetrust-banner-sdk>.ot-sdk-container {\n overflow: visible !important;\n}\n\n#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus + .ot-switch-label {\n \toutline-color: var(--onetrust-brand-purple) !important;\n}\n#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus+.ot-switch-label {\n outline-width: 3px !important;\n outline-offset: 2px !important;\n}\n\n@media (max-width: 30rem) {\n #accept-recommended-btn-handler,\n .ot-pc-refuse-all-handler,\n .save-preference-btn-handler {\n width: 96% !important;\n }\n}\n\n@media (min-width: 37.5rem) {\n #onetrust-banner-sdk {\n padding: 0.875rem 1rem !important;\n }\n}\n@media (min-width: 48rem) {\n #onetrust-banner-sdk {\n padding: 0.875rem 1.25rem !important;\n }\n}\n@media (min-width: 1650px) {\n #onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {\n flex-direction: row !important;\n justify-content: space-between !important;\n }\n #onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {\n flex-direction: row !important;\n justify-content: space-between !important;\n }\n #onetrust-group-container {\n margin-bottom: 0 !important;\n }\n #onetrust-button-group {\n flex-direction: row !important;\n }\n}\n";
|
|
@@ -30,14 +30,14 @@ export const partytownConfig = () => ({
|
|
|
30
30
|
* see https://partytown.builder.io/facebook-pixel#proxy-requests
|
|
31
31
|
*/
|
|
32
32
|
if (url.hostname === 'connect.facebook.net') {
|
|
33
|
-
return new URL(
|
|
33
|
+
return new URL("partytown-fb".concat(url.pathname).concat(url.search), location.origin);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
37
|
* Proxy Reddit Pixel requests to resolve CORS issues
|
|
38
38
|
*/
|
|
39
39
|
if (url.hostname === 'www.redditstatic.com') {
|
|
40
|
-
return new URL(
|
|
40
|
+
return new URL("partytown-reddit".concat(url.pathname).concat(url.search), location.origin);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/*
|
|
@@ -49,21 +49,21 @@ export const partytownConfig = () => ({
|
|
|
49
49
|
// Google Ads returns a redirect if path has a trailing slash
|
|
50
50
|
p = p.slice(0, -1);
|
|
51
51
|
}
|
|
52
|
-
return new URL(
|
|
52
|
+
return new URL("partytown-googleads".concat(p).concat(url.search), location.origin);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
56
|
* Proxy Bing requests to resolve CORS issues
|
|
57
57
|
*/
|
|
58
58
|
if (url.hostname === 'bat.bing.com') {
|
|
59
|
-
return new URL(
|
|
59
|
+
return new URL("partytown-bing".concat(url.pathname).concat(url.search), location.origin);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/*
|
|
63
63
|
* Proxy YouTube requests to resolve CORS issues
|
|
64
64
|
*/
|
|
65
65
|
if (url.hostname === 'www.youtube.com') {
|
|
66
|
-
return new URL(
|
|
66
|
+
return new URL("partytown-youtube".concat(url.pathname).concat(url.search), location.origin);
|
|
67
67
|
}
|
|
68
68
|
return url;
|
|
69
69
|
}
|
|
@@ -3,7 +3,7 @@ import { partytownConfig } from './config';
|
|
|
3
3
|
import { gtmDoubleFrame } from './gtmDoubleFrame';
|
|
4
4
|
|
|
5
5
|
// Encapsulate to avoid collision of global vars aliased in minification.
|
|
6
|
-
const encapsulate = js =>
|
|
6
|
+
const encapsulate = js => "(() => {".concat(js, "})();");
|
|
7
7
|
export function initializePartytown() {
|
|
8
8
|
const ptScript = document.createElement('script');
|
|
9
9
|
ptScript.innerHTML = encapsulate(partytownSnippet(partytownConfig()));
|
|
@@ -19,6 +19,6 @@ export function initializePartytown() {
|
|
|
19
19
|
* restore the style (and remove the added whitespace).
|
|
20
20
|
*/
|
|
21
21
|
const styles = document.createElement('style');
|
|
22
|
-
styles.innerText =
|
|
22
|
+
styles.innerText = "body > img[aria-hidden=true] { position: absolute; }";
|
|
23
23
|
document.head.appendChild(styles);
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/tracking",
|
|
3
3
|
"description": "Tracking library for Codecademy",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.46-alpha.24afd9bda1.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@qwik.dev/partytown": "0.11.0"
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"repository": "git@github.com:codecademy-engineering/mono.git",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "d84f814f39e269849587ec1d6dd6289f1dbdc4a3"
|
|
20
20
|
}
|