@codecademy/tracking 1.0.40-alpha.2356cfd260.0 → 1.0.40

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.
@@ -18,7 +18,7 @@ export const initializeTrackingIntegrations = async _ref => {
18
18
  initializePartytown();
19
19
  } else {
20
20
  // Wait to allow any other post-hydration logic to run first
21
- await new Promise(resolve => setTimeout(resolve, 250));
21
+ await new Promise(resolve => setTimeout(resolve, 1000));
22
22
  }
23
23
 
24
24
  // Load in OneTrust's banner and wait for its `OptanonWrapper` callback
@@ -7,11 +7,7 @@ export const partytownConfig = () => ({
7
7
  ],
8
8
  lib: '/partytown/',
9
9
  // path for loading from static asset CMS
10
- loadScriptsOnMainThread: [/googleads/,
11
- // Google Ads
12
- /bing/,
13
- // Bing UET
14
- /pepperjam/,
10
+ loadScriptsOnMainThread: [/pepperjam/,
15
11
  // Pepperjam
16
12
  /snap/,
17
13
  // Snap Pixel
@@ -34,6 +30,32 @@ export const partytownConfig = () => ({
34
30
  if (url.hostname === 'connect.facebook.net') {
35
31
  return new URL(`partytown-fb${url.pathname}${url.search}`, location.origin);
36
32
  }
33
+
34
+ /*
35
+ * Proxy Reddit Pixel requests to resolve CORS issues
36
+ */
37
+ if (url.hostname === 'www.redditstatic.com') {
38
+ return new URL(`partytown-reddit${url.pathname}${url.search}`, location.origin);
39
+ }
40
+
41
+ /*
42
+ * Proxy Google Ads requests to resolve CORS issues
43
+ */
44
+ if (url.hostname === 'googleads.g.doubleclick.net') {
45
+ let p = url.pathname;
46
+ if (p.endsWith('/')) {
47
+ // Google Ads returns a redirect if path has a trailing slash
48
+ p = p.slice(0, -1);
49
+ }
50
+ return new URL(`partytown-googleads${p}${url.search}`, location.origin);
51
+ }
52
+
53
+ /*
54
+ * Proxy Bing requests to resolve CORS issues
55
+ */
56
+ if (url.hostname === 'bat.bing.com') {
57
+ return new URL(`partytown-bing${url.pathname}${url.search}`, location.origin);
58
+ }
37
59
  return url;
38
60
  }
39
61
  });
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.40-alpha.2356cfd260.0",
4
+ "version": "1.0.40",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@builder.io/partytown": "^0.10.2"
@@ -16,5 +16,5 @@
16
16
  "access": "public"
17
17
  },
18
18
  "repository": "git@github.com:codecademy-engineering/mono.git",
19
- "gitHead": "0072f3637e216aa687da8995e1ef390dd1d5478f"
19
+ "gitHead": "3352705c26c4b58e62750a764f0d16abb44551ba"
20
20
  }