метрика полей ФК
This commit is contained in:
parent
282ff1beeb
commit
389d977b3c
@ -153,6 +153,27 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
|
||||
vkMetrics.contactsFormFilled();
|
||||
yandexMetrics.contactsFormFilled();
|
||||
//Оповещаем какие поля были заполнены
|
||||
if (name.length !== 0) {
|
||||
vkMetrics.contactsFormField("name");
|
||||
yandexMetrics.contactsFormField("name");
|
||||
}
|
||||
if (email.length !== 0) {
|
||||
vkMetrics.contactsFormField("email");
|
||||
yandexMetrics.contactsFormField("email");
|
||||
}
|
||||
if (phone.length !== 0) {
|
||||
vkMetrics.contactsFormField("phone");
|
||||
yandexMetrics.contactsFormField("phone");
|
||||
}
|
||||
if (text.length !== 0) {
|
||||
vkMetrics.contactsFormField("text");
|
||||
yandexMetrics.contactsFormField("text");
|
||||
}
|
||||
if (adress.length !== 0) {
|
||||
vkMetrics.contactsFormField("address");
|
||||
yandexMetrics.contactsFormField("address");
|
||||
}
|
||||
} catch (e) {
|
||||
enqueueSnackbar("повторите попытку позже");
|
||||
}
|
||||
@ -190,8 +211,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
settings.cfg.design && !isMobile
|
||||
? quizThemes[settings.cfg.theme].isLight
|
||||
? `url(${DESIGN_LIST[settings.cfg.theme]})`
|
||||
: `linear-gradient(90deg, #272626, transparent), url(${
|
||||
DESIGN_LIST[settings.cfg.theme]
|
||||
: `linear-gradient(90deg, #272626, transparent), url(${DESIGN_LIST[settings.cfg.theme]
|
||||
})`
|
||||
: null,
|
||||
}}
|
||||
@ -315,8 +335,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
<Box
|
||||
component={Link}
|
||||
target={"_blank"}
|
||||
href={`https://${
|
||||
window.location.hostname.includes("s") ? "s" : ""
|
||||
href={`https://${window.location.hostname.includes("s") ? "s" : ""
|
||||
}quiz.pena.digital/squiz/quiz/logo?q=${quizId}`}
|
||||
sx={{
|
||||
display: "flex",
|
||||
|
@ -36,8 +36,6 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
|
||||
useEffect(() => {
|
||||
vkMetrics.resultIdShown(resultQuestion.id);
|
||||
yandexMetrics.resultIdShown(resultQuestion.id);
|
||||
vkMetrics.resultShown();
|
||||
yandexMetrics.resultShown();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -31,9 +31,6 @@ export const useVkMetricsGoals = (vkId: number | undefined) => {
|
||||
// Посетитель увидел определенный результат (id - айдишник вопроса с типом result)
|
||||
resultIdShown: (resultId: string) =>
|
||||
sendMetrics(vkId, `penaquiz-result-${resultId}`),
|
||||
// Посетитель увидел результат
|
||||
resultShown: () =>
|
||||
sendMetrics(vkId, `penaquiz-finish`),
|
||||
// Посетитель нажал на ссылку в результате
|
||||
resultLink: () =>
|
||||
sendMetrics(vkId, `penaquiz-resultlink`),
|
||||
@ -41,6 +38,8 @@ export const useVkMetricsGoals = (vkId: number | undefined) => {
|
||||
contactsFormOpened: () => sendMetrics(vkId, "penaquiz-form"),
|
||||
// Посетитель заполнил форму контактов
|
||||
contactsFormFilled: () => sendMetrics(vkId, "penaquiz-contacts"),
|
||||
// Посетитель заполнил поле формы контактов
|
||||
contactsFormField: (field: string) => sendMetrics(vkId, `penaquiz-formfield-${field}`),
|
||||
// Посетитель отправил заявку с мессенджером
|
||||
messengerRequestSended: (messenger: MetricsMessengers) =>
|
||||
sendMetrics(vkId, `penaquiz-messengers-${messenger}`),
|
||||
|
@ -23,9 +23,6 @@ export const useYandexMetricsGoals = (id: number | undefined) => {
|
||||
// Посетитель увидел определенный результат (id - айдишник вопроса с типом result)
|
||||
resultIdShown: (resultId: string) =>
|
||||
sendMetrics(id, `penaquiz-result-${resultId}`),
|
||||
// Посетитель увидел результат
|
||||
resultShown: () =>
|
||||
sendMetrics(id, `penaquiz-finish`),
|
||||
// Посетитель нажал на ссылку в результате
|
||||
resultLink: () =>
|
||||
sendMetrics(id, `penaquiz-resultlink`),
|
||||
@ -33,6 +30,8 @@ export const useYandexMetricsGoals = (id: number | undefined) => {
|
||||
contactsFormOpened: () => sendMetrics(id, "penaquiz-form"),
|
||||
// Посетитель заполнил форму контактов
|
||||
contactsFormFilled: () => sendMetrics(id, "penaquiz-contacts"),
|
||||
// Посетитель заполнил поле формы контактов
|
||||
contactsFormField: (field: string) => sendMetrics(id, `penaquiz-formfield-${field}`),
|
||||
// Посетитель отправил заявку с мессенджером
|
||||
messengerRequestSended: (messenger: MetricsMessengers) =>
|
||||
sendMetrics(id, `penaquiz-messengers-${messenger}`),
|
||||
|
Loading…
Reference in New Issue
Block a user