Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Clarification in Javascript Tracking Code #796

Closed
anonymous-piwik-user opened this Issue · 1 comment

3 participants

@anonymous-piwik-user

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 );
piwikTracker.trackPageView();
[...]

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.

Thanks
michael

@robocoder
Collaborator

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.

@anonymous-piwik-user anonymous-piwik-user added this to the Piwik 0.4.1 milestone
@mattab mattab added the wontfix label
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.