Download tracking help

How do i get my downloads to get tracked.
Currently i’ve had people download but it does not get tracked in piwik.
So far i found out about putting this in the link (class=“piwik_link”)
but thats for outside links not downloads.

Anyone know how to do this?
Also if it helps any the download is on a subdomain of my website such as download.domain.com.

It’s in the manual. Look up “Force a click on a link to be recorded as a download in Piwik” in http://piwik.org/docs/javascript-tracking/

i know theres a manual but i dont get how to use the javascript.
Isn’t there an easier way to do this, such as the class thing i did for the link?

Please read the docs that Burkhard linked to. It covers more than just JavaScript.