Merge branch 'hotfix-yandex-metric-2' into 'main'
hotfix-yandex-metric-2 See merge request witapp/aura-webapp!143
This commit is contained in:
commit
2d4a44459c
@ -109,6 +109,7 @@ function EmailEnterPage({
|
||||
|
||||
const handleClick = () => {
|
||||
authorize();
|
||||
window.ym(95799066, "reachGoal", "EnteredEmail");
|
||||
};
|
||||
|
||||
const authorize = async () => {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -114,6 +114,7 @@ function EmailEnterPage({
|
||||
|
||||
const handleClick = () => {
|
||||
authorize();
|
||||
window.ym(95799066, "reachGoal", "EnteredEmail");
|
||||
};
|
||||
|
||||
const authorize = async () => {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -134,6 +134,7 @@ function PaymentWithEmailPage() {
|
||||
return;
|
||||
}
|
||||
const { user, token } = authData;
|
||||
window.ym(95799066, "reachGoal", "EnteredEmail");
|
||||
|
||||
await createSinglePayment({
|
||||
user,
|
||||
|
||||
@ -43,6 +43,7 @@ export default function StepEmail() {
|
||||
|
||||
const authorize = async () => {
|
||||
await authorization(email, ESourceAuthorization["aura.palmistry"]);
|
||||
window.ym(95799066, "reachGoal", "EnteredEmail");
|
||||
setIsAuth(true);
|
||||
};
|
||||
|
||||
|
||||
@ -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"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user