diff options
Diffstat (limited to 'tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php')
-rw-r--r-- | tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php index a3752ad05c..be0e42eed9 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php +++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php @@ -5,6 +5,7 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +use Piwik\Date; /** * Add one site and track many visits with custom variables & campaign IDs and @@ -76,13 +77,13 @@ class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends $t2->setVisitorId($visitorId); // And Record a Goal: The previous visit should be updated rather than a new visit Created - $t2->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(0.3)->getDatetime()); + $t2->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.3)->getDatetime()); self::checkResponse($t2->doTrackGoal($idGoal, $revenue = 42.256)); // Yet another visitor, this time with a manual goal conversion, which should be credited to the campaign $t3 = self::getTracker($idSite, $dateTime); $t3->setUrlReferrer('http://example.org/referrer'); - $t3->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(1.3)->getDatetime()); + $t3->setForceVisitDateTime(Date::factory($dateTime)->addHour(1.3)->getDatetime()); // fake a website ref cookie, the campaign should be credited for conversion, not referrer.example.com nor example.org $t3->DEBUG_APPEND_URL = '&_ref=http%3A%2F%2Freferrer.example.com%2Fpage%2Fsub%3Fquery%3Dtest%26test2%3Dtest3'; $t3->setUrl('http://example.org/index.htm#pk_campaign=CREDITED TO GOAL PLEASE'); @@ -90,27 +91,27 @@ class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends // visitor #4, test for blank referrer campaign keyword $t4 = self::getTracker($idSite, $dateTime); - $t4->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(3)->getDatetime()); + $t4->setForceVisitDateTime(Date::factory($dateTime)->addHour(3)->getDatetime()); $t4->setUrlReferrer('http://bing.com/search?q=whatever'); $t4->setUrl('http://example.org/index.html?utm_campaign=GA+Campaign'); self::checkResponse($t4->doTrackPageView('first page')); // No campaign keyword specified, will use the referrer hostname - $t4->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(4)->getDatetime()); + $t4->setForceVisitDateTime(Date::factory($dateTime)->addHour(4)->getDatetime()); $t4->setUrlReferrer('http://thing1.com/a/b/c.html?a=b&d=c'); $t4->setUrl('http://example.org/index.html?utm_campaign=GA+Campaign'); self::checkResponse($t4->doTrackPageView('second page')); // Test with Google adsense type URL: $adsenseRefererUrl = 'http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-12345&output=html&h=280&slotname=123&w=336&lmt=1359388321&202&url=http%3A%2F%2Fwww.adsense-publisher-website.org%2F&dt=123&bpp=13&shv=r22&jsv=1565606614&correlator=ss&ga_vid=aaa&ga_sid=1359435122&ga_hid=1801871121&ga_fc=0&u_tz=780&u_his=4&u_java=1&u_h=900&u_w=1600&u_ah=876&u_aw=1551&u_cd=24&u_nplug=4&u_nmime=5&dff=georgia&dfs=16&adx=33&ady=201&biw=1551&bih=792&oid=3&fu=0&ifi=1&dtd=608&p=http%3A//www.adsense-publisher-website.com'; - $t4->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(5)->getDatetime()); + $t4->setForceVisitDateTime(Date::factory($dateTime)->addHour(5)->getDatetime()); $t4->setUrlReferrer($adsenseRefererUrl); $t4->setUrl('http://example.org/index.html?utm_campaign=Adsense campaign'); self::checkResponse($t4->doTrackPageView('second page')); // Test with google Adwords URL $adwordsUrl = 'http://www.google.co.nz/aclk?sa=L&ai=uYmFyiZgAf0oO0J&num=3&sig=EpOCR4xQ&ved=ENEM&adurl=http://pixel.everesttech.net/3163/cq%3Fev_sid%3D3%26ev_cmpid%3D33%26ev_ln%3Dused%2520wii%2520consoles%26ev_crx%528386%26ev_mt%3Db%26ev_n%3Dg%26ev_ltx%3D%26ev_pl%3D%26ev_pos%3D1s2%26url%3Dhttp%253A//au.shopping.com/used%2520wii%2520consoles/products%253Flinkin_id%253D8077872&rct=j&q=nintendo+consoles+second+hand'; - $t4->setForceVisitDateTime(Piwik_Date::factory($dateTime)->addHour(6)->getDatetime()); + $t4->setForceVisitDateTime(Date::factory($dateTime)->addHour(6)->getDatetime()); $t4->setUrlReferrer($adwordsUrl); $t4->setUrl('http://example.org/index.html?utm_campaign=Adwords campaign'); self::checkResponse($t4->doTrackPageView('second page')); |