Problem with outlinks


(beermad) #1

I’ve installed Piwik on two websites and it’s giving me a lot of interesting data. The only significant problem I have is that neither installation seems to be collecting data on outlinks.

According to what I’ve read in the documentation, anything to a different domain should automatically be counted as an outlink, but that’s not happening. I’ve even tried specifically giving links the piwik_link class, but to no avail.

Presumably whatever I’ve done wrong, I’ve done wrong on both installations; can anybody suggest anything I can do to isolate where the problem is? At the moment I’m stuck for any ideas as to how to run diagnostics on the installations.

Thanks in advance.


(vipsoft) #2

Can you provide a URL to your site?

The only limitation that I know of is related to 3rd party iframes (eg AdSense).


(beermad) #3

[quote=vipsoft @ Feb 23 2009, 04:42 PM]Can you provide a URL to your site?

The only limitation that I know of is related to 3rd party iframes (eg AdSense).[/quote]
http://www.beermad.org.uk/links/sellers will go direct to a page with what should be outlinks that aren’t registering. As can be seen by the snapshot http://www.beermad.org.uk/images/outlinks.jpg

Thanks for your help.


(Momo) #4

Same problem for me… but I upgraded from 0.2.28. With 0.2.28: no problem, since I upgraded, I have no data in Outlinks widget.
URl for the site: http://www.angrymum.com

Momo


(gilly) #5

Same Problem here after 0.2.2.8 update to 0.2.2.9 - 0.2.3.0 didn’t fixed it style_emoticons/<#EMO_DIR#>/sad.gif


(vipsoft) #6

rollback piwik.js to 0.2.28 and see if that fixes what you see; if it does, please post the name of your browser, version, and OS.


(vipsoft) #7

Interesting… what’s common to all your sites is the use of prototype & scriptaculous…


(Matthieu Aubry) #8

vipsoft, I believe you already know this, but one way of debugging if the outlink tracking works is to look with Firebug and see if you see the http request to Piwik when clicking on the link; if you can’t see the request then the problem is on the JS side.


(vipsoft) #9

Thanks for the tip Matt.

But I’m fairly certain the problem lies in prototype. As soon as I include prototype.js, I see the error “alias.substr is not a function” in the Error Console on outlinks.


(vipsoft) #10

Ok, found it: Prototype intentionally breaks the use for “for” to iterate over the contents of an array.

http://www.prototypejs.org/api/array

I’ll submit a patch.


(Momo) #11

I made two things and it seems to work now (don’t know if both are necessary):

  • I went back to 0.2.28: outlinks worked again.
  • I put again 0.2.30 and moved the piwik javascript code from end of body section to head section: work also.
    Is the position of the Piwik Javascript code the problem?

(vipsoft) #12

You shouldn’t put the current version of piwik.js in the section because it generates an tag, which isn’t allowed in the section.

The outlinks problem is because Prototype breaks for…in globally, and technically, doesn’t play nicely with 3rd party JavaScript.

The patch is two lines. See http://dev.piwik.org/trac/ticket/566


(Momo) #13

Thank you Vipsoft. I (again) go back with the position of the javascript code and applied the patch:
seems to work well.

Thanks again

Momo


(yebaws) #14

running 0.2.32, just upgraded from 0.2.28.

I have the same problem. Although everything else tracks, no outlinks showing.

My tracking code:

<a href="http://piwik.org" title="open source Google Analytics" onclick="window.open(this.href);return(false);">
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.mysite.net/piwik/" : "http://www.mysite.net/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 1;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
</script>
<object><noscript><p>open source Google Analytics <img src="http://www.mysite.net/piwik/piwik.php?idsite=1" style="border:0" alt=""/></p></noscript></object></a>

and I have even added a piwik tag to my outlinks:

http://www.mysite.net/piwik/piwik.php?idsite=156&link=http://www.externalsite.com

but the outlinks still don’t track.

tracking code isn’t in the head and I have tried moving it to the beginning and the end of the body with no change…


(vipsoft) #15

You may have to clear your browser cache and/or touch piwik.js, so that your browser doesn’t use an old, cached version.

If that doesn’t resolve the issue, please provide a URL to a page with the piwik tracking code setup for your site. This should have been fixed by 0.2.32, so if you’re experiencing this symptom, it’s likely a new problem.