Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#796 closed Bug (invalid)

Clarification in Javascript Tracking Code

Reported by: mic Owned by:
Priority: normal Milestone: Piwik 0.4.1
Component: Documentation Keywords:
Cc: Sensitive: no


After reading (and reading ...) it is not 100% clear to me how this should be done.

For example:

Force a click on a link to be recorded as a download in Piwik

If you want Piwik to consider a given link as a download, you can add the ‘piwik_download’ css class to the link:

<a href='last.php' class=’piwik_download’>Link I want to track as a download</a>

Note: you can customize and rename the CSS class used to force a click to being recorded as a download:

// now all clicks on links with the css class “download” will be counted as downloads
piwikTracker.setDownloadClass( “download” );

Once you are talking of 'piwik_download', then of 'download'.
Does this mean that Piwik recognize the CSS.class 'piwik_download' as 'download' and records it?
Or is this only a type and it should be always 'piwik_download' or 'downlaod'.

And - must it be always (piwik_)download or can i name the css.class as i want?
Therefore i have to build up the piwik js.code with this won created css.class

I am only asking, because i am building some implementations and widgets dynamically.


Change History (2)

comment:1 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to invalid
  • Status changed from new to closed

By default, Piwik will recognize a number of file extensions as downloads. However, if it's off-site, it's treated as an outlink. Using the class, "piwik_download", will force an off-site download to be treated as a download. setDownloadClass allows you to define your own class names -- let's say you already use the class name, 'download', on links to your downloads.

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Keywords javascript tracking code documentation removed
  • Sensitive unset
Note: See TracTickets for help on using tickets.