Piwik API - Downloads & Custom Variables


I’ve developed a module for Indico software which interfaces with Piwik for statistics tracking. I am currently attempting to link a download listener on the serverside to accomplish this, it is working fine however I wish to obtain ‘top 5’ downloads for any given day and, specifically, a segment.

I am using custom variables when generating the request which logs the download via the cvar parameter as follows:

This returns the following, and registers as a successful hit on the downloads when getDownload() is triggered against it:

Page level Custom Variables: 
array (
  'custom_var_k1' => 'DownloadConferenceID',
  'custom_var_v1' => '137976',
array (
  'idvisit' => '73',
  'idsite' => 1,
  'idvisitor' => 'ÁCÃø`Ç
  'server_time' => '2012-06-13 14:10:10',
  'idaction_url' => 55,
  'idaction_url_ref' => '55',
  'idaction_name_ref' => '0',
  'time_spent_ref_action' => 576,
  'custom_var_k1' => 'DownloadConferenceID',
  'custom_var_v1' => '137976',

The issue is, using Action.getDownloads() I can’t find the correct combination of customVariablePageName1 & value etc to retrieve all the downloads where the value of the name and number match those which I sent over, I am attempting to get only that subset of data.

My only conclusion is that the action of a download isn’t bound to custom variables in the same manner in which page views are, unless there is something which I am missing.

If you can see the solution for this, I’d be most grateful for any assistance offered.

Note: Piwik IP & token_auth in URLs are within local scope only.

did you check in the table piwik_log_link_visit_action to see if the custom var are set properly for your download?

What URL request including segment did you test that didnt work?

Happy New Year! If you are still using Piwik and interested in the awesome new feature of “Creating a Custom Segment in Piwik and apply to reports in Real time!” we need YOUR help, with a little or big donation at: http://crowdfunding.piwik.org/custom-segments-editor/

This will allow to dynamically add or edit, a new set of rules for example “Show all visitors from USA and using Firefox and using Google”. This will be done via a simple to use interface. See screenshots and more info here: http://crowdfunding.piwik.org/custom-segments-editor/

We are crowd funding the future of Piwik and this feature in particular. With your help we can do it.