Skip to content

Commit

Permalink
Fixes #1528
Browse files Browse the repository at this point in the history
 * Also adding in product doc about parameters to the Simple Image Tracking code
  • Loading branch information
matt committed Jul 29, 2010
1 parent 081e403 commit 3913f47
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/Tracker/Visit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
}

/**
Expand Down Expand Up @@ -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));
Expand Down
3 changes: 3 additions & 0 deletions misc/tracker_simpleImageTracker.php
Original file line number Diff line number Diff line change
@@ -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'>
7 changes: 7 additions & 0 deletions plugins/SitesManager/templates/DisplayAlternativeTags.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 3913f47

Please sign in to comment.