How to override findKnownVisitor() in VisitorRecognizer?

Hi everyone,

I would like to extend Piwik by changing the logic how the current visit is being determined, which is in Piwik\Tracker\VisitorRecognizer.findKnownVisitor(). How can I approach this? I already tried injecting my own VisitorRecognizer into the StaticContainer without success; overriding the Visit also did not bring my towards my goal.

I run another system in front of Piwik, which already contains all visit logic, i.e. it determines for every single request a non-Piwik-visit-id (= external_id) this request belongs to. I send this external_id as a custom dimension to Piwik and have it available as piwik_log_visit.external_visit_id. Now I would like to determine the current visit by this external_visit_id.