Includes changes needed to properly run the script with
replay_tracking option enabled, when log files contain data from different websites (with different site ID).
When we consider only logs from piwik.php requests, we don't need host in log format to be able to import them, because we always have
idsite value parsed from query string (unless we force
DynamicResolver class checks whether there is a suitable website in the DB for every hit. Normally this check is based on
hit.host, in our case on the
hit.args['idsite']. We wanted to keep this checking in Resolver, because this option seemed the most clear. We added
_resolve_when_replay_tracking method. We couldn't use the existing
resolve method, because we can't add websites with random site ID.
Changes from L1432 prevent adding hits with empty args.
Please review and send suggestions.
Will be discussed / merged in: http://dev.piwik.org/trac/ticket/3632#comment:12
Thanks for the pull request & @diosmosis for pushing it, and adding these new integration tests. we're covered!