Origin - Media of the visitor

0

I know that it is possible to get the previous url of the visitor with $_SERVER['HTTP_REFERER']; but how do I get the source / media that the visitor was before accessing the site?

For example if it came from: Google / Organic, Google / CPC (paid), Bing / Organic, Bing / CPC, Direct / none, facebook / referral, youtube / referral, other sites / >

Thank you for your help

    
asked by anonymous 25.10.2017 / 00:00

1 answer

-1

I found the solution on GitHub: Google Analytics Cookie Parser PHP

I basically need to parse some Google Analytics cookies, for example utma and umtz , and access the information I need

For utma

$utma->time_of_first_visit; // DateTime
$utma->time_of_last_visit; // DateTime
$utma->time_of_current_visit; // DateTime
$utma->session_count // Integer

For utmz

$utmz->timestamp; // DateTime
$utmz->session_count // Integer
$utmz->campaign_number // Integer
$utmz->source // string
$utmz->medium // string
$utmz->campaign // string
$utmz->term // string
$utmz->content // string
    
25.10.2017 / 01:49