Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-09-10 02:00:40 +0300
committerdiosmosis <benaka@piwik.pro>2015-09-10 02:00:40 +0300
commitb686ab1a8bfaf8ef6262cd2b9df0b26c2861c668 (patch)
treebbf5d543d8b9c44ed9f13a79034271166498742c /tests/PHPUnit/Fixtures
parentf7678c9fdc1e12310aea3f2654c51c8195104f85 (diff)
Refs #8630, when detecing campaign info in Referrers check _rcn and _rck query parameters.
Diffstat (limited to 'tests/PHPUnit/Fixtures')
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
index 5c3dcc553e..8ba755fabd 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
@@ -51,6 +51,10 @@ class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
if (!self::goalExists($idSite = 1, $idGoal = 1)) {
API::getInstance()->addGoal($this->idSite, 'triggered js', 'manually', '', '');
}
+
+ if (!self::goalExists($idSite = 1, $idGoal = 2)) {
+ API::getInstance()->addGoal($this->idSite, 'view act', 'url', 'http://mutantregistration.com/act.html', 'exact');
+ }
}
private function trackVisits()
@@ -177,6 +181,29 @@ class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
$t4->setUrlReferrer('http://mutantregistration.com');
$t4->setUrl('http://example.org/index.html');
self::checkResponse($t4->doTrackPageView('העלא וועלט'));
+
+ // test campaigns that are specified through _rcn
+ $t5 = self::getTracker($idSite, $dateTime);
+ $t5->setUrlReferrer('http://xavierinstitute.org');
+ $t5->setUrl('http://mutantregistration.com/act.html');
+ $t5->setAttributionInfo(json_encode(array('Gifted Search'))); // rcn supplied, nothing else
+ self::checkResponse($t5->doTrackPageView('Mutant Registration'));
+
+ $t5->setForceVisitDateTime(Date::factory($dateTime)->addHour(1)->getDatetime());
+ $t5->setUrlReferrer('http://mutantrights.org');
+ $t5->setUrl('http://asteroidm.com');
+ // all params suppplied, one that differs from url referrer
+ $t5->setAttributionInfo(json_encode(array('Recruiting Drive', 'am i a mutant?',
+ Date::factory($dateTime)->addHour(1)->getDatetime(), 'http://sentinelwatch.org')));
+ self::checkResponse($t5->doTrackPageView('Fighting Back'));
+
+ $t5->setForceVisitDateTime(Date::factory($dateTime)->addHour(2)->getDatetime());
+ $t5->setUrlReferrer('http://apocalypsenow.org');
+ $t5->setUrl('http://mutantrights.org');
+ // params supplied, for existing campaign
+ $t5->setAttributionInfo(json_encode(array('GA Campaign', 'some keyword',
+ Date::factory($dateTime)->addHour(2)->getDatetime())));
+ self::checkResponse($t5->doTrackPageView('Mutant Registration'));
}
// see updateDomainHash() in piwik.js