- {aboutUsAnswers.map((answer, index) => (
+ {aboutUsAnswers['aboutUsAnswersNormal'].map((answer, index) => (
{
};
metricService.initMetric();
+ // metricService.initMetricAB();
if (isProduction) {
smartLook();
diff --git a/src/routerComponents/ABDesign/v1/index.tsx b/src/routerComponents/ABDesign/v1/index.tsx
index c3fb657..b940f70 100644
--- a/src/routerComponents/ABDesign/v1/index.tsx
+++ b/src/routerComponents/ABDesign/v1/index.tsx
@@ -32,6 +32,7 @@ import TrialChoicePage from "@/components/pages/ABDesign/v1/pages/TrialChoice";
import TrialPaymentPage from "@/components/pages/ABDesign/v1/pages/TrialPayment";
import TrialPaymentWithDiscount from "@/components/pages/ABDesign/v1/pages/TrialPaymentWithDiscount";
import AdditionalDiscount from "@/components/pages/ABDesign/v1/pages/AdditionalDiscount";
+import MentionedInPage from "@/components/pages/ABDesign/v1/pages/MentionedIn";
function ABDesignV1Routes() {
return (
@@ -144,6 +145,10 @@ function ABDesignV1Routes() {
path={routes.client.additionalDiscountV1()}
element={}
/>
+ }
+ />
);
diff --git a/src/routes.ts b/src/routes.ts
index 5552350..fdd76ee 100755
--- a/src/routes.ts
+++ b/src/routes.ts
@@ -1,13 +1,13 @@
import { EPlacementKeys } from "./api/resources/Paywall";
import type { UserStatus } from "./types";
-const environments = import.meta.env
+const environments = import.meta.env;
const host = "";
export const apiHost = environments.AURA_API_HOST;
-const dApiHost = environments.AURA_DAPI_HOST
-const dApiPrefix = environments.AURA_DAPI_PREFIX
-const siteHost = environments.AURA_SITE_HOST
+const dApiHost = environments.AURA_DAPI_HOST;
+const dApiPrefix = environments.AURA_DAPI_PREFIX;
+const siteHost = environments.AURA_SITE_HOST;
const prefix = environments.AURA_PREFIX;
const openAIHost = environments.AURA_OPEN_AI_HOST;
const openAiPrefix = environments.AURA_OPEN_AI_PREFIX;
@@ -155,15 +155,23 @@ const routes = {
genderV1: () => [host, "v1", "gender"].join("/"),
questionnaireV1: () => [host, "v1", "questionnaire"].join("/"),
goalSetupV1: () => [host, "v1", "goal-setup"].join("/"),
- aboutUsV1: () => [host, "v1", "about-us"].join("/"),
+ aboutUsV1: (key?: string) => {
+ if (key === undefined) {
+ return [host, "v1", "about-us"].join("/")
+ } else {
+ return [host, "v1", "about-us"].join("/") + `?key=${key}`
+ }
+ },
hyperPersonalizedAstrologyV1: () =>
[host, "v1", "hyper-personalized-astrology"].join("/"),
singleZodiacInfoV1: () => [host, "v1", "single-zodiac-info"].join("/"),
- relationshipZodiacInfoV1: () => [host, "v1", "relationship-zodiac-info"].join("/"),
+ relationshipZodiacInfoV1: () =>
+ [host, "v1", "relationship-zodiac-info"].join("/"),
noTimeV1: () => [host, "v1", "no-time"].join("/"),
relationshipAlmostThereV1: () =>
[host, "v1", "relationship-almost-there"].join("/"),
- loadingInRelationshipV1: () => [host, "v1", "loading-in-relationship"].join("/"),
+ loadingInRelationshipV1: () =>
+ [host, "v1", "loading-in-relationship"].join("/"),
problemsV1: () => [host, "v1", "problems"].join("/"),
worksRouterV1: () => [host, "v1", "works-router"].join("/"),
worksForUsV1: () => [host, "v1", "works-for-us"].join("/"),
@@ -173,7 +181,8 @@ const routes = {
almostThereV1: () => [host, "v1", "almost-there"].join("/"),
partnerRightPlaceV1: () => [host, "v1", "partner-right-place"].join("/"),
partnerThingV1: () => [host, "v1", "partner-thing"].join("/"),
- partnerTotallyNormalV1: () => [host, "v1", "partner-totally-normal"].join("/"),
+ partnerTotallyNormalV1: () =>
+ [host, "v1", "partner-totally-normal"].join("/"),
withHeartV1: () => [host, "v1", "with-heart"].join("/"),
withHeadV1: () => [host, "v1", "with-head"].join("/"),
bothV1: () => [host, "v1", "both"].join("/"),
@@ -187,6 +196,7 @@ const routes = {
trialPaymentWithDiscountV1: () =>
[host, "v1", "trial-payment-with-discount"].join("/"),
additionalDiscountV1: () => [host, "v1", "additional-discount"].join("/"),
+ mentionedInV1: () => [host, "v1", "mentionedIn"].join("/"),
loadingPage: () => [host, "loading-page"].join("/"),
notFound: () => [host, "404"].join("/"),
@@ -271,17 +281,14 @@ const routes = {
[dApiHost, dApiPrefix, "placement", placementKey, "paywall"].join("/"),
// Payment
- makePayment: () =>
- [dApiHost, dApiPrefix, "payment", "checkout"].join("/"),
+ makePayment: () => [dApiHost, dApiPrefix, "payment", "checkout"].join("/"),
// User videos
- getUserVideos: () =>
- [dApiHost, "users", "videos", "combined"].join("/"),
+ getUserVideos: () => [dApiHost, "users", "videos", "combined"].join("/"),
// User videos
getUserPDFCompatibility: () =>
[dApiHost, "users", "pdf", "compatibility"].join("/"),
-
},
openAi: {
createThread: () => [openAIHost, openAiPrefix, "threads"].join("/"),
@@ -517,4 +524,4 @@ export const getRouteBy = (status: UserStatus): string => {
}
};
-export default routes;
\ No newline at end of file
+export default routes;
diff --git a/src/services/metric/metricService.ts b/src/services/metric/metricService.ts
index 729bb7a..e7e0420 100644
--- a/src/services/metric/metricService.ts
+++ b/src/services/metric/metricService.ts
@@ -1,3 +1,5 @@
+import { useExperiments } from "yandex-metrica-ab-react";
+
export enum EGoals {
ENTERED_EMAIL = "EnteredEmail",
PAYMENT_SUCCESS = "PaymentSuccess",
@@ -15,6 +17,11 @@ export enum EGoals {
AURA_TRIAL_PAYMENT_PAGE_VISIT = "AuraTrialPaymentPageVisit"
}
+export enum EFlags {
+ isNextPageMentioned = 'Go to page mentionedIn',
+ aboutUsAnswers = 'Key for aboutUsAnswers'
+}
+
interface IUserParams {
UserID: number | string;
genderFrom: string;
@@ -33,6 +40,14 @@ const checkIsAvailableYandexMetric = () => {
return true
}
+const checkIsAvailableYandexMetricAB = () => {
+ if (typeof window.ymab !== "function") {
+ console.error("Yandex.Metric not found")
+ return false
+ }
+ return true
+}
+
const setUserID = (userId: string) => {
if (!checkIsAvailableYandexMetric()) return;
window.ym(metricCounterNumber, "setUserID", userId)
@@ -94,4 +109,21 @@ const initMetric = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}
-export default { setUserID, userParams, reachGoal, hit, initMetric }
\ No newline at end of file
+const initMetricAB = () => {
+ if (!checkIsAvailableYandexMetricAB()) return;
+
+
+ window.ymab(`metrika.${metricCounterNumber}`, 'setConfig', { enableJS: true, enableWatch: true });
+ window.ymab(`metrika.${metricCounterNumber}`, 'init'/*, {clientFeatures}, {callback}*/);
+ console.log("Metric initialized");
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+}
+
+export const useMetricABFlags = () => {
+ return useExperiments({
+ clientId: `metrika.${metricCounterNumber}`
+ })
+}
+
+export default { setUserID, userParams, reachGoal, hit, initMetric, initMetricAB }
\ No newline at end of file
diff --git a/src/types.ts b/src/types.ts
index fa1ecd6..fc4183c 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -27,6 +27,7 @@ declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ym: any;
+ ymab: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
klaviyo: any;
}