@cuemath/web-utils 1.0.29-beta.11 → 1.0.29-beta.3
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/cjs/ab-experiment/utils/experiments.js +11 -3
- package/dist/cjs/ab-experiment/utils/experiments.js.map +1 -1
- package/dist/cjs/analytics/index.d.ts +0 -1
- package/dist/cjs/analytics/index.js +0 -1
- package/dist/cjs/analytics/index.js.map +1 -1
- package/dist/cjs/constants/index.d.ts +0 -1
- package/dist/cjs/constants/index.js +0 -1
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/growth-source/index.d.ts +3 -10
- package/dist/cjs/growth-source/index.js +103 -50
- package/dist/cjs/growth-source/index.js.map +1 -1
- package/dist/cjs/growth-source/types.d.ts +2 -17
- package/dist/cjs/website-category/constants/index.d.ts +1 -3
- package/dist/cjs/website-category/constants/index.js +25 -110
- package/dist/cjs/website-category/constants/index.js.map +1 -1
- package/dist/cjs/website-category/index.d.ts +2 -3
- package/dist/cjs/website-category/index.js +2 -6
- package/dist/cjs/website-category/index.js.map +1 -1
- package/dist/cjs/website-category/utils/index.d.ts +1 -1
- package/dist/cjs/website-category/utils/index.js +15 -6
- package/dist/cjs/website-category/utils/index.js.map +1 -1
- package/dist/esm/ab-experiment/utils/experiments.js +12 -4
- package/dist/esm/ab-experiment/utils/experiments.js.map +1 -1
- package/dist/esm/analytics/index.d.ts +0 -1
- package/dist/esm/analytics/index.js +0 -1
- package/dist/esm/analytics/index.js.map +1 -1
- package/dist/esm/constants/index.d.ts +0 -1
- package/dist/esm/constants/index.js +0 -1
- package/dist/esm/constants/index.js.map +1 -1
- package/dist/esm/growth-source/index.d.ts +3 -10
- package/dist/esm/growth-source/index.js +93 -36
- package/dist/esm/growth-source/index.js.map +1 -1
- package/dist/esm/growth-source/types.d.ts +2 -17
- package/dist/esm/website-category/constants/index.d.ts +1 -3
- package/dist/esm/website-category/constants/index.js +24 -109
- package/dist/esm/website-category/constants/index.js.map +1 -1
- package/dist/esm/website-category/index.d.ts +2 -3
- package/dist/esm/website-category/index.js +2 -3
- package/dist/esm/website-category/index.js.map +1 -1
- package/dist/esm/website-category/utils/index.d.ts +1 -1
- package/dist/esm/website-category/utils/index.js +13 -4
- package/dist/esm/website-category/utils/index.js.map +1 -1
- package/package.json +2 -5
- package/dist/cjs/analytics/data-props.d.ts +0 -3
- package/dist/cjs/analytics/data-props.js +0 -20
- package/dist/cjs/analytics/data-props.js.map +0 -1
- package/dist/cjs/constants/instrumentation/index.d.ts +0 -5
- package/dist/cjs/constants/instrumentation/index.js +0 -9
- package/dist/cjs/constants/instrumentation/index.js.map +0 -1
- package/dist/cjs/data/utm-source.json +0 -52
- package/dist/cjs/growth-source/scripts/source-channel.d.ts +0 -1
- package/dist/cjs/growth-source/scripts/source-channel.js +0 -44
- package/dist/cjs/growth-source/scripts/source-channel.js.map +0 -1
- package/dist/cjs/website-category/constants/instrumentation.d.ts +0 -138
- package/dist/cjs/website-category/constants/instrumentation.js +0 -142
- package/dist/cjs/website-category/constants/instrumentation.js.map +0 -1
- package/dist/cjs/website-category/utils/instrumentation.d.ts +0 -2
- package/dist/cjs/website-category/utils/instrumentation.js +0 -61
- package/dist/cjs/website-category/utils/instrumentation.js.map +0 -1
- package/dist/esm/analytics/data-props.d.ts +0 -3
- package/dist/esm/analytics/data-props.js +0 -17
- package/dist/esm/analytics/data-props.js.map +0 -1
- package/dist/esm/constants/instrumentation/index.d.ts +0 -5
- package/dist/esm/constants/instrumentation/index.js +0 -6
- package/dist/esm/constants/instrumentation/index.js.map +0 -1
- package/dist/esm/data/utm-source.json +0 -52
- package/dist/esm/growth-source/scripts/source-channel.d.ts +0 -1
- package/dist/esm/growth-source/scripts/source-channel.js +0 -44
- package/dist/esm/growth-source/scripts/source-channel.js.map +0 -1
- package/dist/esm/website-category/constants/instrumentation.d.ts +0 -138
- package/dist/esm/website-category/constants/instrumentation.js +0 -139
- package/dist/esm/website-category/constants/instrumentation.js.map +0 -1
- package/dist/esm/website-category/utils/instrumentation.d.ts +0 -2
- package/dist/esm/website-category/utils/instrumentation.js +0 -56
- package/dist/esm/website-category/utils/instrumentation.js.map +0 -1
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.INTENT_PAGES = exports.BRAND_PAGES = exports.isBrandOrIntentPage = void 0;
|
|
4
4
|
var utils_1 = require("./utils");
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "isBrandOrIntentPage", { enumerable: true, get: function () { return utils_1.isBrandOrIntentPage; } });
|
|
6
6
|
var constants_1 = require("./constants");
|
|
7
7
|
Object.defineProperty(exports, "BRAND_PAGES", { enumerable: true, get: function () { return constants_1.BRAND_PAGES; } });
|
|
8
8
|
Object.defineProperty(exports, "INTENT_PAGES", { enumerable: true, get: function () { return constants_1.INTENT_PAGES; } });
|
|
9
|
-
Object.defineProperty(exports, "SUPPLY_PAGES", { enumerable: true, get: function () { return constants_1.SUPPLY_PAGES; } });
|
|
10
|
-
Object.defineProperty(exports, "REFERRAL_PAGES", { enumerable: true, get: function () { return constants_1.REFERRAL_PAGES; } });
|
|
11
|
-
var instrumentation_1 = require("./utils/instrumentation");
|
|
12
|
-
Object.defineProperty(exports, "getSubRevenueChannel", { enumerable: true, get: function () { return instrumentation_1.getSubRevenueChannel; } });
|
|
13
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/website-category/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/website-category/index.ts"],"names":[],"mappings":";;;AAAA,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA;AAC5B,yCAAwD;AAA/C,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const isBrandOrIntentPage: (path: string) => boolean;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.isBrandOrIntentPage = void 0;
|
|
4
|
+
const url_parser_1 = require("../../url-parser");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const isBrandOrIntentPage = (path) => {
|
|
7
|
+
if (path === '/') {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
const urlWithoutTrailingSlash = (0, url_parser_1.removeTrailingSlashFromPath)(path);
|
|
11
|
+
const isBrandPage = constants_1.BRAND_PAGES.some(pagePath => pagePath === '/' ? false : urlWithoutTrailingSlash.includes(pagePath));
|
|
12
|
+
const isIntentPage = constants_1.INTENT_PAGES.some(pagePath => pagePath === '/' ? false : urlWithoutTrailingSlash.includes(pagePath));
|
|
13
|
+
if (isBrandPage || isIntentPage) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
8
17
|
};
|
|
9
|
-
exports.
|
|
18
|
+
exports.isBrandOrIntentPage = isBrandOrIntentPage;
|
|
10
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/website-category/utils/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/website-category/utils/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+D;AAC/D,4CAAyD;AAElD,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAClD,IAAI,IAAI,KAAK,GAAG,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,uBAAuB,GAAG,IAAA,wCAA2B,EAAC,IAAI,CAAC,CAAC;IAElE,MAAM,WAAW,GAAG,uBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAC9C,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACtE,CAAC;IACF,MAAM,YAAY,GAAG,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAChD,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACtE,CAAC;IAEF,IAAI,WAAW,IAAI,YAAY,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISO_COUNTRY_CODE, MIDDLE_EAST_COUNTRIES, BEST_PERFORMING_COHORT_ROW_COUNTRIES, NON_FOCUSED_ROW_COUNTRIES, EUROPEAN_COUNTRIES, } from '../../constants/country';
|
|
2
|
-
import {
|
|
2
|
+
import { isBrandOrIntentPage } from '../../website-category';
|
|
3
3
|
import { EXPERIMENT_KEYS, VARIANTS } from '../constants/index';
|
|
4
4
|
export const EXPERIMENTS = [
|
|
5
5
|
{
|
|
@@ -65,12 +65,20 @@ export const EXPERIMENTS = [
|
|
|
65
65
|
if ([ISO_COUNTRY_CODE.INDIA].includes(countryCode)) {
|
|
66
66
|
return [
|
|
67
67
|
{
|
|
68
|
-
id: VARIANTS.
|
|
68
|
+
id: VARIANTS.CONTROL_VARIANT,
|
|
69
69
|
weight: 0,
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
id: VARIANTS.VARIANT_AF,
|
|
73
|
+
weight: 20,
|
|
74
|
+
},
|
|
71
75
|
{
|
|
72
76
|
id: VARIANTS.VARIANT_W,
|
|
73
|
-
weight:
|
|
77
|
+
weight: 80,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: VARIANTS.VARIANT_AD,
|
|
81
|
+
weight: 0,
|
|
74
82
|
},
|
|
75
83
|
];
|
|
76
84
|
}
|
|
@@ -116,7 +124,7 @@ export const EXPERIMENTS = [
|
|
|
116
124
|
},
|
|
117
125
|
customFilter(path, countryCode) {
|
|
118
126
|
if (countryCode === ISO_COUNTRY_CODE.INDIA) {
|
|
119
|
-
return
|
|
127
|
+
return isBrandOrIntentPage(path) || false;
|
|
120
128
|
}
|
|
121
129
|
return true;
|
|
122
130
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../../../src/ab-experiment/utils/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oCAAoC,EACpC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../../../src/ab-experiment/utils/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oCAAoC,EACpC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI/D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,eAAe,CAAC,IAAI;QAC1B,QAAQ;YACN,OAAO;gBACL;oBACE,EAAE,EAAE,QAAQ,CAAC,SAAS;oBACtB,MAAM,EAAE,GAAG;iBACZ;aACF,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,eAAe,CAAC,gBAAgB;QACtC,QAAQ,CACN,GAAW,EACX,W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gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EACjF;gBACA,OAAO;oBACL;wBACE,EAAE,EAAE,QAAQ,CAAC,eAAe;wBAC5B,MAAM,EAAE,EAAE;qBACX;oBACD;wBACE,EAAE,EAAE,QAAQ,CAAC,SAAS;wBACtB,MAAM,EAAE,EAAE;qBACX;iBACF,CAAC;aACH;YAED,OAAO;gBACL;oBACE,EAAE,EAAE,QAAQ,CAAC,eAAe;oBAC5B,MAAM,EAAE,GAAG;iBACZ;aACF,CAAC;QACJ,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analytics/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analytics/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { SourceDetails, SourceDetailsCookie, Platform, SignupFlow,
|
|
1
|
+
import type { SourceDetails, SourceDetailsCookie, Platform, SignupFlow, RevenueChannel, OrganicChannel } from './types';
|
|
2
2
|
export declare const readSourceCookie: () => SourceDetailsCookie;
|
|
3
3
|
export declare const isSourcePresent: () => boolean;
|
|
4
|
-
export declare const initSourceDetails: ({ platform, experiments, flow, affiliateChannel, offlineChannel,
|
|
4
|
+
export declare const initSourceDetails: ({ platform, experiments, flow, affiliateChannel, offlineChannel, organicChannel, performanceChannel, revenueChannel, salesProcess, guestId, landingPage, }: SourceDetails) => Promise<void>;
|
|
5
5
|
export declare const setLastPage: (pagePath: string) => Promise<void>;
|
|
6
6
|
export declare const setFlowEntryPoint: (flowEntry: string) => Promise<void>;
|
|
7
7
|
export declare const setFlow: (flow: SignupFlow) => Promise<void>;
|
|
8
|
+
export declare const setOrganicChannel: (organicChannel: OrganicChannel) => Promise<void>;
|
|
8
9
|
export declare const setRevenueChannel: (revenueChannel: RevenueChannel) => Promise<void>;
|
|
9
10
|
export declare const setSalesProcess: (salesProcess: string) => Promise<void>;
|
|
10
11
|
export declare const clearSalesProcess: () => Promise<void>;
|
|
@@ -12,11 +13,3 @@ export declare const updateGuestId: (guestId: string) => Promise<void>;
|
|
|
12
13
|
export declare const setFirstPage: (pagePath: string) => Promise<void>;
|
|
13
14
|
export declare const setPlatformChannel: (platformChannel: Platform) => Promise<void>;
|
|
14
15
|
export declare const setLandingPage: (landingPage: string) => Promise<void>;
|
|
15
|
-
export declare const setReferrer: (referrer: string) => Promise<void>;
|
|
16
|
-
export declare const setSourceChannel: (sourceChannel: string) => Promise<void>;
|
|
17
|
-
export declare const setSubPlatform: (subPlatform: string) => Promise<void>;
|
|
18
|
-
export declare const setCurrentPage: (currentPage: string) => Promise<void>;
|
|
19
|
-
export declare const setPageProfile: (pageProfile: string) => Promise<void>;
|
|
20
|
-
export declare const setSignupForm: (signupForm: SignupForm) => Promise<void>;
|
|
21
|
-
export declare const clearSignupForm: () => Promise<void>;
|
|
22
|
-
export declare const getSourceChannel: (utmSource: string) => string;
|
|
@@ -19,9 +19,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
21
|
import { createCookie, getCookie, removeCookie } from '../cookie';
|
|
22
|
-
import utmSourceSourceChannelData from '../data/utm-source.json';
|
|
23
22
|
import { removeHrefLangFromPath } from '../url-parser';
|
|
24
23
|
const SOURCE_DETAILS_COOKIE = 'source_details';
|
|
24
|
+
const UTM_PARAMS = [
|
|
25
|
+
'utm_source',
|
|
26
|
+
'utm_medium',
|
|
27
|
+
'utm_campaign',
|
|
28
|
+
'utm_term',
|
|
29
|
+
];
|
|
25
30
|
export const readSourceCookie = () => {
|
|
26
31
|
const sourceDetails = getCookie(SOURCE_DETAILS_COOKIE);
|
|
27
32
|
return sourceDetails ? JSON.parse(decodeURIComponent(sourceDetails)) : undefined;
|
|
@@ -41,12 +46,28 @@ const updateSourceCookie = (sourceDetail) => {
|
|
|
41
46
|
? Object.assign(Object.assign({}, restAttributes), sourceDetail) : Object.assign(Object.assign({}, current), sourceDetail) });
|
|
42
47
|
writeSourceCookie(updatedDetails);
|
|
43
48
|
};
|
|
44
|
-
const getRevenueChannel = (platform) => {
|
|
49
|
+
const getRevenueChannel = (platform, utmSource) => {
|
|
45
50
|
let revenueChannel = 'unknown';
|
|
46
51
|
// set defaults for WEBSITE and ASTRO
|
|
47
52
|
if (platform === 'website') {
|
|
48
53
|
revenueChannel = 'organic';
|
|
49
54
|
}
|
|
55
|
+
if (utmSource) {
|
|
56
|
+
switch (true) {
|
|
57
|
+
case /^affiliate-/.test(utmSource):
|
|
58
|
+
revenueChannel = 'affiliate';
|
|
59
|
+
break;
|
|
60
|
+
case /^offline-/.test(utmSource):
|
|
61
|
+
revenueChannel = 'offline';
|
|
62
|
+
break;
|
|
63
|
+
case /^referral-/.test(utmSource):
|
|
64
|
+
revenueChannel = 'referral';
|
|
65
|
+
break;
|
|
66
|
+
case /^performance-/.test(utmSource):
|
|
67
|
+
revenueChannel = 'performance';
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
50
71
|
return revenueChannel;
|
|
51
72
|
};
|
|
52
73
|
/*
|
|
@@ -65,47 +86,108 @@ const getFlow = (platform, experiments) => {
|
|
|
65
86
|
}
|
|
66
87
|
return flow;
|
|
67
88
|
};
|
|
89
|
+
const getUTMParams = () => {
|
|
90
|
+
if (typeof window === undefined)
|
|
91
|
+
return {};
|
|
92
|
+
const search = new URLSearchParams(window.location.search);
|
|
93
|
+
const utmParams = UTM_PARAMS.reduce((acc, param) => {
|
|
94
|
+
const utmParam = search.get(param);
|
|
95
|
+
if (utmParam) {
|
|
96
|
+
acc[param] = utmParam;
|
|
97
|
+
}
|
|
98
|
+
return acc;
|
|
99
|
+
}, {});
|
|
100
|
+
return utmParams;
|
|
101
|
+
};
|
|
68
102
|
const getFirstPage = () => {
|
|
69
103
|
if (typeof window === undefined)
|
|
70
104
|
return '';
|
|
71
105
|
return removeHrefLangFromPath(window.location.pathname);
|
|
72
106
|
};
|
|
107
|
+
/* TODO: Align Marketing Team on UTM source convention
|
|
108
|
+
affiliate-<channel>
|
|
109
|
+
performance-<channel>
|
|
110
|
+
organic-<channel>
|
|
111
|
+
offline-<channel>
|
|
112
|
+
*/
|
|
113
|
+
const getChannel = (utmSource) => {
|
|
114
|
+
// TODO: UTM source patter for FB, GOOGLE...
|
|
115
|
+
if (!utmSource)
|
|
116
|
+
return '';
|
|
117
|
+
let channel = '';
|
|
118
|
+
if (utmSource) {
|
|
119
|
+
switch (true) {
|
|
120
|
+
case /^affiliate-/.test(utmSource):
|
|
121
|
+
case /^offline-/.test(utmSource):
|
|
122
|
+
case /^referral-/.test(utmSource):
|
|
123
|
+
case /^performance-/.test(utmSource):
|
|
124
|
+
channel = utmSource.split('-')[1];
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return channel;
|
|
131
|
+
};
|
|
73
132
|
/*
|
|
74
133
|
Set Static Source Details of user on Visit of Platform
|
|
75
134
|
*/
|
|
76
135
|
export const initSourceDetails = ({ platform, experiments, // only for website.
|
|
77
|
-
flow, affiliateChannel, offlineChannel,
|
|
136
|
+
flow, affiliateChannel, offlineChannel, organicChannel, performanceChannel, revenueChannel, salesProcess, guestId, landingPage, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
137
|
+
const utmParams = getUTMParams();
|
|
138
|
+
const { utm_source: utmSource } = utmParams;
|
|
139
|
+
const leadChannel = getChannel(utmSource);
|
|
78
140
|
/*
|
|
79
141
|
source cookie was added in cross subdomain for few days initially,
|
|
80
142
|
which was later changed to subdomain specific. Now to sending older cookie to backend, removing older cookie
|
|
81
143
|
*/
|
|
82
144
|
removeCookie(SOURCE_DETAILS_COOKIE, true);
|
|
83
|
-
revenueChannel = revenueChannel || getRevenueChannel(platform);
|
|
145
|
+
revenueChannel = revenueChannel || getRevenueChannel(platform, utmSource);
|
|
146
|
+
if (utmSource) {
|
|
147
|
+
switch (revenueChannel) {
|
|
148
|
+
case 'affiliate':
|
|
149
|
+
affiliateChannel = affiliateChannel || leadChannel;
|
|
150
|
+
break;
|
|
151
|
+
case 'offline':
|
|
152
|
+
offlineChannel = offlineChannel || leadChannel;
|
|
153
|
+
break;
|
|
154
|
+
case 'organic':
|
|
155
|
+
organicChannel = organicChannel || leadChannel;
|
|
156
|
+
break;
|
|
157
|
+
case 'performance':
|
|
158
|
+
performanceChannel = performanceChannel || leadChannel;
|
|
159
|
+
break;
|
|
160
|
+
default:
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
84
164
|
if (!isSourcePresent()) {
|
|
85
165
|
const sourceDetails = {
|
|
86
166
|
platform_channel: platform,
|
|
87
167
|
experiment_dict: experiments,
|
|
168
|
+
utm_params: utmParams,
|
|
88
169
|
flow: flow || getFlow(platform, experiments),
|
|
89
170
|
affiliate_channel: affiliateChannel,
|
|
90
171
|
offline_channel: offlineChannel,
|
|
91
|
-
|
|
172
|
+
organic_channel: organicChannel,
|
|
92
173
|
performance_channel: performanceChannel,
|
|
93
174
|
revenue_channel: revenueChannel,
|
|
94
175
|
first_page: getFirstPage(),
|
|
95
176
|
sales_process: salesProcess,
|
|
96
177
|
guest_id: guestId,
|
|
97
178
|
landing_page: landingPage,
|
|
98
|
-
referrer,
|
|
99
|
-
source_channel: sourceChannel,
|
|
100
179
|
};
|
|
101
180
|
writeSourceCookie(sourceDetails);
|
|
102
181
|
}
|
|
103
182
|
else {
|
|
104
|
-
|
|
183
|
+
let updatedSource = {
|
|
105
184
|
experiment_dict: experiments,
|
|
106
185
|
flow: flow || getFlow(platform, experiments),
|
|
107
186
|
guest_id: guestId,
|
|
108
187
|
};
|
|
188
|
+
if (utmSource) {
|
|
189
|
+
updatedSource = Object.assign(Object.assign({}, updatedSource), { utm_params: utmParams, affiliate_channel: affiliateChannel, offline_channel: offlineChannel, organic_channel: organicChannel, performance_channel: performanceChannel, revenue_channel: revenueChannel });
|
|
190
|
+
}
|
|
109
191
|
updateSourceCookie(updatedSource);
|
|
110
192
|
}
|
|
111
193
|
});
|
|
@@ -121,6 +203,9 @@ export const setFlowEntryPoint = (flowEntry) => __awaiter(void 0, void 0, void 0
|
|
|
121
203
|
export const setFlow = (flow) => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
204
|
updateSourceCookie({ flow });
|
|
123
205
|
});
|
|
206
|
+
export const setOrganicChannel = (organicChannel) => __awaiter(void 0, void 0, void 0, function* () {
|
|
207
|
+
updateSourceCookie({ organic_channel: organicChannel });
|
|
208
|
+
});
|
|
124
209
|
export const setRevenueChannel = (revenueChannel) => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
210
|
updateSourceCookie({ revenue_channel: revenueChannel });
|
|
126
211
|
});
|
|
@@ -142,32 +227,4 @@ export const setPlatformChannel = (platformChannel) => __awaiter(void 0, void 0,
|
|
|
142
227
|
export const setLandingPage = (landingPage) => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
228
|
updateSourceCookie({ landing_page: landingPage });
|
|
144
229
|
});
|
|
145
|
-
export const setReferrer = (referrer) => __awaiter(void 0, void 0, void 0, function* () {
|
|
146
|
-
updateSourceCookie({ referrer });
|
|
147
|
-
});
|
|
148
|
-
export const setSourceChannel = (sourceChannel) => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
|
-
updateSourceCookie({ source_channel: sourceChannel });
|
|
150
|
-
});
|
|
151
|
-
export const setSubPlatform = (subPlatform) => __awaiter(void 0, void 0, void 0, function* () {
|
|
152
|
-
updateSourceCookie({ sub_platform: subPlatform });
|
|
153
|
-
});
|
|
154
|
-
export const setCurrentPage = (currentPage) => __awaiter(void 0, void 0, void 0, function* () {
|
|
155
|
-
updateSourceCookie({ current_page: currentPage });
|
|
156
|
-
});
|
|
157
|
-
export const setPageProfile = (pageProfile) => __awaiter(void 0, void 0, void 0, function* () {
|
|
158
|
-
updateSourceCookie({ page_profile: pageProfile });
|
|
159
|
-
});
|
|
160
|
-
export const setSignupForm = (signupForm) => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
-
updateSourceCookie({ signup_form: signupForm });
|
|
162
|
-
});
|
|
163
|
-
export const clearSignupForm = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
|
-
updateSourceCookie({ signup_form: {} });
|
|
165
|
-
});
|
|
166
|
-
export const getSourceChannel = (utmSource) => {
|
|
167
|
-
const utmSourceMap = Object.assign({}, utmSourceSourceChannelData);
|
|
168
|
-
if (utmSourceMap[utmSource]) {
|
|
169
|
-
return utmSourceMap[utmSource];
|
|
170
|
-
}
|
|
171
|
-
return 'Others';
|
|
172
|
-
};
|
|
173
230
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/growth-source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/growth-source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAC/C,MAAM,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AAc,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAO,YAAoB,EAAiB,EAAE;IAC3E,kBAAkB,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;AACtD,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAwB,EAAE;IACzD,kBAAkB,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAO,OAAe,EAAiB,EAAE;IACpE,kBAAkB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAO,QAAgB,EAAiB,EAAE;IACpE,kBAAkB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAO,eAAyB,EAAiB,EAAE;IACnF,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAO,WAAmB,EAAiB,EAAE;IACzE,kBAAkB,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;AACpD,CAAC,CAAA,CAAC"}
|
|
@@ -9,15 +9,8 @@ export type UTMParams = {
|
|
|
9
9
|
utm_medium?: string;
|
|
10
10
|
utm_campaign?: string;
|
|
11
11
|
utm_term?: string;
|
|
12
|
-
utm_content?: string;
|
|
13
|
-
utm_adcontent?: string;
|
|
14
12
|
};
|
|
15
13
|
export type UTMParamsKeys = keyof UTMParams;
|
|
16
|
-
export type SignupForm = {
|
|
17
|
-
form_id?: string;
|
|
18
|
-
product?: string;
|
|
19
|
-
process?: string;
|
|
20
|
-
};
|
|
21
14
|
export type SourceDetailsCookie = {
|
|
22
15
|
platform_channel: Platform;
|
|
23
16
|
experiment_dict?: Experiments;
|
|
@@ -27,6 +20,7 @@ export type SourceDetailsCookie = {
|
|
|
27
20
|
offline_channel?: string;
|
|
28
21
|
performance_channel?: string;
|
|
29
22
|
revenue_channel: RevenueChannel;
|
|
23
|
+
organic_channel?: string;
|
|
30
24
|
flow_entry?: string;
|
|
31
25
|
first_page?: string;
|
|
32
26
|
last_page?: string;
|
|
@@ -34,12 +28,6 @@ export type SourceDetailsCookie = {
|
|
|
34
28
|
guest_id?: string;
|
|
35
29
|
current?: Partial<SourceDetailsCookie>;
|
|
36
30
|
landing_page?: string;
|
|
37
|
-
referrer?: string;
|
|
38
|
-
source_channel?: string;
|
|
39
|
-
page_profile?: string;
|
|
40
|
-
sub_platform?: string;
|
|
41
|
-
current_page?: string;
|
|
42
|
-
signup_form?: SignupForm;
|
|
43
31
|
};
|
|
44
32
|
export type SourceDetails = {
|
|
45
33
|
platform: Platform;
|
|
@@ -50,14 +38,11 @@ export type SourceDetails = {
|
|
|
50
38
|
offlineChannel?: string;
|
|
51
39
|
performanceChannel?: string;
|
|
52
40
|
revenueChannel: RevenueChannel;
|
|
41
|
+
organicChannel?: string;
|
|
53
42
|
flowEntry?: string;
|
|
54
43
|
firstPage?: string;
|
|
55
44
|
lastPage?: string;
|
|
56
45
|
guestId?: string;
|
|
57
46
|
salesProcess?: string;
|
|
58
47
|
landingPage?: string;
|
|
59
|
-
referrer?: string;
|
|
60
|
-
sourceChannel?: string;
|
|
61
|
-
pageProfile?: string;
|
|
62
|
-
subPlatform?: string;
|
|
63
48
|
};
|
|
@@ -1,123 +1,65 @@
|
|
|
1
1
|
const URL_PATH_MAP = {
|
|
2
2
|
HOMEPAGE: '/',
|
|
3
3
|
WHY_CHOOSE_US: '/math-online-classes',
|
|
4
|
-
ABOUT_US: '/about-us
|
|
4
|
+
ABOUT_US: '/about-us',
|
|
5
5
|
TUTORING_SERVICES: '/tutoring-services',
|
|
6
|
-
HOME_TUTION: '/home-tuition',
|
|
6
|
+
HOME_TUTION: '/home-tuition-in',
|
|
7
7
|
HOME_TUTOR: '/home-tutor',
|
|
8
|
-
HOME_TUTORS: '/home-tutors/',
|
|
9
8
|
HOME_TUTORING: '/home-tutoring',
|
|
10
9
|
HYBRID_TEACHER_PROFILE: '/hybrid-teacher-profile/',
|
|
11
|
-
MATH_TUITION: '/math-tuition
|
|
10
|
+
MATH_TUITION: '/math-tuition',
|
|
12
11
|
CENTRES: '/centres/',
|
|
13
|
-
|
|
14
|
-
ONLINE_TUITIONS: '/online-tuitions
|
|
15
|
-
GRADE_MATH: 'grade-math
|
|
16
|
-
ONLINE_MATH_COURSES: '/online-math-courses
|
|
12
|
+
MATHS: '/maths/',
|
|
13
|
+
ONLINE_TUITIONS: '/online-tuitions',
|
|
14
|
+
GRADE_MATH: '-grade-math',
|
|
15
|
+
ONLINE_MATH_COURSES: '/online-math-courses',
|
|
17
16
|
TUITION_TUTORS: '/tuition-tutors',
|
|
18
|
-
TEACH: '/teach
|
|
19
|
-
TEACHER_PROFILE: '
|
|
20
|
-
NEAR_ME: 'near-me
|
|
21
|
-
CONTACT: '/contact
|
|
17
|
+
TEACH: '/teach',
|
|
18
|
+
TEACHER_PROFILE: 'teacher-profile',
|
|
19
|
+
NEAR_ME: 'near-me',
|
|
20
|
+
CONTACT: '/contact',
|
|
22
21
|
PARENT_SIGNUP: '/parent/signup',
|
|
23
|
-
FREQUENTLY_ASKED_QUESTIONS: '/frequently-asked-questions
|
|
22
|
+
FREQUENTLY_ASKED_QUESTIONS: '/frequently-asked-questions',
|
|
24
23
|
HASH_HOMEPAGE: '/#',
|
|
25
24
|
QUERY_HOMEPAGE: '/?',
|
|
26
|
-
USA_HOMEPAGE: '/usa
|
|
27
|
-
CURRICULUM: '/curriculum
|
|
25
|
+
USA_HOMEPAGE: '/usa',
|
|
26
|
+
CURRICULUM: '/curriculum',
|
|
28
27
|
PRIVATE_TUTORS: '/private-tutors',
|
|
29
28
|
ONLINE_MATH_TUTORS: '/online-math-tutors',
|
|
30
|
-
MATHS_PROGRAM: '/maths-program
|
|
29
|
+
MATHS_PROGRAM: '/maths-program',
|
|
31
30
|
ONLINE_MATH_COURSE: '/online-math-course/',
|
|
32
|
-
TRIGONOMETRY_TUTORS: '/trigonometry-tutors
|
|
33
|
-
GEOMETRY_TUTORS: '/geometry-tutors
|
|
34
|
-
ALGEBRA_TUTORS: '/algebra-tutors
|
|
35
|
-
AFTER_SCHOOL_TUTORING: '/after-school-tutoring
|
|
36
|
-
MATHS_TEACHER: '/maths-teacher
|
|
31
|
+
TRIGONOMETRY_TUTORS: '/trigonometry-tutors',
|
|
32
|
+
GEOMETRY_TUTORS: '/geometry-tutors',
|
|
33
|
+
ALGEBRA_TUTORS: '/algebra-tutors',
|
|
34
|
+
AFTER_SCHOOL_TUTORING: '/after-school-tutoring',
|
|
35
|
+
MATHS_TEACHER: '/maths-teacher',
|
|
37
36
|
LIVE_ONLINE_CLASSES: '/live-online-classes',
|
|
38
|
-
PARENT_STUDENT_SEO: '/parent-signup-seo',
|
|
39
|
-
WORKSHEETS: '/worksheets/',
|
|
40
|
-
WORKSHEET: '/worksheet/',
|
|
41
|
-
QUESTIONS: '/questions/',
|
|
42
|
-
MATH_PUZZLES: '/math-puzzles/',
|
|
43
|
-
MATH_GAMES: '/math-games/',
|
|
44
|
-
FORMULA: '-formula',
|
|
45
|
-
FORMULAS: '-formulas/',
|
|
46
|
-
CALCULATORS: '/calculators/',
|
|
47
|
-
MULTIPLICATION_TABLE: '/multiplication-tables/',
|
|
48
|
-
MULTIPLICATION: '/multiplication/',
|
|
49
|
-
LEARNING: '/learning/',
|
|
50
|
-
LEARN: '/learn/',
|
|
51
|
-
MATH_OLYMPIAD: '/math-olympiad/',
|
|
52
|
-
GEOMETRY: '/geometry/',
|
|
53
|
-
DATA: '/data/',
|
|
54
|
-
NUMBERS: '/numbers/',
|
|
55
|
-
ALGEBRA: '/algebra/',
|
|
56
|
-
CALCULUS: '/calculus/',
|
|
57
|
-
MEASURMENT: '/measurement/',
|
|
58
|
-
TRIGONOMETRY: '/trigonometry/',
|
|
59
|
-
COMMERCIAL_MATH: '/commercial-math/',
|
|
60
|
-
NCERT: '/ncert',
|
|
61
|
-
NCERT2: '/NCERT',
|
|
62
|
-
NCERT_SOLUTIONS: '/ncert-solutions/',
|
|
63
|
-
STORIES_FOR_KIDS: '/stories-for-kids',
|
|
64
|
-
EN_HOMEPAGE: '/en-',
|
|
65
|
-
ABOUT: '/about/',
|
|
66
|
-
LOGIN: '/login',
|
|
67
|
-
MATH_CLASS: '/maths/class-',
|
|
68
|
-
ONLINE_MATH: '/online-math-',
|
|
69
|
-
HYBRID_TEACHER: '/hybrid-teacher',
|
|
70
|
-
TUITION_TEACHER: 'tuition-teacher',
|
|
71
|
-
CLASS: '/class-',
|
|
72
|
-
GRADE: /^\/grade-\d+\/$/,
|
|
73
|
-
GRADES: /^\/grades\/$/,
|
|
74
|
-
LEAP_PAYMENT: '/leap-payment/',
|
|
75
|
-
LEARN_MATH_ONLINE: 'learn-math-online-',
|
|
76
|
-
UPGRADE: '/upgrade/',
|
|
77
|
-
HCL: '/hcl/',
|
|
78
|
-
WORK_FROM_HOME: 'work-from-home',
|
|
79
|
-
TEACHER_JOBS: 'teacher-jobs',
|
|
80
|
-
TEACHERS_JOBS: 'teachers-jobs',
|
|
81
|
-
PART_TIME_JOBS: 'part-time-jobs',
|
|
82
|
-
ONLINE_TUTORING_JOBS: '/online-tutoring-jobs/',
|
|
83
|
-
TEACHER_SIGNUP: '/teacher/signup',
|
|
84
|
-
TEACHER: '/teacher/',
|
|
85
|
-
PDF: 'pdf',
|
|
86
|
-
DOWNLOAD: 'download',
|
|
87
|
-
CUEMATH_OLYMPIAD: 'cuemath-olympiad',
|
|
88
|
-
GIFT: '/gift/',
|
|
89
|
-
MATH_FORMULA: '/math-formulas',
|
|
90
|
-
COURSE_OLYMPIAD: '/course/olympiad/',
|
|
91
|
-
PHILOSOPHY: '/philosophy',
|
|
92
|
-
PRICING: '/pricing',
|
|
93
|
-
MATHS_YEAR: '/maths/year-',
|
|
94
37
|
};
|
|
95
38
|
export const BRAND_PAGES = [
|
|
96
39
|
URL_PATH_MAP.HOMEPAGE,
|
|
97
40
|
URL_PATH_MAP.ABOUT_US,
|
|
98
41
|
URL_PATH_MAP.CONTACT,
|
|
42
|
+
URL_PATH_MAP.PARENT_SIGNUP,
|
|
99
43
|
URL_PATH_MAP.HASH_HOMEPAGE,
|
|
100
44
|
URL_PATH_MAP.QUERY_HOMEPAGE,
|
|
101
45
|
URL_PATH_MAP.FREQUENTLY_ASKED_QUESTIONS,
|
|
102
46
|
URL_PATH_MAP.USA_HOMEPAGE,
|
|
103
|
-
URL_PATH_MAP.ABOUT,
|
|
104
|
-
URL_PATH_MAP.LOGIN,
|
|
105
47
|
];
|
|
106
48
|
export const INTENT_PAGES = [
|
|
107
49
|
URL_PATH_MAP.WHY_CHOOSE_US,
|
|
108
50
|
URL_PATH_MAP.TUTORING_SERVICES,
|
|
109
51
|
URL_PATH_MAP.HOME_TUTION,
|
|
110
52
|
URL_PATH_MAP.HOME_TUTOR,
|
|
111
|
-
URL_PATH_MAP.HOME_TUTORS,
|
|
112
53
|
URL_PATH_MAP.HOME_TUTORING,
|
|
113
54
|
URL_PATH_MAP.HYBRID_TEACHER_PROFILE,
|
|
114
|
-
URL_PATH_MAP.HYBRID_TEACHER,
|
|
115
55
|
URL_PATH_MAP.MATH_TUITION,
|
|
116
56
|
URL_PATH_MAP.CENTRES,
|
|
117
|
-
URL_PATH_MAP.
|
|
57
|
+
URL_PATH_MAP.MATHS,
|
|
118
58
|
URL_PATH_MAP.ONLINE_TUITIONS,
|
|
59
|
+
URL_PATH_MAP.GRADE_MATH,
|
|
119
60
|
URL_PATH_MAP.ONLINE_MATH_COURSES,
|
|
120
61
|
URL_PATH_MAP.TUITION_TUTORS,
|
|
62
|
+
URL_PATH_MAP.TEACH,
|
|
121
63
|
URL_PATH_MAP.TEACHER_PROFILE,
|
|
122
64
|
URL_PATH_MAP.NEAR_ME,
|
|
123
65
|
URL_PATH_MAP.CURRICULUM,
|
|
@@ -131,32 +73,5 @@ export const INTENT_PAGES = [
|
|
|
131
73
|
URL_PATH_MAP.AFTER_SCHOOL_TUTORING,
|
|
132
74
|
URL_PATH_MAP.MATHS_TEACHER,
|
|
133
75
|
URL_PATH_MAP.LIVE_ONLINE_CLASSES,
|
|
134
|
-
URL_PATH_MAP.PARENT_SIGNUP,
|
|
135
|
-
URL_PATH_MAP.PARENT_STUDENT_SEO,
|
|
136
|
-
URL_PATH_MAP.MATH_CLASS,
|
|
137
|
-
URL_PATH_MAP.GRADE_MATH,
|
|
138
|
-
URL_PATH_MAP.TUITION_TEACHER,
|
|
139
|
-
URL_PATH_MAP.LEAP_PAYMENT,
|
|
140
|
-
URL_PATH_MAP.GRADE,
|
|
141
|
-
URL_PATH_MAP.GRADES,
|
|
142
|
-
URL_PATH_MAP.LEARN_MATH_ONLINE,
|
|
143
|
-
URL_PATH_MAP.UPGRADE,
|
|
144
|
-
URL_PATH_MAP.HCL,
|
|
145
|
-
URL_PATH_MAP.ONLINE_MATH,
|
|
146
|
-
URL_PATH_MAP.COURSE_OLYMPIAD,
|
|
147
|
-
URL_PATH_MAP.PHILOSOPHY,
|
|
148
|
-
URL_PATH_MAP.PRICING,
|
|
149
|
-
URL_PATH_MAP.MATHS_YEAR,
|
|
150
|
-
];
|
|
151
|
-
export const SUPPLY_PAGES = [
|
|
152
|
-
URL_PATH_MAP.WORK_FROM_HOME,
|
|
153
|
-
URL_PATH_MAP.MATHS_TEACHER,
|
|
154
|
-
URL_PATH_MAP.TEACHERS_JOBS,
|
|
155
|
-
URL_PATH_MAP.TEACHER_JOBS,
|
|
156
|
-
URL_PATH_MAP.PART_TIME_JOBS,
|
|
157
|
-
URL_PATH_MAP.ONLINE_TUTORING_JOBS,
|
|
158
|
-
URL_PATH_MAP.TEACHER_SIGNUP,
|
|
159
|
-
URL_PATH_MAP.TEACHER,
|
|
160
76
|
];
|
|
161
|
-
export const REFERRAL_PAGES = [URL_PATH_MAP.GIFT];
|
|
162
77
|
//# sourceMappingURL=index.js.map
|