TrackLinks with Class and funktion

(MROXZ) #1


it seems to me that class piwik_download is currently not working. The actions are all tracked as normal site view but not as download as it should be!

can anybody help?


(Matthieu Aubry) #2

could you prepare a small HTML page where the problem can be reproduced?

(MROXZ) #3

here you go

    <title>Titel der Webseite</title>
    <!-- weitere Kopfinformationen -->
    <!-- Kommentare werden im Browser nicht angezeigt. -->
    <p>Inhalt der Webseite</p>

    <a class="piwik_download" href="" target="_blank">download</a>

    <!-- Piwik --> 
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "" : "");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">

var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 44);
piwikTracker.setCustomVariable(2, 'Thessaurus', '/Technik/Gestaltung/1234567890/1234', 'page');

</script><noscript><p><img src="" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->


If I click on the link the view will be recorded but no download!

(Matthieu Aubry) #4

If you link to an external domain, the click will be counted as “Outlink” — is this the behavior you are observing (that the click is tracked as outlink) ?

(MROXZ) #5

Correct. The link is tracked as outlink. But I thought it will be tracked as download if it has the css class “piwik_download”

(Matthieu Aubry) #6

Good suggestion! I created a ticket Piwik.js: when using class="piwik_download" on an outlink, it should track a download and not an outlink · Issue #3292 · matomo-org/matomo · GitHub

(MROXZ) #7

ok if that isn’t the already intended behavior of the css class “piwik_download” then the documentation is misleading