I’m using an automated system to transform stats of a website (collected by another analytics framework) to Piwik HTTP calls. Since the visits have happened in the past, I need to use token_auth to set the time to past.
The problem is, the visits are not sorted by time. Sometimes, different visits by same users are reported out of order, and it causes Piwik_log_visit to have anomalous rows; rows where visit_first_action_time is later than visit_last_action_time, which means the length of that visit is negative.
Is there any way I can fix that?