add lead goal to fb

This commit is contained in:
dev.daminik00 2024-08-13 09:55:46 +02:00
parent 4e3150ef3c
commit 9fcc862743
4 changed files with 18 additions and 18 deletions

View File

@ -15,7 +15,7 @@ import { useAuthentication } from "@/hooks/authentication/use-authentication";
import {ESourceAuthorization} from "@/api/resources/User"; import {ESourceAuthorization} from "@/api/resources/User";
import {EPlacementKeys, IPaywallProduct} from "@/api/resources/Paywall"; import {EPlacementKeys, IPaywallProduct} from "@/api/resources/Paywall";
import {usePaywall} from "@/hooks/paywall/usePaywall"; import {usePaywall} from "@/hooks/paywall/usePaywall";
import metricService, { EGoals } from "@/services/metric/metricService"; import metricService, {EGoals, EMetrics} from "@/services/metric/metricService";
interface IEmailEnterPage { interface IEmailEnterPage {
redirectUrl?: string; redirectUrl?: string;
@ -89,7 +89,7 @@ function EmailEnterPage({
const handleClick = () => { const handleClick = () => {
authorize(); authorize();
metricService.reachGoal(EGoals.ENTERED_EMAIL); metricService.reachGoal(EGoals.ENTERED_EMAIL, [EMetrics.KLAVIYO, EMetrics.YANDEX, EMetrics.FACEBOOK]);
}; };
const authorize = async () => { const authorize = async () => {

View File

@ -18,7 +18,7 @@ import { ESourceAuthorization } from "@/api/resources/User";
import { useAuthentication } from "@/hooks/authentication/use-authentication"; import { useAuthentication } from "@/hooks/authentication/use-authentication";
import { usePaywall } from "@/hooks/paywall/usePaywall"; import { usePaywall } from "@/hooks/paywall/usePaywall";
import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall"; import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall";
import metricService, { EGoals } from "@/services/metric/metricService"; import metricService, {EGoals, EMetrics} from "@/services/metric/metricService";
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie"; import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
interface IEmailEnterPage { interface IEmailEnterPage {
@ -99,7 +99,7 @@ function EmailEnterPage({
const handleClick = () => { const handleClick = () => {
authorize(); authorize();
metricService.reachGoal(EGoals.ENTERED_EMAIL); metricService.reachGoal(EGoals.ENTERED_EMAIL, [EMetrics.KLAVIYO, EMetrics.YANDEX, EMetrics.FACEBOOK]);
}; };
const authorize = async () => { const authorize = async () => {

View File

@ -12,7 +12,7 @@ import { ESourceAuthorization } from "@/api/resources/User";
import { useAuthentication } from "@/hooks/authentication/use-authentication"; import { useAuthentication } from "@/hooks/authentication/use-authentication";
import { usePaywall } from "@/hooks/paywall/usePaywall"; import { usePaywall } from "@/hooks/paywall/usePaywall";
import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall"; import { EPlacementKeys, IPaywallProduct } from "@/api/resources/Paywall";
import metricService, { EGoals } from "@/services/metric/metricService"; import metricService, {EGoals, EMetrics} from "@/services/metric/metricService";
import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie"; import { ELottieKeys, useLottie } from "@/hooks/lottie/useLottie";
import ButtonBack from "../../components/ButtonBack"; import ButtonBack from "../../components/ButtonBack";
import { Button } from "../../ui/Button"; import { Button } from "../../ui/Button";
@ -100,7 +100,7 @@ function EmailEnterPage({
const handleClick = () => { const handleClick = () => {
authorize(); authorize();
metricService.reachGoal(EGoals.ENTERED_EMAIL); metricService.reachGoal(EGoals.ENTERED_EMAIL, [EMetrics.KLAVIYO, EMetrics.YANDEX, EMetrics.FACEBOOK]);
}; };
const authorize = async () => { const authorize = async () => {

View File

@ -9,7 +9,7 @@ import Title from "@/components/Title";
import Loader, { LoaderColor } from "@/components/Loader"; import Loader, { LoaderColor } from "@/components/Loader";
import { useAuthentication } from "@/hooks/authentication/use-authentication"; import { useAuthentication } from "@/hooks/authentication/use-authentication";
import { ESourceAuthorization } from "@/api/resources/User"; import { ESourceAuthorization } from "@/api/resources/User";
import metricService, { EGoals } from "@/services/metric/metricService"; import metricService, {EGoals, EMetrics} from "@/services/metric/metricService";
const emailRegex = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; const emailRegex = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
@ -44,7 +44,7 @@ export default function StepEmail() {
const authorize = async () => { const authorize = async () => {
await authorization(email, ESourceAuthorization["aura.palmistry"]); await authorization(email, ESourceAuthorization["aura.palmistry"]);
metricService.reachGoal(EGoals.ENTERED_EMAIL); metricService.reachGoal(EGoals.ENTERED_EMAIL, [EMetrics.KLAVIYO, EMetrics.YANDEX, EMetrics.FACEBOOK]);
setIsAuth(true); setIsAuth(true);
}; };