1.1.14 add YandexMetrika tag for feedback form v3

This commit is contained in:
2024-06-21 13:17:35 +03:00
parent d0ccbb494f
commit 96c0111428
4 changed files with 18 additions and 9 deletions

View File

@@ -20,6 +20,8 @@ function SendRegistrationForm(el){
// location.href = `/profile/page/dashboard/` // location.href = `/profile/page/dashboard/`
window.sessionStorage.removeItem('mailingSubscribeRequired') window.sessionStorage.removeItem('mailingSubscribeRequired')
window.sessionStorage.removeItem('email') window.sessionStorage.removeItem('email')
ym(97070898,'reachGoal','Registration')
}, },
error: function (data, exception){ error: function (data, exception){
document.querySelector(".register").innerHTML = data.responseJSON.html document.querySelector(".register").innerHTML = data.responseJSON.html

View File

@@ -1067,7 +1067,7 @@ function RequestCommercialOffer (el){
data: formData, data: formData,
success: function(data){ success: function(data){
ym(97070898,'reachGoal','Message');
// el.style.background = '#FF613A'; // el.style.background = '#FF613A';
el.removeAttribute('style') el.removeAttribute('style')
@@ -1095,6 +1095,14 @@ function RequestCommercialOffer (el){
let hide_error_msg = document.getElementById('error_footer').classList.add('hide') let hide_error_msg = document.getElementById('error_footer').classList.add('hide')
} }
if(typeof ym === 'function'){
ym(97070898,'reachGoal','Message');
return true;
}else {
console.log('Скрипт Яндекс.Метрики не найден. Статистика не будет отправлена.');
}
}, },
error: function (data, exception){ error: function (data, exception){
// document.querySelector(".login").innerHTML = data.responseJSON.html // document.querySelector(".login").innerHTML = data.responseJSON.html

View File

@@ -5,14 +5,15 @@
<form <form
class="clear_form" class="clear_form"
onsubmit="ym(97070898,'reachGoal','Message'); return true;" onsubmit="ym(97070898,'reachGoal','Message'); return true;"
id="feedback_form" id="feedback_form"
{% if page.url == 'contacts' %} data-name="msg_from_contacts"{% endif %} {% if page.url == 'contacts' %} data-name="msg_from_contacts"{% endif %}
{% if page.url == 'about_service' %} data-name="msg_from_about_service"{% endif %} {% if page.url == 'about_service' %} data-name="msg_from_about_service"{% endif %}
{% if page.url == 'customer_service' %} data-name="msg_from_customer_service"{% endif %} {% if page.url == 'customer_service' %} data-name="msg_from_customer_service"{% endif %}
{% if form.form_name %}data-name="{{ form.form_name}}"{% endif %} {% if form.form_name %}data-name="{{ form.form_name}}"{% endif %}>
>
<div class="left_inputs_form"> <div class="left_inputs_form">
<div class="inputs_l"> <div class="inputs_l">
<input name="name" <input name="name"
@@ -82,7 +83,3 @@
</div> </div>

View File

@@ -11,8 +11,10 @@
<form <form
name="registration_form" name="registration_form"
method="POST"
onsubmit="ym(97070898,'reachGoal','Registration'); return true;" onsubmit="ym(97070898,'reachGoal','Registration'); return true;"
method="POST"> >
{% csrf_token %} {% csrf_token %}