Skip to content
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

Updated the conversion query to force index #160

Merged
merged 8 commits into from
Oct 23, 2024
5 changes: 4 additions & 1 deletion RecordBuilders/CampaignReporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Piwik\DataTable;
use Piwik\Metrics;
use Piwik\Plugins\MarketingCampaignsReporting\Archiver;
use Piwik\Version;

class CampaignReporting extends RecordBuilder
{
Expand Down Expand Up @@ -76,7 +77,9 @@ protected function aggregate(ArchiveProcessor $archiveProcessor): array
protected function aggregateFromLogs(LogAggregator $logAggregator, array $records, $dimensions, $table, $aggregatorMethod): void
{
$whereClause = $table . ".referer_type = " . Common::REFERRER_TYPE_CAMPAIGN;
$query = $logAggregator->$aggregatorMethod($dimensions, $whereClause);
$query = $aggregatorMethod === 'queryConversionsByDimension' && version_compare(Version::VERSION, '5.2.0-b1', '>=')
? $logAggregator->$aggregatorMethod($dimensions, $whereClause, [], [], false, false, true)
: $logAggregator->$aggregatorMethod($dimensions, $whereClause);

$recordToDimensions = $this->getRecordToDimensions();

Expand Down
Loading