mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
only log web visitor when client id is available.
This commit is contained in:
parent
c644f4c50e
commit
474a88de76
1 changed files with 11 additions and 9 deletions
|
@ -36,6 +36,7 @@ class Session
|
||||||
|
|
||||||
Response::addPostRenderCallback(function () {
|
Response::addPostRenderCallback(function () {
|
||||||
$ga_cid = filter_input(INPUT_COOKIE, 'ga_cid');
|
$ga_cid = filter_input(INPUT_COOKIE, 'ga_cid');
|
||||||
|
if (isset($ga_cid)) {
|
||||||
$site_visitor_id = key_exists(static::USER_ID, $_SESSION) ? $_SESSION[static::USER_ID] : $ga_cid;
|
$site_visitor_id = key_exists(static::USER_ID, $_SESSION) ? $_SESSION[static::USER_ID] : $ga_cid;
|
||||||
$site_visitor_id = isset($ga_cid) ? $ga_cid : $site_visitor_id;
|
$site_visitor_id = isset($ga_cid) ? $ga_cid : $site_visitor_id;
|
||||||
$response = LBRY::logWebVisitor(static::SITE_ID, $site_visitor_id, static::getClientIP());
|
$response = LBRY::logWebVisitor(static::SITE_ID, $site_visitor_id, static::getClientIP());
|
||||||
|
@ -46,6 +47,7 @@ class Session
|
||||||
} else {
|
} else {
|
||||||
$_SESSION[static::USER_ID] = '';
|
$_SESSION[static::USER_ID] = '';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
static::initFlashes();
|
static::initFlashes();
|
||||||
|
|
Loading…
Add table
Reference in a new issue