Permalink
Browse files

Fixes #1528

 * Also adding in product doc about parameters to the Simple Image Tracking code
  • Loading branch information...
1 parent 081e403 commit 3913f475377ed47632b3ee723b60185136ca462a matt committed Jul 29, 2010
@@ -85,6 +85,15 @@ function setRequest($requestArray)
throw new Exception('Invalid idSite');
}
$this->idsite = $idsite;
+
+ // When the 'url' and referer url parameter are not given, we might be in the 'Simple Image Tracker' mode.
+ // The URL can default to the Referer, which will be in this case
+ // the URL of the page containing the Simple Image beacon
+ if(empty($this->request['urlref'])
+ && empty($this->request['url']))
+ {
+ $this->request['url'] = @$_SERVER['HTTP_REFERER'];
+ }
}
/**
@@ -972,7 +981,7 @@ public function getRefererInformation()
// get the urls and parse them
$refererUrl = Piwik_Common::getRequestVar( 'urlref', '', 'string', $this->request);
- $currentUrl = Piwik_Common::getRequestVar( 'url', '', 'string', $this->request);
+ $currentUrl = Piwik_Common::getRequestVar( 'url', $defaultUrl, 'string', $this->request);
$this->refererUrl = $refererUrl;
$this->refererUrlParse = @parse_url(Piwik_Common::unsanitizeInputValue($refererUrl));
@@ -0,0 +1,3 @@
+This page loads a Simple Tracker request to Piwik website id=1
+
+<img src='http://localhost/trunk/piwik.php?idsite=1&rec=1'>
@@ -14,6 +14,13 @@ The Simple Image Tracker tag can be used when Javascript is disallowed.
&lt;img src="{$piwikUrl}piwik.php?idsite={$idSite}&rec=1" style="border:0" alt="" /&gt;<br/>
&lt;!-- End Piwik --&gt;<br/>
</code>
+<br/>
+The following parameters can also be passed to the image URL:
+<ul>
+ <li><i>action_name</i> - Defines the custom Page Title for this page view</li>
+ <li><i>idgoal</i> - The request will trigger the given Goal</li>
+ <li><i>revenue</i> - Used with idgoal, defines the custom revenue for this conversion</li>
+</ul>
</div>
<h3>Piwik Tracking API (Advanced users)</h3>

0 comments on commit 3913f47

Please sign in to comment.