var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
jQuery(document).ready(function($){
var source = getUrlParameter('utm_source');
$("body").on('click', '#ways', function(){
ym(92014952,'reachGoal','ways');
});
$("body").on('click', '#cat-top', function(){
ym(92014952,'reachGoal','cat-top');
});
$("body").on('click', '#podbor', function(){
ym(92014952,'reachGoal','podbor');
});
$("body").on('click', '#ways2', function(){
ym(92014952,'reachGoal','ways2');
});
$("body").on('click', '#catalog', function(){
ym(92014952,'reachGoal','catalog');
});
$("body").on('click', '#getdeals', function(){
ym(92014952,'reachGoal','getdeals');
});
/*
link_yandex = 'https://t.me/+xQU6z_37q_wzNDky';
link_mytarget = 'https://t.me/+i7Aphqqjmi84NzIy';
link_vk = 'https://t.me/+9_iPZ_ggJyU0ODIy';
link_empty = 'https://t.me/+usq4WXQAHIsyOTli';
if(source == 'yandex') {
$('#tg a').attr('href', link_yandex);
} else if(source == 'mytarget') {
$('#tg a').attr('href', link_mytarget);
} else if(source == 'vk') {
$('#tg a').attr('href', link_vk);
} else {
$('#tg a').attr('href', link_empty);
}
$("body").on('click', '#ways', function(){
ym(91357132,'reachGoal','way');
});
$("body").on('click', '#site', function(){
ym(91357132,'reachGoal','site');
});
$("body").on('click', '#tg', function(){
ym(91357132,'reachGoal','tg');
});
*/
});
/*document.addEventListener('click', function (event) {
// If the clicked element doesn't have the right selector, bail
if (!event.target.matches('#ways')) return;
// Don't follow the link
ym(91357132,'reachGoal','way');
// Log the clicked element in the console
console.log('way');
}, false);
document.addEventListener('click', function (event) {
// If the clicked element doesn't have the right selector, bail
if (!event.target.matches('#site')) return;
// Don't follow the link
ym(91357132,'reachGoal','site')
// Log the clicked element in the console
console.log('site');
}, false);
document.addEventListener('click', function (event) {
// If the clicked element doesn't have the right selector, bail
if (!event.target.matches('#tg')) return;
// Don't follow the link
ym(91357132,'reachGoal','tg')
// Log the clicked element in the console
console.log('tg');
}, false);*/
Сайт использует файлы cookie и сервисы статистики. Нажимая «Принять все», вы даёте согласие на обработку персональных данных в соответствии с политикой обработки персональных данных.