From 729f03ca47b719915c161ef4955d352b2c028aa3 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Fri, 21 Jun 2024 13:48:37 +0300 Subject: [PATCH] 1.1.15 add YandexMetrika tag for feedback form v4 --- static/js/registration.js | 10 +++++++++- templates/forms/f_registration.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/static/js/registration.js b/static/js/registration.js index 945c494..a747787 100644 --- a/static/js/registration.js +++ b/static/js/registration.js @@ -21,7 +21,15 @@ function SendRegistrationForm(el){ window.sessionStorage.removeItem('mailingSubscribeRequired') window.sessionStorage.removeItem('email') - ym(97070898,'reachGoal','Registration') + + if(typeof ym === 'function'){ + ym(97070898,'reachGoal','Registration') + return true; + }else { + console.log('Скрипт Яндекс.Метрики не найден. Статистика не будет отправлена.'); + } + + }, error: function (data, exception){ document.querySelector(".register").innerHTML = data.responseJSON.html diff --git a/templates/forms/f_registration.html b/templates/forms/f_registration.html index 0fe01bf..7d2f4f6 100644 --- a/templates/forms/f_registration.html +++ b/templates/forms/f_registration.html @@ -113,7 +113,7 @@ {% endif %}
- +
{% trans 'На Вашу почту отправлено письмо для подтверждения регистрации.' %}