本文整理汇总了PHP中Track::event方法的典型用法代码示例。如果您正苦于以下问题:PHP Track::event方法的具体用法?PHP Track::event怎么用?PHP Track::event使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::event方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onArticleSaveComplete
public static function onArticleSaveComplete($article, $user, $revision, $status)
{
wfProfileIn(__METHOD__);
$insertedImages = Wikia::getVar('imageInserts');
$imageDeletes = Wikia::getVar('imageDeletes');
$changedImages = $imageDeletes;
foreach ($insertedImages as $img) {
$changedImages[$img['il_to']] = true;
}
$sendTrackEvent = false;
foreach ($changedImages as $imageDBName => $dummy) {
$title = Title::newFromDBkey($imageDBName);
if (!empty($title)) {
$mq = new self($title);
$mq->unsetCache();
$sendTrackEvent = true;
}
}
// send track event if embed change
if ($sendTrackEvent) {
Track::event('embed_change');
}
wfProfileOut(__METHOD__);
return true;
}
示例2: track
/**
* Track an event
*
* @param User $user User account the event is affecting
* @param string $action The type of close account event, can be one of
* request-closure, request-reactivation, account-reactivated,
* account-closed
* @return void
*/
public function track(User $user, $action)
{
global $wgUser, $wgDevelEnvironment;
// Make sure the right user is set for the user ID that will be collected
// when called from the maintenance script
$oldUser = $wgUser;
$wgUser = $user;
Track::event('trackingevent', ['ga_action' => 'submit', 'ga_category' => 'closemyaccount', 'ga_label' => $action, 'beacon' => !empty($wgDevelEnvironment) ? 'ThisIsFake' : wfGetBeaconId()]);
$wgUser = $oldUser;
}
示例3: doSearch
/**
* perform search
* @param WikiaSearchConfig $searchConfig
* @return WikiaSearchResultSet
*/
public function doSearch(WikiaSearchConfig $searchConfig)
{
wfProfileIn(__METHOD__);
if ($searchConfig->getGroupResults() == true) {
$searchConfig->setLength(self::GROUP_RESULTS_GROUPINGS_LIMIT)->setIsInterWiki(true)->setStart((int) $searchConfig->getLength() * ((int) $searchConfig->getPage() - 1));
} else {
$searchConfig->setStart(($searchConfig->getPage() - 1) * $searchConfig->getLength());
}
try {
$result = $this->client->select($this->getSelectQuery($searchConfig));
} catch (Exception $e) {
Wikia::log(__METHOD__, 'Querying Solr First Time', $e);
$searchConfig->setSkipBoostFunctions(true);
try {
$result = $this->client->select($this->getSelectQuery($searchConfig));
} catch (Exception $e) {
Wikia::log(__METHOD__, 'Querying Solr With No Boost Functions', $e);
$result = F::build('Solarium_Result_Select_Empty');
}
}
$results = F::build('WikiaSearchResultSet', array($result, $searchConfig));
$searchConfig->setResults($results)->setResultsFound($results->getResultsFound());
if ($searchConfig->getPage() == 1) {
$resultCount = $results->getResultsFound();
Track::event(!empty($resultCount) ? 'search_start' : 'search_start_nomatch', array('sterm' => $searchConfig->getQuery(), 'rver' => self::RELEVANCY_FUNCTION_ID, 'stype' => $searchConfig->getCityId() == 0 ? 'inter' : 'intra'));
}
wfProfileOut(__METHOD__);
return $results;
}
示例4: track
/**
* Track an event with a given label with user-sign-up category
* @param string $label
* @param string $action optional, 'submit' by default
*/
public static function track($label, $action = 'submit')
{
\Track::event('trackingevent', ['ga_action' => $action, 'ga_category' => 'user-sign-up', 'ga_label' => $label, 'beacon' => !empty(F::app()->wg->DevelEnvironment) ? 'ThisIsFake' : wfGetBeaconId()]);
}
示例5: track
/**
* Track an event with a given label with category 'user-sign-up' and action 'request'
*
* @param string $label
*/
protected function track($label)
{
\Track::event('trackingevent', ['ga_category' => 'user-sign-up', 'ga_action' => 'request', 'ga_label' => $label, 'beacon' => !empty($this->wg->DevelEnvironment) ? 'ThisIsFake' : wfGetBeaconId()]);
}