Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2011-12-23 07:24:16 +0400
committermattpiwik <matthieu.aubry@gmail.com>2011-12-23 07:24:16 +0400
commit7358c182ca2e94e1b175bc1516cdd194efcb7afd (patch)
treec46944db99b6822968999dc11cd332454cbc572c /plugins/Live/Visitor.php
parentdc09725b0ad561bde5757d8c6c7971c1a2486866 (diff)
fixes #2744
* Now link in Visitor Log and Live! real time widget will pointto the search result page for the google search for the domaain that was used, instead of linking to google.XX/url which redirects to the tracked website's landing page git-svn-id: http://dev.piwik.org/svn/trunk@5605 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Live/Visitor.php')
-rw-r--r--plugins/Live/Visitor.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 260717a433..1d0221e133 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -262,6 +262,18 @@ class Piwik_Live_Visitor
{
return 'http://piwik.org/faq/general/#faq_144';
}
+ // Case URL is google.XX/url.... then we rewrite to the search result page url
+ elseif($this->getRefererName() == 'Google'
+ && strpos($this->details['referer_url'], '/url'))
+ {
+ $refUrl = @parse_url($this->details['referer_url']);
+ if(isset($refUrl['host']))
+ {
+ $url = Piwik_getSearchEngineUrlFromUrlAndKeyword('http://google.com', $this->getKeyword());
+ $url = str_replace('google.com', $refUrl['host'], $url);
+ return $url;
+ }
+ }
}
return $this->details['referer_url'];
}
@@ -271,8 +283,7 @@ class Piwik_Live_Visitor
if($this->getRefererType() == 'search'
&& strpos($this->getRefererName(), 'Google') !== false)
{
- $url = $this->getRefererUrl();
- $url = @parse_url($url);
+ $url = @parse_url($this->details['referer_url']);
if(empty($url['query']))
{
return null;