Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New visit after midnight - setting for disabling this characteristic, refs #9156 #9310

Merged
merged 4 commits into from Dec 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/global.ini.php
Expand Up @@ -654,6 +654,10 @@
; absent before, but is present now.
create_new_visit_when_website_referrer_changes = 0

; ONLY CHANGE THIS VALUE WHEN YOU DO NOT USE PIWIK ARCHIVING, SINCE THIS COULD CAUSE PARTIALLY MISSING ARCHIVE DATA
; Whether to force a new visit at midnight for every visitor. Default 1.
create_new_visit_after_midnight = 1

; maximum length of a Page Title or a Page URL recorded in the log_action.name table
page_maximum_length = 1024;

Expand Down
5 changes: 4 additions & 1 deletion plugins/CoreHome/Tracker/VisitRequestProcessor.php
Expand Up @@ -10,6 +10,7 @@

use Piwik\Common;
use Piwik\Date;
use Piwik\Config;
use Piwik\EventDispatcher;
use Piwik\Exception\UnexpectedWebsiteFoundException;
use Piwik\Tracker\Cache;
Expand Down Expand Up @@ -154,7 +155,9 @@ public function isVisitNew(VisitProperties $visitProperties, Request $request)
}

$wasLastActionYesterday = $this->wasLastActionNotToday($visitProperties, $request);
if ($wasLastActionYesterday) {
$forceNewVisitAtMidnight = (bool) Config::getInstance()->Tracker['create_new_visit_after_midnight'];

if ($wasLastActionYesterday && $forceNewVisitAtMidnight) {
Common::printDebug("Visitor detected, but last action was yesterday...");

return true;
Expand Down