<script>
if (document.readyState !== 'loading') {
us_clickInterception();
} else {
document.addEventListener('DOMContentLoaded', us_clickInterception);
}
function us_clickInterception() {
var links = document.querySelectorAll('a');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
/* здесь пишем нужное действие */
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_clickInterceptionInBlock();
} else {
document.addEventListener('DOMContentLoaded', us_clickInterceptionInBlock);
}
function us_clickInterceptionInBlock() {
var links = document.querySelectorAll('#rec123456789 a');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
/* здесь пишем нужное действие */
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendMertics();
} else {
document.addEventListener('DOMContentLoaded', us_sendMertics);
}
function us_sendMertics() {
var links = document.querySelectorAll('[href="любая_ссылка"]');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
if (window.mainMetrikaId !== undefined) {
yaCounterXXXXXX.reachGoal('произвольная_цель');
}
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendMerticsByClickOnExternalLink();
} else {
document.addEventListener('DOMContentLoaded', us_sendMerticsByClickOnExternalLink);
}
function us_sendMerticsByClickOnExternalLink() {
var links = document.querySelectorAll('[href="ваша_ссылка"]');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
var url = link.getAttribute('href');
if (window.mainMetrikaId !== undefined) {
yaCounterXXXXXX.reachGoal('цель');
}
if (url && url.indexOf('http://') !== -1) {
setTimeout(function () {
window.location.href = url;
}, 500);
}
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendMerticsByClickOnBtn();
} else {
document.addEventListener('DOMContentLoaded', us_sendMerticsByClickOnBtn);
}
function us_sendMerticsByClickOnBtn() {
var internalLinks = document.querySelectorAll('[href="#rec123456789"]');
var externalLinks = document.querySelectorAll('[href="http://help-ru.tilda.ws"]');
Array.prototype.forEach.call(internalLinks, function (link) {
link.addEventListener('click', function () {
if (window.mainMetrikaId !== undefined) {
yaCounterXXXXXX.reachGoal('CLICK1');
}
});
});
Array.prototype.forEach.call(externalLinks, function (link) {
link.addEventListener('click', function () {
if (window.mainMetrikaId !== undefined) {
yaCounterXXXXXX.reachGoal('CLICK2');
}
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendMerticsByPopup();
} else {
document.addEventListener('DOMContentLoaded', us_sendMerticsByPopup);
}
function us_sendMerticsByPopup() {
var links = document.querySelectorAll('a');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
if (link.href && link.href.substring(0, 7) === '#popup:' && window.mainMetrika > '' &&
window[window.mainMetrika]) {
var virtPage = window.location.pathname + '/popup/' + link.href.substring(7);
var virtTitle = link.textContent;
window[window.mainMetrika].hit(virtPage, {
title: virtTitle,
referer: window.location.href,
});
}
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendMerticsByCart();
} else {
document.addEventListener('DOMContentLoaded', us_sendMerticsByCart);
}
function us_sendMerticsByCart() {
var links = document.querySelectorAll('[href^="#order"]');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function () {
if (window.mainMetrikaId !== undefined) {
yaCounterXXXXXX.reachGoal('AddToCart');
}
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_sendGoogleAnalytics();
} else {
document.addEventListener('DOMContentLoaded', us_sendGoogleAnalytics);
}
function us_sendGoogleAnalytics() {
var links = document.querySelectorAll('a');
Array.prototype.forEach.call(links, function (link) {
link.addEventListener('click', function (e) {
if (link.href && link.href.indexOf('ЗНАЧЕНИЕ В URL') !== -1) {
e.preventDefault();
ga('send', {
'hitType': 'pageview',
'page': '/click' + window.location.pathname,
'title': 'НАЗВАНИЕ ВИРТУАЛЬНОЙ СТРАНИЦЫ',
});
setTimeout(function () {
window.location = link.href;
}, 200);
}
});
});
}
</script>
<script>
function mySuccessFunction(form) {
if (!form) return;
if (form instanceof jQuery) {
form = form.get(0);
}
/* номер заявки (Lead ID) */
var leadId = form.tildaTranId;
var orderId = form.tildaOrderId;
/* все поля заявки в */
var obj = {};
var inputs = form.elements;
Array.prototype.forEach.call(inputs, function (input) {
if (input.type === 'radio') {
if (input.checked) obj[input.name] = input.value;
} else {
obj[input.name] = input.value;
}
});
/*
для обращения к значению поля используйте:
obj["Name"]
obj["Phone"]
obj["Email"]
и так далее...
*/
}
if (document.readyState !== 'loading') {
us_sendFormAfterSuccess();
} else {
document.addEventListener('DOMContentLoaded', us_sendFormAfterSuccess);
}
function us_sendFormAfterSuccess() {
var forms = document.querySelectorAll('.js-form-proccess');
Array.prototype.forEach.call(forms, function (form) {
form.addEventListener('tildaform:aftersuccess', function () {
mySuccessFunction(form);
});
});
}
</script>
<script>
function t396_onSuccess(form) {
if (!form) return;
if (form instanceof jQuery) {
form = form.get(0);
}
/* номер заявки (Lead ID) */
var leadId = form.tildaTranId;
var orderId = form.tildaOrderId;
/* Все поля заявки */
var obj = {};
var inputs = form.elements;
Array.prototype.forEach.call(inputs, function (input) {
obj[input.name] = input.value;
});
/* Отправляем данные POST-запросом */
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://yourwebhook.ru/form.php');
xhr.send(JSON.stringify(obj));
xhr.onload = function () {
if (xhr.response) {
/* Какие-то действия, если данные дошли успешно */
/* Переадресация на страницу успеха */
var successUrl = form.getAttribute('data-success-url');
if (successUrl) window.location.href = successUrl;
}
};
}
</script>
<script>
window.myAfterSendedFunction = function (form) {
if (!form) return;
if (form instanceof jQuery) {
form = form.get(0);
}
/* номер заявки (Lead ID) */
var leadId = form.tildaTranId;
var orderId = form.tildaOrderId;
/* все поля заявки */
var obj = {};
var inputs = form.elements;
Array.prototype.forEach.call(inputs, function (input) {
obj[input.name] = input.value;
});
/* здесь нужно написать код отправки данных в нужное место, например в свой скрипт или добавление данных в cookie */
};
if (document.readyState !== 'loading') {
us_eventFromCartToPayment();
} else {
document.addEventListener('DOMContentLoaded', us_eventFromCartToPayment);
}
function us_eventFromCartToPayment() {
var forms = document.querySelectorAll('.js-form-proccess');
Array.prototype.forEach.call(forms, function (form) {
form.addEventListener('tildaform:aftersuccess', function () {
window.myAfterSendedFunction(form);
});
});
}
</script>
<script>
if (document.readyState !== 'loading') {
us_customDOMChanges();
} else {
document.addEventListener('DOMContentLoaded', us_customDOMChanges);
}
function us_customDOMChanges() {
var buttons = document.querySelectorAll('.t-btn');
Array.prototype.forEach.call(buttons, function (button) {
/* добавляем свой класс к кнопкам */
button.classList.add('superclass');
});
/* добавляем скрипт для загрузки сервиса */
var service = document.createElement('script');
service.src = 'https://superservice.com/script.js';
service.type = 'text/javascript';
service.charset = 'UTF-8';
document.documentElement.appendChild(service);
}
</script>
<script>
if (document.readyState !== 'loading') {
us_initAdaptiveWidget();
} else {
document.addEventListener('DOMContentLoaded', us_initAdaptiveWidget);
}
function us_initAdaptiveWidget() {
if (window.isMobile == true) {
/* код для мобильных клиентов*/
} else {
/* код для десктопных клиентов*/
}
}
</script>
<div id="widgetbox" style="text-align: center;">
<div class="left" id="_bn_widget_"><a href="http://bnovo.ru/" id="_bnovo_link_" target="_blank">Bnovo</a></div>
<script type="text/javascript" src="http://widget.bnovo.ru/v2/js/bnovo.js"></script>
</div>
<script>
if (document.readyState !== 'loading') {
us_appendMixedWidget();
} else {
document.addEventListener('DOMContentLoaded', us_appendMixedWidget);
}
function us_appendMixedWidget() {
var html = '';
if (window.isMobile == true) {
/* код для мобильных клиентов*/
html = '<script>';
html += 'Bnovo_Widget.init(function(){Bnovo_Widget.open("_bn_widget_", {type: "vertical",lcode: "1234567890",lang: "ru",width: "230",background: "#ffda4a",bg_alpha: "100",padding: "18",font_type: "arial",font_color: "#222222",font_size: "16",title_color: "#222222",title_size: "18",inp_color: "#222222",inp_bordhover: "#3796e5",inp_bordcolor: "#cccccc",inp_alpha: "100",btn_background: "#f8f8f8",btn_background_over: "#ffffff",btn_textcolor: "#222222",btn_textover: "#222222",btn_bordcolor: "#cccccc",btn_bordhover: "#cccccc"});});';
html += '</script' + '>';
} else {
/* код для десктопных клиентов */
html = '<script>' +
'Bnovo_Widget.init(function(){Bnovo_Widget.open("_bn_widget_", {type: "horizontal",lcode: "1234567890",lang: "ru",width: "960",background: "#ffda4a",bg_alpha: "100",padding: "20",font_type: "arial",font_color: "#222222",font_size: "16",title_color: "#222222",title_size: "18",inp_color: "#222222",inp_bordhover: "#3796e5",inp_bordcolor: "#cccccc",inp_alpha: "100",btn_background: "#f8f8f8",btn_background_over: "#ffffff",btn_textcolor: "#222222",btn_textover: "#222222",btn_bordcolor: "#cccccc",btn_bordhover: "#cccccc"});});' +
'</script' + '>';
}
var widgetBox = document.querySelector('#widgetbox');
if (widgetBox) widgetBox.insertAdjacentHTML('beforeend', html);
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var allRec = document.getElementById('allrecords');
if (allRec) allRec.setAttribute('data-fb-event', 'nosend');
});
</script>