当前位置: 首页>>代码示例>>PHP>>正文


PHP Track::event方法代码示例

本文整理汇总了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;
 }
开发者ID:yusufchang,项目名称:app,代码行数:25,代码来源:ArticlesUsingMediaQuery.class.php

示例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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:19,代码来源:CloseMyAccountHelper.class.php

示例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;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:34,代码来源:WikiaSearch.class.php

示例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()]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:FacebookClientHelper.class.php

示例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()]);
 }
开发者ID:yusufchang,项目名称:app,代码行数:9,代码来源:UserSignupSpecialController.class.php


注:本文中的Track::event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。