本文整理匯總了PHP中Piwik\Tests\Framework\Fixture::checkBulkTrackingResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fixture::checkBulkTrackingResponse方法的具體用法?PHP Fixture::checkBulkTrackingResponse怎麽用?PHP Fixture::checkBulkTrackingResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Tests\Framework\Fixture
的用法示例。
在下文中一共展示了Fixture::checkBulkTrackingResponse方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _addLogData
protected static function _addLogData()
{
// tracks visits on the following days:
// - 2012-01-09
// - 2012-01-14
// - 2012-01-19
// - 2012-01-24 <--- everything before this date is to be purged
// - 2012-01-29
// - 2012-02-03
// - 2012-02-08
// - 2012-02-13
// - 2012-02-18
// - 2012-02-23
// - 2012-02-28
// 6 visits in feb, 5 in jan
// following actions are created:
// - 'First page view'
// - 'Second page view'
// - 'SKU2'
// - 'Canon SLR'
// - 'Electronics & Cameras'
// - for every visit (11 visits total):
// - http://whatever.com/_{$daysSinceLastVisit}
// - http://whatever.com/42/{$daysSinceLastVisit}
$start = Date::factory(self::$dateTime);
self::$idSite = Fixture::createWebsite('2012-01-01', $ecommerce = 1);
APIGoals::getInstance()->addGoal(self::$idSite, 'match all', 'url', 'http', 'contains');
$t = Fixture::getTracker(self::$idSite, $start, $defaultInit = true);
$t->enableBulkTracking();
$t->setTokenAuth(Fixture::getTokenAuth());
for ($daysAgo = self::$daysAgoStart; $daysAgo >= 0; $daysAgo -= 5) {
$dateTime = $start->subDay($daysAgo)->toString();
$t->setForceVisitDateTime($dateTime);
$t->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)');
// use $daysAgo to make sure new actions are created for every day and aren't used again.
// when deleting visits, some of these actions will no longer be referenced in the DB.
$t->setUrl("http://whatever.com/_{$daysAgo}");
$t->doTrackPageView('First page view');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.05));
$t->setUrl("http://whatever.com/42/{$daysAgo}");
$t->doTrackPageView('Second page view');
// track an event to test event actions are purged/preserved
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.1));
$t->setUrl("http://whatever.com/event");
$t->doTrackEvent('Event action', 'event cat', 'daysAgo=' . $daysAgo, 1000);
// track a content impression to test that content actions are purged/preserved
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.1));
$t->doTrackContentImpression('SugarTransportAd', '/path/ad.jpg', 'http://www.satsumaprovince.jp');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.2));
$t->addEcommerceItem($sku = 'SKU2', $name = 'Canon SLR', $category = 'Electronics & Cameras', $price = 1500, $quantity = 1);
$t->doTrackEcommerceOrder($orderId = '937nsjusu ' . $dateTime, $grandTotal = 1111.11, $subTotal = 1000, $tax = 111, $shipping = 0.11, $discount = 666);
}
Fixture::checkBulkTrackingResponse($t->doBulkTrack());
}