Downloads Tracking


(jstock) #1

I have installed piwik 0.6.3 on my apache server. The downloads are not being displayed correctly.

I have verified that all PDF files are being logged to the piwik_log_action table.
However any visit that views one of these PDF files is not creating an entry in the piwik_log_link_visit_action table.
While the PDF is being viewed the download shows in the downloads widget on the web site, however if I view another web page and refresh the piwik web page the download does not show any longer.

Does anyone have any ideas on what I should look at to resolve this issue?

John


(jstock) #2

After reinstalling, I have found that each file will show as 1 download for each day, however if the file is downloaded by anyone else it does not show int he download widget.


(jstock) #3

I have been doing more testing on this issue

I have a site setup using 0.6.2 and find that on the multi site page it show 2 visits 13 pageviews
On the Dashboard it shows 8 pageviews and 3 downloads.
This has 2 pageviews missing, these pageviews are 2 downloads of one of the PDF files that are not showing in the Downloads widget.


(jstock) #4

I have tested this further and find that in both 0.6.3 and 0.6.4 the log_link_visit_action table only has entries for action type 1, 4 is page title so does not matter, however 2 is outlink and 3 is download. These actions not being logged is a problem.

I have found that the insert command has a null value for an int field, the db will not allow this

Piwik_Tracker_Db_Mysqli->prepare($query = ‘/* SHARDING_ID_SITE = 50 */ INSERT INTO piwiklog_link_visit_action (idvisit, idaction_url, idaction_name, idaction_url_ref, time_spent_ref_action) VALUES (?,?,?,?,?)’, $parameters = array (0 => ‘3’, 1 => ‘11’, 2 => NULL, 3 => ‘9’, 4 => 20))

This query is on line 267 of core\tracker\action.php
the 3rd parameter is the one that is null for actions 2 and 3,
I changed
$this->getIdActionName()
to
is_null($this->getIdActionName()) ? 0 : $this->getIdActionName()

Now all downloads and outlinks are logged into the log_link_visit_action table
All of these actions are now reported correctly on the web site.

John


(Matthieu Aubry) #5

Thanks for your report! I created a ticket in http://dev.piwik.org/trac/ticket/1484


(Norway) #6

[quote=jstock @ Jul 16 2010, 07:18 PM]I have tested this further and find that in both 0.6.3 and 0.6.4 the log_link_visit_action table only has entries for action type 1, 4 is page title so does not matter, however 2 is outlink and 3 is download. These actions not being logged is a problem.

I have found that the insert command has a null value for an int field, the db will not allow this

Piwik_Tracker_Db_Mysqli->prepare($query = ‘/* SHARDING_ID_SITE = 50 */ INSERT INTO piwiklog_link_visit_action (idvisit, idaction_url, idaction_name, idaction_url_ref, time_spent_ref_action) VALUES (?,?,?,?,?)’, $parameters = array (0 => ‘3’, 1 => ‘11’, 2 => NULL, 3 => ‘9’, 4 => 20))

This query is on line 267 of core\tracker\action.php
the 3rd parameter is the one that is null for actions 2 and 3,
I changed
$this->getIdActionName()
to
is_null($this->getIdActionName()) ? 0 : $this->getIdActionName()

Now all downloads and outlinks are logged into the log_link_visit_action table
All of these actions are now reported correctly on the web site.

John[/quote]

I have also tested this, had some major breakdowns while trying.
I must have done something wrong.


(jstock) #7

[quote=Norway @ Jul 19 2010, 01:28 PM]I have also tested this, had some major breakdowns while trying.
I must have done something wrong.[/quote]

Norway,

If you can show the code that you tried and let me know what happened when you tried this I will see what I can do to help you get it working correctly.

John