 <?php
session_start();
$_SESSION['host'] = '';
$_SESSION['cid'] = '';
$_SESSION['gclid'] = '';
$_SESSION['fbclid'] = '';
$_SESSION['utm_source'] = '';
$_SESSION['utm_medium'] = '';
$_SESSION['utm_campaign'] = '';
$_SESSION['utm_term'] = '';
$_SESSION['utm_physical_location'] = '';
$_SESSION['utm_tragetid'] = '';
$_SESSION['utm_target'] = '';
$_SESSION['utm_placement'] = '';
$_SESSION['utm_adposition'] = '';
    
if(!empty($_GET['utm_source'])){
    $_SESSION['host'] = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';
    $_SESSION['test'] = $_SERVER['REQUEST_URI'];
    $_SESSION['count'] = $_SESSION['count'] + 1;
    $_SESSION['cid'] = !empty($_GET['cid']) ? $_GET['cid'] : '';
    $_SESSION['gclid'] = !empty($_GET['gclid']) ? $_GET['gclid'] : '';
    $_SESSION['fbclid'] = !empty($_GET['fbclid']) ? $_GET['fbclid'] : '';
    $_SESSION['utm_source'] = !empty($_GET['utm_source']) ? $_GET['utm_source'] : '';
    $_SESSION['utm_medium'] = !empty($_GET['utm_medium']) ? $_GET['utm_medium'] : '';
    $_SESSION['utm_campaign'] = !empty($_GET['utm_campaign']) ? $_GET['utm_campaign'] : '';
    $_SESSION['utm_term'] = !empty($_GET['utm_term']) ? $_GET['utm_term'] : '';   
    $_SESSION['utm_physical_location'] = !empty($_GET['utm_Physical_Location']) ? $_GET['utm_Physical_Location'] : '';
    $_SESSION['utm_tragetid'] = !empty($_GET['utm_Tragetid']) ? $_GET['utm_Tragetid'] : '';
    $_SESSION['utm_target'] = !empty($_GET['utm_Target']) ? $_GET['utm_Target'] : '';
    $_SESSION['utm_placement'] = !empty($_GET['utm_Placement']) ? $_GET['utm_Placement'] : '';
    $_SESSION['utm_adposition'] = !empty($_GET['utm_Adposition']) ? $_GET['utm_Adposition'] : '';
}
        
if(!empty($_GET['msclkid'])){
    $_SESSION['gclid'] = !empty($_GET['msclkid']) ? $_GET['msclkid'] : '';
}

if(!empty($_GET['fbclid'])){
    $_SESSION['gclid'] = !empty($_GET['fbclid']) ? $_GET['fbclid'] : '';
}
?>
