Last active
December 25, 2023 08:28
-
-
Save Padilo300/e8d11767bfa5e03f990f709fa1191823 to your computer and use it in GitHub Desktop.
Save 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 characters
function saveUtm(){ | |
let params = (new URL(document.location)).searchParams; | |
if(params.get('utm_source') !== null){ | |
document.cookie = "utm_source="+params.get('utm_source'); | |
} | |
if(params.get('utm_campaign') !== null){ | |
document.cookie = "utm_campaign="+params.get('utm_campaign'); | |
} | |
if(params.get('utm_content') !== null){ | |
document.cookie = "utm_content="+params.get('utm_content'); | |
} | |
if(params.get('utm_medium') !== null){ | |
document.cookie = "utm_medium="+params.get('utm_medium'); | |
} | |
if(params.get('utm_term') !== null){ | |
document.cookie = "utm_source="+params.get('utm_term'); | |
} | |
} | |
saveUtm(); |
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 characters
<?php | |
/* | |
* | |
* ████████████████████████████████████████████████████████ | |
* █────██────██────███───██─████────█████────██────██────█ | |
* █─██─██─██─██─██──███─███─████─██─█████─██─██─██─██─██─█ | |
* █────██────██─██──███─███─████─██─█████────██────██─██─█ | |
* █─█████─██─██─██──███─███─████─██─█████─█████─█─███─██─█ | |
* █─█████─██─██────███───██───██────██─██─█████─█─███────█ | |
* ████████████████████████████████████████████████████████ | |
* | |
* site : padilo.pro | |
* skype : padilo300 | |
* telegramm : @Padilo_K | |
* VIBER\WatsApp: +380967969966 | |
* | |
* | |
* Модуль обратной синхронизации из bitrix24 в opencart | |
* | |
* Задействована библиотека для работы с REST_API Bitrix24 https://github.com/Padilo300/bx_api | |
* | |
* В процессе создания модуля была написана библиотека для работы с API opencart | |
* она будет доступна для общего использования и расширения на GITHUB https://github.com/Padilo300/API_Opencart | |
* | |
* Задействована обертка над PDO https://gist.github.com/Padilo300/f949937dd1889b0888a49fee429c6826 | |
* | |
* | |
*/ | |
function save_utm(){ | |
if( isset( $_GET['utm_source'] ) ) { | |
setcookie('utm_source',$_GET['utm_source'], time()+ (90*86400)); | |
} | |
if( isset( $_GET['utm_medium'] ) ) { | |
setcookie('utm_medium',$_GET['utm_medium'], time()+ (90*86400)); | |
} | |
if( isset( $_GET['utm_campaign'] ) ) { | |
setcookie('utm_campaign',$_GET['utm_campaign'], time()+ (90*86400)); | |
} | |
if( isset( $_GET['utm_content'] ) ) { | |
setcookie('utm_content',$_GET['utm_content'], time()+ (90*86400)); | |
} | |
if( isset( $_GET['utm_term'] ) ) { | |
setcookie('utm_term',$_GET['utm_term'], time()+ (90*86400)); | |
} | |
} | |
save_utm(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment