hotfix-yandex-metric-2

This commit is contained in:
Денис Катаев 2024-05-21 11:12:55 +00:00 committed by Daniil Chemerkin
parent 80bc309f26
commit 5f8bf9aeb2
7 changed files with 16 additions and 1 deletions

View File

@ -109,6 +109,7 @@ function EmailEnterPage({
const handleClick = () => {
authorize();
window.ym(95799066, "reachGoal", "EnteredEmail");
};
const authorize = async () => {

View File

@ -6,6 +6,7 @@ import Title from "@/components/Title";
import MainButton from "@/components/MainButton";
import { useDispatch } from "react-redux";
import { actions } from "@/store";
import { useEffect } from "react";
function PaymentSuccessPage(): JSX.Element {
const { t } = useTranslation();
@ -16,6 +17,10 @@ function PaymentSuccessPage(): JSX.Element {
navigate(routes.client.addReport());
};
useEffect(() => {
window.ym(95799066, "reachGoal", "PaymentSuccess");
}, []);
return (
<section className={`${styles.page} page`}>
<img

View File

@ -114,6 +114,7 @@ function EmailEnterPage({
const handleClick = () => {
authorize();
window.ym(95799066, "reachGoal", "EnteredEmail");
};
const authorize = async () => {

View File

@ -4,6 +4,7 @@ import Title from "@/components/Title";
import MainButton from "@/components/MainButton";
import { useNavigate } from "react-router-dom";
import routes from "@/routes";
import { useEffect } from "react";
function SuccessPaymentPage(): JSX.Element {
const { t } = useTranslation();
@ -13,6 +14,10 @@ function SuccessPaymentPage(): JSX.Element {
? "The payment was successful"
: "The information has been sent to your email";
useEffect(() => {
window.ym(95799066, "reachGoal", "PaymentSuccess");
}, []);
return (
<section className={`${styles.page} page`}>
<img

View File

@ -134,6 +134,7 @@ function PaymentWithEmailPage() {
return;
}
const { user, token } = authData;
window.ym(95799066, "reachGoal", "EnteredEmail");
await createSinglePayment({
user,

View File

@ -43,6 +43,7 @@ export default function StepEmail() {
const authorize = async () => {
await authorization(email, ESourceAuthorization["aura.palmistry"]);
window.ym(95799066, "reachGoal", "EnteredEmail");
setIsAuth(true);
};

View File

@ -115,13 +115,14 @@ export const useAuthentication = () => {
setIsLoading(true);
const payload = getAuthorizationPayload(email, source);
const { token, userId } = await api.authorization(payload);
const { user } = await api.getUser({ token });
if (userId?.length && !!window.ym) {
window.ym(95799066, 'userParams', {
email: user.email,
UserID: userId
})
window.ym(95799066, 'setUserID', userId);
}
const { user } = await api.getUser({ token });
signUp(token, user);
setToken(token);
dispatch(actions.status.update("registred"));