piwikTracker.trackLink Bug in version 1.6


#1

Hello piwik community!

since update to piwik version 1.6 the piwikTracker.trackLink method doesn’t seem to work any more. I tried various times with different options but it doesn’t work:
The visitor actually gets tracked, but actions doesn’t get tracked anymore.

I debugged the tracking calls:


Debug enabled - Input parameters: <br/>array ( 'download' => '/test2/2/test.zip', 'idsite' => '42', 'rec' => '1', 'r' => '067415', 'h' => '14', 'm' => '25', 's' => '7', 'url' => 'http://***.php', '_id' => 'bba1a6c86f197366', '_idts' => '1323090953', '_idvc' => '1', '_idn' => '0', '_refts' => '0', '_viewts' => '1323090953', 'pdf' => '1', 'qt' => '1', 'realp' => '0', 'wma' => '1', 'dir' => '0', 'fla' => '1', 'java' => '0', 'gears' => '0', 'ag' => '1', 'res' => '1920x1200', 'cookie' => '1', )
Loading plugins: { Provider,Goals,MobileAnalytics,AnonymizeIP,DoNotTrack }
Current datetime: 2011-12-05 13:50:05
Action is a Download URL, Action name = , Action URL =
COOKIE piwik_visitor, rows count: 0, cookie size = 0 bytes array ( )
The visitor has the piwik cookie (idvisitor = bba1a6c86f197366)
The visitor is known (idvisitor = bba1a6c86f197366, config_id = f45a92170bb96339, idvisit = 34115152, last action = Mon, 05 Dec 2011 13:48:52 +0000, first action = Mon, 05 Dec 2011 12:44:31 +0000, visit_goal_buyer' = 0)
Visit is known (IP = ************)
Updating existing visit: array ( 'visit_exit_idaction_url' => 0, 'visit_exit_idaction_name' => 0, 'visit_last_action_time' => '2011-12-05 13:50:05', 'visit_total_time' => 3935, 'idvisitor' => 'bba1a6c86f197366', 'visit_goal_buyer' => '0', )

array (
  'idvisit' => '34115152',
  'idsite' => 42,
  'idvisitor' => '»¡¦ÈŸse',
  'server_time' => '2011-12-05 13:50:05',
  'idaction_url' => 0,
  'idaction_url_ref' => '0',
  'idaction_name_ref' => '0',
  'time_spent_ref_action' => 73,
)

COOKIE piwik_visitor, rows count: 0, cookie size = 0 bytes array ( )
-> Scheduled tasks not running in Tracker: Browser archiving is disabled.
Nothing to notice => default behaviour
End of the page.

array (
)

Time elapsed: 0.033s

I also outputed the “action”-object in /core/tracker/Visit.php, line 304:


Piwik_Tracker_Action Object ( [request:private] => Array ( [download] => /test2/2/test.zip [idsite] => 42 [rec] => 1 [r] => 067415 [h] => 14 [m] => 25 [s*addedOnlyInForumBecauseEscaping*] => 7 [url] => http://*******/_test.php [_id] => bba1a6c86f197366 [_idts] => 1323090953 [_idvc] => 1 [_idn] => 0 [_refts] => 0 [_viewts] => 1323090953 [pdf] => 1 [qt] => 1 [realp] => 0 [wma] => 1 [dir] => 0 [fla] => 1 [java] => 0 [gears] => 0 [ag] => 1 [res] => 1920x1200 [cookie] => 1 ) [idSite:private] => 42 [timestamp:private] => 1323092932 [idLinkVisitAction:private] => [idActionName:private] => [idActionUrl:private] => [actionName:private] => [actionType:private] => 3 [actionUrl:private] => )

Please note that actionName, actionType and actionUrl is empty!


On the frontend Piwik-Tracker is called like that:


var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 42);
piwikTracker.trackLink('/test2/2/test.zip','download');

The request is valid and returns the above debug information!

Thank you very much in advance for your answers. If it is not a bug, I would greatly appreciate if you can help me find a way to get it working again.

Thanks!

Edit: By the way - cronjob is setup correctly and runs with no errors. All reports look fine except the reports mentioned above “download” and “outgoing links”. Further information: In live widget I see the visitor when calling the page with the above tracking code, but “action” is always zero.


(vipsoft) #2

Try trackLink()ing with an absolute url


#3

@vipsoft: Thanks a lot for your answer!

TrackLink kindof works now with absolute url - the action is logged in piwik_log_action table and shown in VisitorLog-Widget as a download or an outgoing link as it should.

BUT: It is not shown in “Actions > Downloads” nor in “Actions > Outgoing Links” as it should.

Does somebody have an explanation for this? Why is it only working with an absolute url since Piwik 1.6?

Below is the new output:


Debug enabled - Input parameters: <br/>array ( 'link' => 'http://www.**************/test2/2/test.zip', 'idsite' => '42', 'rec' => '1', 'r' => '513421', 'h' => '9', 'm' => '28', 's' => '31', 'url' => 'http://www.***********/_test.php', '_id' => '3e6c2d721d75a4fb', '_idts' => '1322218364', '_idvc' => '3', '_idn' => '0', '_refts' => '0', '_viewts' => '1323090421', 'pdf' => '1', 'qt' => '1', 'realp' => '0', 'wma' => '1', 'dir' => '0', 'fla' => '1', 'java' => '0', 'gears' => '0', 'ag' => '1', 'res' => '1920x1200', 'cookie' => '1', )
Loading plugins: { Provider,Goals,MobileAnalytics,AnonymizeIP,DoNotTrack }
Current datetime: 2011-12-06 08:28:49
Info: The outlink URL host is one of the known host for this website.
Action is a Outlink URL, Action name = , Action URL = http://www.***********/test2/2/test.zip
COOKIE piwik_visitor, rows count: 0, cookie size = 0 bytes array ( )
The visitor has the piwik cookie (idvisitor = 3e6c2d721d75a4fb)
The visitor is known (idvisitor = 3e6c2d721d75a4fb, config_id = f45a92170bb96339, idvisit = 34159478, last action = Tue, 06 Dec 2011 08:28:31 +0000, first action = Tue, 06 Dec 2011 08:27:34 +0000, visit_goal_buyer' = 0)
Visit is known (IP = **************)
Updating existing visit: array ( 'visit_exit_idaction_url' => 2573810, 'visit_exit_idaction_name' => 0, 'visit_last_action_time' => '2011-12-06 08:28:49', 'visit_total_time' => 76, 'idvisitor' => '3e6c2d721d75a4fb', 'visit_goal_buyer' => '0', )

array (
  'idvisit' => '34159478',
  'idsite' => 42,
  'idvisitor' => '>l-ru¤ûd',
  'server_time' => '2011-12-06 08:28:49',
  'idaction_url' => 2573810,
  'idaction_url_ref' => '2573812',
  'idaction_name_ref' => '0',
  'time_spent_ref_action' => 18,
)

COOKIE piwik_visitor, rows count: 0, cookie size = 0 bytes array ( )
-> Scheduled tasks not running in Tracker: Browser archiving is disabled.
Nothing to notice => default behaviour
End of the page.

array (
)

Time elapsed: 0.034s


var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 42);
piwikTracker.enableLinkTracking();
piwikTracker.trackLink('http://www.****/test2/2/test.zip','download');
piwikTracker.trackLink('http://www.****/test2/2/test.zip','link');


#4

In version 1.5 we used


piwikTracker.trackLink('/Video/Start','download');

to record video start/stops e.g.

This doesn’t seem to work anymore in 1.6. An absolute url is needed. In “Actions > Downloads” nor in “Actions > Outgoing Links” the grouping feature form cite above doesn’t seem to be available. (it was when using urls like in the example above in version 1.5.) Therefore it is hard to compare videos.

Has anybody an idea for a workaround or a fix?


(Matthieu Aubry) #5

Can you please post screenshot before / after to show what you mean, and see if the problem can be worked around in 1.6 ?