Hallo,
es geht um folgende Funktion, die ich aus der Doku entnommen habe:
Force a click on a link to be recorded as an outlink in Piwik
If you want Piwik to consider a given link as an outlink (links to the current domain or to one of the alias domains), you can add the ‘piwik_link’ css class to the link:
<a href='http://mysite.com/partner/' class='piwik_link'>Link I want to track as an outlink</a>
Note: you can customize and rename the CSS class used to force a click to being recorded as an outlink:
[...]
// now all clicks on links with the css class "external" will be counted as outlinks
piwikTracker.setLinkClasses( "external" ); // you can also pass an array of strings
piwikTracker.trackPageView();
[...]
Soweit so gut. Ich habe versucht es so umzusetzen, allerdings ist es mir nicht gelungen. Ich habe dem a-Tag die Klasse “piwik_link” gegeben und den JS Code exakt an der Stelle eingefügt wie verlangt. Allerdings wird bei ausgehende Verweise nichts getrackt.
Wo liegt mein Fehler?
hier einmal mein code:
<a href="Link" class="piwik_link">Link</a>
[...]
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
piwikTracker.setLinkClasses( "external" );
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
[...]
Über Hilfe wäre ich sehr dankbar.
P.S.: ich benutze Piwik 1.7
Gruß
Tjorben