original_string: public function getImageTrackingCode($idSite, $piwikUrl = '', $actionName = false, $idGoal = false, $revenue = false, $forceMatomoEndpoint = false)
      {
          $urlParams = array('idsite' => $idSite, 'rec' => 1);
  
          if ($actionName !== false) {
              $urlParams['action_name'] = urlencode(Common::unsanitizeInputValue($actionName));
          }
  
          if ($idGoal !== false) {
              $urlParams['idgoal'] = $idGoal;
              if ($revenue !== false) {
                  $urlParams['revenue'] = $revenue;
              }
          }
  
          /**
           * Triggered when generating image link tracking code server side. Plugins can use
           * this event to customise the image tracking code that is displayed to the
           * user.
           *
           * @param string &$piwikHost The domain and URL path to the Matomo installation, eg,
           *                           `'examplepiwik.com/path/to/piwik'`.
           * @param array &$urlParams The query parameters used in the <img> element's src
           *                          URL. See Matomo's image tracking docs for more info.
           */
          Piwik::postEvent('SitesManager.getImageTrackingCode', array(&$piwikUrl, &$urlParams));
  
          $trackerCodeGenerator = new TrackerCodeGenerator();
          if ($forceMatomoEndpoint) {
              $trackerCodeGenerator->forceMatomoEndpoint();
          }
          $matomoPhp = $trackerCodeGenerator->getPhpTrackerEndpoint();
  
          $url = (ProxyHttp::isHttps() ? "https://" : "http://") . rtrim($piwikUrl, '/') . '/'.$matomoPhp.'?' . Url::getQueryStringFromParameters($urlParams);
          $html = "<!-- Matomo Image Tracker-->
  <img src=\"" . htmlspecialchars($url, ENT_COMPAT, 'UTF-8') . "\" style=\"border:0\" alt=\"\" />
  <!-- End Matomo -->";
          return htmlspecialchars($html, ENT_COMPAT, 'UTF-8');
      }
code: public function getImageTrackingCode($idSite, $piwikUrl = '', $actionName = false, $idGoal = false, $revenue = false, $forceMatomoEndpoint = false)
      {
          $urlParams = array('idsite' => $idSite, 'rec' => 1);
  
          if ($actionName !== false) {
              $urlParams['action_name'] = urlencode(Common::unsanitizeInputValue($actionName));
          }
  
          if ($idGoal !== false) {
              $urlParams['idgoal'] = $idGoal;
              if ($revenue !== false) {
                  $urlParams['revenue'] = $revenue;
              }
          }
  
          /**
           * Triggered when generating image link tracking code server side. Plugins can use
           * this event to customise the image tracking code that is displayed to the
           * user.
           *
           * @param string &$piwikHost The domain and URL path to the Matomo installation, eg,
           *                           `'examplepiwik.com/path/to/piwik'`.
           * @param array &$urlParams The query parameters used in the <img> element's src
           *                          URL. See Matomo's image tracking docs for more info.
           */
          Piwik::postEvent('SitesManager.getImageTrackingCode', array(&$piwikUrl, &$urlParams));
  
          $trackerCodeGenerator = new TrackerCodeGenerator();
          if ($forceMatomoEndpoint) {
              $trackerCodeGenerator->forceMatomoEndpoint();
          }
          $matomoPhp = $trackerCodeGenerator->getPhpTrackerEndpoint();
  
          $url = (ProxyHttp::isHttps() ? "https://" : "http://") . rtrim($piwikUrl, '/') . '/'.$matomoPhp.'?' . Url::getQueryStringFromParameters($urlParams);
          $html = "<!-- Matomo Image Tracker-->
  <img src=\"" . htmlspecialchars($url, ENT_COMPAT, 'UTF-8') . "\" style=\"border:0\" alt=\"\" />
  <!-- End Matomo -->";
          return htmlspecialchars($html, ENT_COMPAT, 'UTF-8');
      }
code_tokens: public function getImageTrackingCode ( $ idSite , $ piwikUrl = '' , $ actionName = false , $ idGoal = false , $ revenue = false , $ forceMatomoEndpoint = false ) { $ urlParams = array ( 'idsite' => $ idSite , 'rec' => 1 ) ; if ( $ actionName !== false ) { $ urlParams [ 'action_name' ] = urlencode ( Common :: unsanitizeInputValue ( $ actionName ) ) ; } if ( $ idGoal !== false ) { $ urlParams [ 'idgoal' ] = $ idGoal ; if ( $ revenue !== false ) { $ urlParams [ 'revenue' ] = $ revenue ; } } /**
           * Triggered when generating image link tracking code server side. Plugins can use
           * this event to customise the image tracking code that is displayed to the
           * user.
           *
           * @param string &$piwikHost The domain and URL path to the Matomo installation, eg,
           *                           `'examplepiwik.com/path/to/piwik'`.
           * @param array &$urlParams The query parameters used in the <img> element's src
           *                          URL. See Matomo's image tracking docs for more info.
           */ Piwik :: postEvent ( 'SitesManager.getImageTrackingCode' , array ( & $ piwikUrl , & $ urlParams ) ) ; $ trackerCodeGenerator = new TrackerCodeGenerator ( ) ; if ( $ forceMatomoEndpoint ) { $ trackerCodeGenerator -> forceMatomoEndpoint ( ) ; } $ matomoPhp = $ trackerCodeGenerator -> getPhpTrackerEndpoint ( ) ; $ url = ( ProxyHttp :: isHttps ( ) ? "https://" : "http://" ) . rtrim ( $ piwikUrl , '/' ) . '/' . $ matomoPhp . '?' . Url :: getQueryStringFromParameters ( $ urlParams ) ; $ html = "<!-- Matomo Image Tracker-->
  <img src=\"" . htmlspecialchars ( $ url , ENT_COMPAT , 'UTF-8' ) . "\" style=\"border:0\" alt=\"\" />
  <!-- End Matomo -->" ; return htmlspecialchars ( $ html , ENT_COMPAT , 'UTF-8' ) ; }
docstring: Returns image link tracking code for a given site with specified options.
  
  @param int $idSite The ID to generate tracking code for.
  @param string $piwikUrl The domain and URL path to the Matomo installation.
  @param int $idGoal An ID for a goal to trigger a conversion for.
  @param int $revenue The revenue of the goal conversion. Only used if $idGoal is supplied.
  @param bool $forceMatomoEndpoint Whether the Matomo endpoint should be forced if Matomo was installed prior 3.7.0.
  @return string The HTML tracking code.
docstring_tokens: Returns image link tracking code for a given site with specified options .