Last active
February 19, 2025 08:08
-
-
Save koddr/efba3d88019ed090f21d9e430472feb5 to your computer and use it in GitHub Desktop.
Revisions
-
koddr renamed this gist
Feb 19, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Vic Shóstak revised this gist
Aug 8, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ }); // если в форме есть поле с номером телефона, то добавляем его if (obj['phone'] !== undefined) { // формируем куку с полями email и phone document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}|||phone=${obj['phone'].replaceAll(/\s|\(|\)|\-/gi, '')}; path=/; secure;`; } else { -
Vic Shóstak revised this gist
Aug 8, 2024 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,9 +40,15 @@ obj[input.name] = input.value; } }); // если в форме есть поле с номером телефона, то добавляем его if (obj['phone'] !== undefined ) { // формируем куку с полями email и phone document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}|||phone=${obj['phone'].replaceAll(/\s|\(|\)|\-/gi, '')}; path=/; secure;`; } else { // формируем куку только с полем email document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}; path=/; secure;`; } // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); -
Vic Shóstak revised this gist
Jul 22, 2024 . 3 changed files with 0 additions and 9 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +0,0 @@ File renamed without changes. -
Vic Shóstak revised this gist
Apr 25, 2024 . 2 changed files with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,16 +5,16 @@ // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { var result = null, tmp = []; location.search.substr(1).split('&').forEach(function (item) { tmp = item.split('='); if (tmp[0] === name) result = decodeURIComponent(tmp[1]); }); return result; } // бежим по массиву с аттрибутами и пытаемся вытащить данные // и положить в переменную, которую затем будем использовать var utmParams = ''; for (u of UTMS) { utmParams += `${u}=${findGETParameterByName(u)}`; if (u !== 'utm_term') utmParams += '|||'; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,16 +11,16 @@ var result = null, tmp = []; var match = document.cookie.match(new RegExp(`(^| )${cookie}=([^;]+)`)); if (match) { match[2].split('|||').forEach(function (item) { tmp = item.split('='); if (tmp[0] === name) result = decodeURIComponent(tmp[1]); }); } return result; } // создаем пустую строку var utmParams = ''; // бежим по массиву с UTM метками, пытаемся вытащить данные // и положить в переменную, которую затем будем использовать -
Vic Shóstak revised this gist
Apr 17, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <script> // массив, в котором лежат нужные нам названия UTM var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term']; // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { @@ -17,7 +17,7 @@ var utmParams = ""; for (u of UTMS) { utmParams += `${u}=${findGETParameterByName(u)}`; if (u !== 'utm_term') utmParams += '|||'; } // формируем новую куку с необходимыми UTM метками -
Vic Shóstak revised this gist
Apr 10, 2024 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ // массив, в котором айдишники всех кнопок var BUTTON_CLASS = 'uid'; // массив, в котором лежат нужные нам названия UTM var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term']; // массив, в котором лежат нужные названия полей из формы var FIELDS = ['email', 'phone']; @@ -35,9 +35,11 @@ } // очистка ссылки под кнопкой var buttons = document.querySelectorAll(`.${BUTTON_CLASS} a`); // формируем новый URL у всех кнопок с необходимыми UTM метками for (b of buttons) { var baseUrl = b.href.replaceAll('&', '&'); b.href = `${baseUrl}${utmParams}`; } </script> -
Vic Shóstak revised this gist
Apr 4, 2024 . 2 changed files with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <script> // массив, в котором лежат нужные нам названия UTM var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'sub5']; // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { @@ -42,7 +42,7 @@ }); // формируем новую куку с данными из формы document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}|||phone=${obj['phone'].replaceAll(/\s|\(|\)|\-/gi, '')}; path=/; secure;`; // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ <script> // массив, в котором айдишники всех кнопок var BUTTON_CLASS = 'uid'; // массив, в котором лежат нужные нам названия UTM var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'sub5']; // массив, в котором лежат нужные названия полей из формы var FIELDS = ['email', 'phone']; // функция, которая вытаскивает значение cookie с указанным названием function findCookieByName(cookie, name) { -
Vic Shóstak revised this gist
Feb 28, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ } // очистка ссылки под кнопкой var button = document.querySelector(`.${BUTTON_CLASS} a`); var baseUrl = button.href.replaceAll('&', '&'); // формируем новый URL у кнопки с необходимыми UTM метками -
Vic Shóstak revised this gist
Feb 28, 2024 . 2 changed files with 10 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <script> // массив, в котором лежат нужные нам названия UTM var UTMS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "sub5"]; // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { @@ -17,7 +17,7 @@ var utmParams = ""; for (u of UTMS) { utmParams += `${u}=${findGETParameterByName(u)}`; if (u !== 'sub5') utmParams += '|||'; } // формируем новую куку с необходимыми UTM метками This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ <script> // массив, в котором айдишники всех кнопок var BUTTON_CLASS = "uid"; // массив, в котором лежат нужные нам названия UTM var UTMS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "sub5"]; // массив, в котором лежат нужные названия полей из формы var FIELDS = ["email"]; @@ -33,14 +33,11 @@ for (f of FIELDS) { utmParams += `&${f}=${findCookieByName('bootcamp_form_aggregated_data', f)}`; } // очистка ссылки под кнопкой var button = document.querySelector('.' + BUTTON_CLASS + ' a'); var baseUrl = button.href.replaceAll('&', '&'); // формируем новый URL у кнопки с необходимыми UTM метками button.href = `${baseUrl}${utmParams}`; </script> -
Vic Shóstak revised this gist
Feb 4, 2024 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,6 +33,9 @@ for (f of FIELDS) { utmParams += `&${f}=${findCookieByName('bootcamp_form_aggregated_data', f)}`; } // замена на нормальный амперсант utmParams.replaceAll("&", "&"); // берем классы кнопок, формируем новые ссылки с необходимыми UTM метками var baseUrl = ""; -
Vic Shóstak revised this gist
Dec 7, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ } // формируем новую куку с необходимыми UTM метками document.cookie = `bootcamp_utm_aggregated_data=${utmParams}; path=/; secure;`; // callback-функция для прокидывания данных // из формы в куки пользователя @@ -42,7 +42,7 @@ }); // формируем новую куку с данными из формы document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}; path=/; secure;`; // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); -
Vic Shóstak revised this gist
Dec 6, 2023 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,8 +20,8 @@ if (u !== 'utm_term') utmParams += '|||'; } // формируем новую куку с необходимыми UTM метками document.cookie = `autowebinar_utm_aggregated_data=${utmParams}; path=/; secure;`; // callback-функция для прокидывания данных // из формы в куки пользователя @@ -33,11 +33,16 @@ // обработка всех полей формы в Zero блоке var obj = {}, inputs = form.elements; Array.prototype.forEach.call(inputs, function (input) { if (input.type === 'radio') { // если это radio-кнопка, то забираем только отмеченное значение if (input.checked) obj[input.name] = input.value; } else { obj[input.name] = input.value; } }); // формируем новую куку с данными из формы document.cookie = `autowebinar_form_aggregated_data=email=${obj['email']}|||webinar_time=${obj['webinar_time']}; path=/; secure;`; // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); -
Vic Shóstak revised this gist
Nov 22, 2023 . 3 changed files with 15 additions and 30 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,7 @@ 1. Зайти на аккаунт тильды (it@...); 2. Найти папку с лэндами буткемпов; 3. Найти нужный лэндинг (там их будет два: один для главной страницы, другой для "спасибо-страницы"); 4. Разместить содержимое `2_главная_страница.html` на главной странице (в самом низу страницы); 5. Разместить содержимое `3_спасибо_страница.html` на странице "спасибо" (в самом низу страницы); ❗️ Внимание! Перед размещением скриптов – необходимо проверить, нет ли уже схожего скрипта на странице. Если есть, то заменить старый скрипт на новый. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ }); // формируем новую куку с данными из формы document.cookie = `bootcamp_form_aggregated_data=email=${obj['email']}; path=/; secure;`; // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,13 @@ var BUTTON_CLASSES = ["uid"]; // массив, в котором лежат нужные нам названия UTM var UTMS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"]; // массив, в котором лежат нужные названия полей из формы var FIELDS = ["email"]; // функция, которая вытаскивает значение cookie с указанным названием function findCookieByName(cookie, name) { var result = null, tmp = []; var match = document.cookie.match(new RegExp(`(^| )${cookie}=([^;]+)`)); if (match) { match[2].split("|||").forEach(function (item) { tmp = item.split("="); @@ -17,31 +19,20 @@ return result; } // создаем пустую строку var utmParams = ""; // бежим по массиву с UTM метками, пытаемся вытащить данные // и положить в переменную, которую затем будем использовать for (u of UTMS) { utmParams += `&${u}=${findCookieByName('bootcamp_utm_aggregated_data', u)}`; } // бежим по массиву с полями из формы, пытаемся вытащить данные // и положить в переменную, которую затем будем использовать for (f of FIELDS) { utmParams += `&${f}=${findCookieByName('bootcamp_form_aggregated_data', f)}`; } // берем классы кнопок, формируем новые ссылки с необходимыми UTM метками var baseUrl = ""; -
Vic Shóstak revised this gist
Sep 3, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,8 @@ <img width="811" alt="Снимок экрана" src="https://user-images.githubusercontent.com/11155743/265252040-0cf0a51b-a8b9-460e-a66f-fd391fb2012b.png"> 4. Разместить содержимое `2_главная_страница.html` на главной странице (в самом низу страницы); 5. Разместить содержимое `3_спасибо_страница.html` на странице "спасибо" (в самом низу страницы); <img width="357" alt="Снимок экрана 2023-09-03 в 12 01 38" src="https://user-images.githubusercontent.com/11155743/265252569-8f04202d-1e9f-46d8-bb83-6e57cb74c358.png"> <img width="726" alt="Снимок экрана 2023-09-03 в 12 00 31" src="https://user-images.githubusercontent.com/11155743/265252576-ea533241-f079-4e10-ad46-4c3db221ad4b.png"> -
Vic Shóstak revised this gist
Sep 3, 2023 . 3 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes. -
Vic Shóstak created this gist
Sep 3, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ <script> // массив, в котором лежат нужные нам названия UTM var UTMS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"]; // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { var result = null, tmp = []; location.search.substr(1).split("&").forEach(function (item) { tmp = item.split("="); if (tmp[0] === name) result = decodeURIComponent(tmp[1]); }); return result; } // бежим по массиву с аттрибутами и пытаемся вытащить данные // и положить в переменную, которую затем будем использовать var utmParams = ""; for (u of UTMS) { utmParams += `${u}=${findGETParameterByName(u)}`; if (u !== 'utm_term') utmParams += '|||'; } // формируем новую куку с необходимыми UTM метками + sub5 document.cookie = `bootcamp_utm_aggregated_data=${utmParams}; path=/; secure;`; // callback-функция для прокидывания данных // из формы в куки пользователя function t396_onSuccess(form) { // проверка на существование формы if (!form) return; if (form instanceof jQuery) form = form.get(0); // обработка всех полей формы в Zero блоке var obj = {}, inputs = form.elements; Array.prototype.forEach.call(inputs, function (input) { obj[input.name] = input.value; }); // формируем новую куку с данными из формы document.cookie = `bootcamp_form_aggregated_data=${obj['email'].replace('@', '|||')}; path=/; secure;`; // переадресация на страницу успеха var successUrl = form.getAttribute('data-success-url'); if (successUrl) window.location.href = successUrl; } </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ ## Для запуска лэнда для буткемпа 1. Зайти на аккаунт тильды (it@...); 2. Найти папку с лэндами буткемпов; 3. Найти нужный лэндинг (там их будет два: один для главной страницы, другой для "спасибо-страницы"); <img width="811" alt="Снимок экрана" src="https://user-images.githubusercontent.com/11155743/265252040-0cf0a51b-a8b9-460e-a66f-fd391fb2012b.png"> 4. Разместить содержимое `главная_страница.html` на главной странице (в самом низу); 5. Разместить содержимое `спасибо_страница.html` на странице "спасибо" (в самом низу); <img width="357" alt="Снимок экрана 2023-09-03 в 12 01 38" src="https://user-images.githubusercontent.com/11155743/265252569-8f04202d-1e9f-46d8-bb83-6e57cb74c358.png"> <img width="726" alt="Снимок экрана 2023-09-03 в 12 00 31" src="https://user-images.githubusercontent.com/11155743/265252576-ea533241-f079-4e10-ad46-4c3db221ad4b.png"> ❗️ Внимание! Перед размещением скриптов – необходимо проверить, нет ли уже схожего скрипта на странице. Если есть, то заменить старый скрипт на новый. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ <script> // массив, в котором айдишники всех кнопок var BUTTON_CLASSES = ["uid"]; // массив, в котором лежат нужные нам названия UTM var UTMS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"]; // функция, которая вытаскивает значение cookie с названием utm_aggregated_data function findCookieByName(name) { var result = null, tmp = []; var match = document.cookie.match(new RegExp('(^| )bootcamp_utm_aggregated_data=([^;]+)')); if (match) { match[2].split("|||").forEach(function (item) { tmp = item.split("="); if (tmp[0] === name) result = decodeURIComponent(tmp[1]); }); } return result; } // функция, которая вытаскивает все GET-параметры из адресной строки function findGETParameterByName(name) { var result = null, tmp = []; location.search.substr(1).split("&").forEach(function (item) { tmp = item.split("="); if (tmp[0] === name) result = decodeURIComponent(tmp[1]); }); return result; } // бежим по массиву с аттрибутами и пытаемся вытащить данные // и положить в переменную, которую затем будем использовать var utmParams = ""; for (u of UTMS) { if (findCookieByName(u) === null) { utmParams += `&${u}=${findGETParameterByName(u)}`; } else { utmParams += `&${u}=${findCookieByName(u)}`; } } // берем из кук данные отправленной формы из шага 1 // делаем обратное преобразования символов '|||' в '@' var cookieFormData = document.cookie.match(new RegExp('(^| )bootcamp_form_aggregated_data=([^;]+)')); if (cookieFormData) utmParams += `&email=${cookieFormData[2].replace('|||', '@')}`; // берем классы кнопок, формируем новые ссылки с необходимыми UTM метками var baseUrl = ""; for (bc of BUTTON_CLASSES) { baseUrl = document.getElementsByClassName(bc)[0].getElementsByTagName("a")[0].href; document.getElementsByClassName(bc)[0].getElementsByTagName("a")[0].href = `${baseUrl}${utmParams}`; } </script>