@codecademy/tracking 1.0.27-alpha.e7f59a4fa4.0 → 1.0.27

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.
@@ -112,6 +112,7 @@ export type TrackingContentIds = {
112
112
  skill_benchmark_id?: string;
113
113
  track_id?: string;
114
114
  journey_id?: string;
115
+ external_course_id?: string;
115
116
  };
116
117
  /**
117
118
  * Shared data relevant for all user events
@@ -1,7 +1,6 @@
1
1
  import { conditionallyLoadAnalytics } from './conditionallyLoadAnalytics';
2
2
  import { fetchDestinationsForWriteKey } from './fetchDestinationsForWriteKey';
3
3
  import { getConsentDecision } from './getConsentDecision';
4
- import { setGoogleConsentDefaults } from './googleConsent';
5
4
  import { mapDestinations } from './mapDestinations';
6
5
  import { initializeOneTrust } from './onetrust';
7
6
  import { runSegmentSnippet } from './runSegmentSnippet';
@@ -17,10 +16,6 @@ export const initializeTrackingIntegrations = async _ref => {
17
16
  writeKey = _ref.writeKey;
18
17
  // 1. Wait 1000ms to allow any other post-hydration logic to run first
19
18
  await new Promise(resolve => setTimeout(resolve, 1000));
20
- setGoogleConsentDefaults({
21
- scope,
22
- optedOutExternalTracking
23
- });
24
19
 
25
20
  // 2. Load in OneTrust's banner and wait for its `OptanonWrapper` callback
26
21
  await initializeOneTrust({
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.27-alpha.e7f59a4fa4.0",
4
+ "version": "1.0.27",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "files": [
7
7
  "dist/**"
@@ -13,5 +13,5 @@
13
13
  "access": "public"
14
14
  },
15
15
  "repository": "git@github.com:codecademy-engineering/mono.git",
16
- "gitHead": "83756b6597c5e8076d3314d8eac9db8e9d3c0160"
16
+ "gitHead": "be0afb63c6e7ed6617aa0fda4bede76e6949456c"
17
17
  }
@@ -1,5 +0,0 @@
1
- import { TrackingWindow } from './types';
2
- export declare function setGoogleConsentDefaults({ scope, optedOutExternalTracking, }: {
3
- scope: TrackingWindow;
4
- optedOutExternalTracking?: boolean;
5
- }): void;
@@ -1,49 +0,0 @@
1
- export function setGoogleConsentDefaults(_ref) {
2
- var _scope$dataLayer;
3
- let scope = _ref.scope,
4
- optedOutExternalTracking = _ref.optedOutExternalTracking;
5
- (_scope$dataLayer = scope.dataLayer) !== null && _scope$dataLayer !== void 0 ? _scope$dataLayer : scope.dataLayer = [];
6
-
7
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- function gtag() {
9
- var _scope$dataLayer2;
10
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
11
- _args[_key] = arguments[_key];
12
- }
13
- (_scope$dataLayer2 = scope.dataLayer) === null || _scope$dataLayer2 === void 0 ? void 0 : _scope$dataLayer2.push(arguments);
14
- }
15
- if (optedOutExternalTracking) {
16
- gtag('consent', 'default', {
17
- ad_storage: 'denied',
18
- analytics_storage: 'denied',
19
- functionality_storage: 'denied',
20
- personalization_storage: 'denied',
21
- security_storage: 'granted',
22
- ad_user_data: 'denied',
23
- ad_personalization: 'denied',
24
- wait_for_update: 1200
25
- });
26
- } else {
27
- gtag('consent', 'default', {
28
- ad_storage: 'granted',
29
- analytics_storage: 'granted',
30
- functionality_storage: 'granted',
31
- personalization_storage: 'granted',
32
- security_storage: 'granted',
33
- ad_user_data: 'granted',
34
- ad_personalization: 'granted',
35
- wait_for_update: 1200
36
- });
37
- }
38
- gtag('consent', 'default', {
39
- ad_storage: 'denied',
40
- analytics_storage: 'denied',
41
- functionality_storage: 'denied',
42
- personalization_storage: 'denied',
43
- security_storage: 'granted',
44
- ad_user_data: 'denied',
45
- ad_personalization: 'denied',
46
- wait_for_update: 1200,
47
- region: ['DE', 'NO', 'BE', 'FI', 'PT', 'BG', 'DK', 'LT', 'LU', 'LV', 'HR', 'FR', 'HU', 'SE', 'MC', 'SI', 'SK', 'MF', 'SM', 'GB', 'YT', 'IE', 'GF', 'EE', 'MQ', 'MT', 'GP', 'IS', 'GR', 'IT', 'ES', 'RE', 'AT', 'CY', 'CZ', 'AX', 'PL', 'RO', 'LI', 'NL']
48
- });
49
- }