in VisitFrequency API in 2.0 we started processing data for a segment:
const RETURNING_VISITOR_SEGMENT = "visitorType%3D%3Dreturning%2CvisitorType%3D%3DreturningCustomer";
In pre 2.0 it used to be recorded as metrics in the VisitFrequency plugin archives.
Let's add a few lines of code to read the data from pre-2.0 format, when the $date is earlier than Dec 17th (date of 2.0 release)
This is a follow up of the change in https://github.com/piwik/piwik/commit/a701d4a43a7185b9d9422de0d1d97c9b2e0fcc5d
The complicated thing is to deal with cases where the data spans across multiple days or weeks or months. In this case the API must both select the old data and the new one and then merge these two datasets into the returning datatable.
In 6db8deac1e34f07ba6e7a7cd88dddfb464ae5b87: Fixes #4878, use pre-piwik 2 data in VisitFrequency API if post-piwik 2 data cannot be found. Commit includes commented out tests for changes.
build is failing, reopening
I have tested as follows:
What I see:
See attached screenshot.
can you reproduce?
Call to undefined method Piwik\Plugins\VisitFrequency\API::addPrePiwik2DataIfMissing()
In 1ff6595df264a97b4d44fcdf6f54d030ff2a74a1: Refs #4878 Fix error addPrePiwik2DataIfMissing not defined
In 8dfafd8a2d3ee7e69d78c4fa727de351fcb4a462: Refs #4878, fix bug in VisitFrequency.addPrePiwik2DataIfNewDataAbsent and add test for multiple periods w/ pre Piwik 2 VisitFrequency data.
Tested w/ updated piwik 1.12 install, works. Closing.
In daf970ffd5d438b8782b8e9a4294fbcbdbea0889: Fixes #4878, re-introduce VisitFrequency Archiver in order to successfully combine pre-2.0 VisitFrequency data with new data.
In 775663fe1e9ab7b67aa2bd607f9ada00724723fa: Refs #4878, fix nb_uniq_visitors metric issue in VisitFrequency archiving and fix errors in build.
In ccf4b4b901ae70ba0493d62570c57769d0ca1594: Refs #4878, fix strange bug in computing unique returning visitors for visit frequency api that caused fixture to fail when running UI tests.
In 2acf544656d29d4ed9010c669abd81f218f1c092: Refs #4878, add another test.
In 263b0700c9f700bc00749fbadc0f67f4bc478b26: Refs #4878, create update script for converting *_returning metrics to new segmented metrics. Removed Archiver and API. Old segmented VisitFrequency metrics will not be accessible.
In b1ecd19eeb1020aaaa8e9176adb8908d69dffe30: Refs #4878, fix improper refactor.
In a6a9ce2d15a50be7128c5da075b3b15327c9662e: Revert test to previous state from 10 days ago, now that we've reverted the API refs #4878
In db1707b719fc1616bbab1b1bf3d838781362a248: beta 12, including the VisitFrequency update code refs #4878