New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 goal conversions in the same second, or a page view and goal in same second results in one request being ignored #2508
Comments
Attachment: Piwik debug message file |
Attachment: Piwik API calls debug file |
Issue appears to be intermittent. Have now got 23 completed "when visitor" type goals but the manual goal has only been recorded 10 times |
Is this the result of the CURL call? i.e. PiwiTracker.php accesses the core by issuing an HTTP GET to piwik.php? 0000 00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 ..............E. |
0000 00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 ..............E. |
Correct - are all the pageviews correctly logged in the log_visit table (and only some triggered goals are missing)? |
Yes, it looks like it, visitor_count_visits is 1 and visit_total_action is 28 on the new local DB. I'm only visiting one page on this local site The only missing / incomplete goal is the one set to manual. I can do an SQL dump of the live site table if that would help. |
How does it work?! The HTTP request results in /piwik/piwik.php getting called but piwik.php doesn't in itself seem to handle GET parameters and the debugger fails to stop at breakpoints in the file. Please could you tell me the mechanism whereby the GET parameters are processed? Thanks. |
Take a look at the files which are included by piwik.php. Tracker related actions are in core/tracker. The request and all request params are handled there. |
Hmmm, well currently I can find no evidence that this HTTP GET is actually being processed at all. None of the breakpoints is triggered and no diagnostics are being output. I have all the diagnostic config parameters I can find turned on and / or set to "file" I have scattered liberally extra diagnostics. The only API calls that ever get logged is when the Piwik admin pages are being viewed. I think it should be calling core::Tracker::GoalManager::recordGoals(...) but it never seems to get there. Would you expect the API calls to be logged when goals are being completed from PiwikTracker? |
My mistake, I'm using direct file writes now and not relying on Piwik debug output. piwik.php is being called so the debugging can start... |
First diagnostic run shows now reference to Goal 3 matching so nothing gets updated, will keep getting more output. debugLog file attached |
Hmmm, can't attach file, it's rejected as spam. Doubt I could paste the 7K in here! |
There appears to be an issue with calling doTrackPageView(...) before doTrackGoal(...) as shown in the API documentation as an example. If the call to doTrackPageView(...) is removed or placed after doTrackGoal(...) it kind of works. In fact it looks like making multiple API calls is problematic. I've have put multiple doTrackGoal(...) calls and every other one fails. For a good call I see this in the diagnostics file: 'Visit is known. ' whereas the next call to doTrackGoal(...) fails and the diag output is: 'Visit is known. ' the next call to doTrackGoal(...) then works again. I now have four log files if you would like them but I cannot attach them as I appear to appear as a spammer! |
B****r it! // There is an edge case when: Known issue!! |
OS1, thanks for your investigation. The solution here is to manually change the datetime of the request using putting a datetime different for each pageview/goal conversion. |
Many thanks Matt, I'll give it a try. |
This is a bug which we can easily enough fix actually |
(In [5167]) Fixes #2508 |
this was re-opened in #9916 It is not possible to record more than one conversion per second for the same visit |
We have a number of sites feeding into two shop sites. The WorldPay callback scripts are on just one of these shop sites. We want to be track visitors from specific landing pages with the goal set as a WorldPay callback with SUCCESS is a conversion.
Here is the code we use in the WorldPay callback script:
// -- Piwik Tracking API init --
require_once "../piwik/PiwikTracker.php";
PiwikTracker::$URL = 'http://oursite.com/piwik';
[= new PiwikTracker(1);[BR]
// You can manually set the visitor details (resolution, time, plugins, etc.)
// See all other ->set* functions available in the PiwikTracker.php file
//$piwikTracker->setResolution(1600, 1400);
// Mandatory: set the URL being tracked
$piwikTracker->setUrl('http://oursite.com/post/wp.php' );
// Sends Tracker request via http
$piwikTracker->doTrackPageView('Oursite.com Post Worldpay');
// You can also track Goal conversions
$piwikTracker->doTrackGoal(3, $totalAmount);
The call to doTrackPageView(...) appears to be working. The call to doTrackGoal(...) does not. Goal ID 3 is defined as a "manually" goal. We have other "when visitors" goals and these appear to update correctly.
I have loaded the code into NetBeans and with the PHP debugger I can see it going to PiwikTracker::sendRequest(...) but it never seems to get to core/Tracker/GoalManager.php nor plugins/Goals/ except when in the admin pages.
I have configured Piwik to output debug information to a file and I can see lines like:
INSERT IGNORE INTO piwik_log_conversion (idvisit, idsite, idvisitor, server_time, location_country, location_continent, visitor_returning, visitor_days_since_first, visitor_days_since_order, visitor_count_visits, referer_type, referer_name, referer_keyword, referer_visit_server_date, idgoal, url, revenue, idaction_url, idlink_va, buster) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?).
In 14 attempts goal 3 was only recorded twice in piwik_log_conversion, all the "when visitors" goals have 14 entries.
All goals are currently "Allow Goal to be converted more than once per visit"
How does it manage to INSERT INTO piwik_log_conversion when apparently it doesn't execute any code that actually does this. I've found the message dispatcher but not the message handler!
The text was updated successfully, but these errors were encountered: