Skip to content
Extraits de code Groupes Projets
Valider 56cb86ad rédigé par mattab's avatar mattab
Parcourir les fichiers

Fixes #4260 Make Campaign name + Keyword lowercase also in the Goal conversion...

Fixes #4260 Make Campaign name + Keyword lowercase also in the Goal conversion logs + integration test
Thanks for the report!
parent 7bd88b83
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -314,6 +314,9 @@ class GoalManager ...@@ -314,6 +314,9 @@ class GoalManager
$time = $referrerTimestamp; $time = $referrerTimestamp;
} }
} }
$name = Common::mb_strtolower($name);
$keyword = Common::mb_strtolower($keyword);
$goal += array( $goal += array(
'referer_type' => $type, 'referer_type' => $type,
'referer_name' => $name, 'referer_name' => $name,
......
...@@ -285,10 +285,10 @@ class Referrer ...@@ -285,10 +285,10 @@ class Referrer
$this->detectReferrerCampaignFromLandingUrl(); $this->detectReferrerCampaignFromLandingUrl();
$this->detectCampaignKeywordFromReferrerUrl(); $this->detectCampaignKeywordFromReferrerUrl();
// if we detected a campaign but there is still no keyword set, we set the keyword to the Referrer host
if ($this->typeReferrerAnalyzed != Common::REFERRER_TYPE_CAMPAIGN) { if ($this->typeReferrerAnalyzed != Common::REFERRER_TYPE_CAMPAIGN) {
return false; return false;
} }
// if we detected a campaign but there is still no keyword set, we set the keyword to the Referrer host
if(empty($this->keywordReferrerAnalyzed)) { if(empty($this->keywordReferrerAnalyzed)) {
$this->keywordReferrerAnalyzed = $this->referrerHost; $this->keywordReferrerAnalyzed = $this->referrerHost;
} }
......
...@@ -14,39 +14,18 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte ...@@ -14,39 +14,18 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte
{ {
public static $fixture = null; public static $fixture = null;
static $shouldSkipTestThisTime = false;
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$shouldSkipTestThisTime = in_array(date('G'), array(22, 23)); self::$fixture->dateTime = Date::factory('today')->getDateTime();
if (self::$shouldSkipTestThisTime) {
print("\nSKIPPED test PeriodIsRange_DateIsLastN_MetadataAndNormalAPI since it fails around midnight...\n");
return;
}
self::$fixture->dateTime = Date::factory('now')->getDateTime();
parent::setUpBeforeClass(); parent::setUpBeforeClass();
} }
public static function tearDownAfterClass()
{
if (self::$shouldSkipTestThisTime) {
return;
}
parent::tearDownAfterClass();
}
/** /**
* @dataProvider getApiForTesting * @dataProvider getApiForTesting
* @group Integration * @group Integration
*/ */
public function testApi($api, $params) public function testApi($api, $params)
{ {
if (self::$shouldSkipTestThisTime) {
return;
}
$this->runApiTests($api, $params); $this->runApiTests($api, $params);
} }
...@@ -84,8 +63,11 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte ...@@ -84,8 +63,11 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte
foreach ($dates as $date) { foreach ($dates as $date) {
$result[] = array($apiToCall, array('idSite' => $idSite, 'date' => $date, $result[] = array($apiToCall, array('idSite' => $idSite, 'date' => $date,
'periods' => array('range'), 'segment' => $segment, 'periods' => array('range'), 'segment' => $segment,
// testing getLastVisitsForVisitor requires a visitor ID // testing getLastVisitsForVisitor requires a visitor ID
'visitorId' => $visitorId)); 'visitorId' => $visitorId,
'otherRequestParameters' => array(
'lastMinutes' => 60 * 24,
)));
} }
} }
......
...@@ -392,4 +392,4 @@ ...@@ -392,4 +392,4 @@
</row> </row>
</result> </result>
\ No newline at end of file
...@@ -266,4 +266,4 @@ ...@@ -266,4 +266,4 @@
</lastVisits> </lastVisits>
</result> </result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<result> <result>
<row> <row>
<label>CAMPAIGN NAME - YEAH!</label> <label>campaign name - yeah!</label>
<goals> <goals>
<row idgoal='1'> <row idgoal='1'>
<nb_conversions>1</nb_conversions> <nb_conversions>1</nb_conversions>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<nb_visits>0</nb_visits> <nb_visits>0</nb_visits>
<subtable> <subtable>
<row> <row>
<label>CAMPAIGN KEYWORD - RIGHT...</label> <label>campaign keyword - right...</label>
<goals> <goals>
<row idgoal='1'> <row idgoal='1'>
<nb_conversions>1</nb_conversions> <nb_conversions>1</nb_conversions>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter