plugin-MarketingCampaignsReporting icon indicating copy to clipboard operation
plugin-MarketingCampaignsReporting copied to clipboard

After enabling the plugin, wrong numbers are reported for overlapping timeframes (core campaign handling vs. plugin campaign handling)

Open peterbo opened this issue 3 years ago • 5 comments

Reported here: https://github.com/matomo-org/matomo/issues/19318 and also experienced this myself, if the MarketingCAmpaignsReporting plugin was not active from the beginning (but activated later, while data was already in the system).

The report Acquisition -> Campaigns reports only numbers since the activation of the MarketingCampaignsreporting plugin for overlapping timeframes. For timeframes before the activation, report data is still correct.

The report Acquisition -> All Channels -> Campaigns still reports correct numbers, also for overlapping / intersecting timeframes.

peterbo avatar Jun 13 '22 15:06 peterbo

That's because the plugin is actually creating it's own dimension fields in the log tables. When it's installed later, that means for old records they are empty. We could either try to copy over the values on install of the plugin (which could cause trouble for bigger installs) or merge the reports with the core reports, where no data is available for the plugin (which will at least make incorrect data on the day the plugin is installed).

sgiehl avatar Jun 13 '22 16:06 sgiehl

That's because the plugin is actually creating it's own dimension fields in the log tables. When it's installed later, that means for old records they are empty. We could either try to copy over the values on install of the plugin (which could cause trouble for bigger installs) or merge the reports with the core reports, where no data is available for the plugin (which will at least make incorrect data on the day the plugin is installed).

Hi @sgiehl, the UPDATE query mentioned in issue #9 still valid to update data for MarketingCampaignsReporting log tables?

solevis avatar Jun 14 '22 12:06 solevis

@solevis Yes it should.

sgiehl avatar Jun 14 '22 12:06 sgiehl

Hey @sgiehl

We could either try to copy over the values on install of the plugin (which could cause trouble for bigger installs) or merge the reports with the core reports, where no data is available for the plugin (which will at least make incorrect data on the day the plugin is installed).

I agree that this could be dangerous for bigger instances and could lead to more unwanted behaviour. Perhaps, this problem is just something to be documented well:

  • Campaign reports will be "broken" for overlapping periods (core campaign handling vs MCR plugin)
  • if the user wants to fix that, here are the mysql queries for copying over the past campaign data to the new structure and this is how to invalidate / re-archive past reports (if necessary)

In most cases, this won't be necessary, but it'd be good to have this in the MarketingCampaignReportings docs.

peterbo avatar Jun 14 '22 14:06 peterbo

@solevis Yes it should.

I executed the query and data seems correct now, thanks :+1:

solevis avatar Jul 04 '22 07:07 solevis