diff --git a/static/js/registration.js b/static/js/registration.js index 422e3a8..945c494 100644 --- a/static/js/registration.js +++ b/static/js/registration.js @@ -20,6 +20,8 @@ function SendRegistrationForm(el){ // location.href = `/profile/page/dashboard/` window.sessionStorage.removeItem('mailingSubscribeRequired') window.sessionStorage.removeItem('email') + + ym(97070898,'reachGoal','Registration') }, error: function (data, exception){ document.querySelector(".register").innerHTML = data.responseJSON.html diff --git a/static/js/user_profile.js b/static/js/user_profile.js index e894a8f..b9e57e7 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -1067,7 +1067,7 @@ function RequestCommercialOffer (el){ data: formData, success: function(data){ - ym(97070898,'reachGoal','Message'); + // el.style.background = '#FF613A'; el.removeAttribute('style') @@ -1095,6 +1095,14 @@ function RequestCommercialOffer (el){ 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){ // document.querySelector(".login").innerHTML = data.responseJSON.html diff --git a/templates/forms/f_feedback_form.html b/templates/forms/f_feedback_form.html index eb1656c..3348bf4 100644 --- a/templates/forms/f_feedback_form.html +++ b/templates/forms/f_feedback_form.html @@ -5,14 +5,15 @@