matomo-org / plugin-MarketingCampaignsReporting

GNU General Public License v3.0
25 stars 19 forks source link

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

Open peterbo opened 2 years ago

peterbo commented 2 years ago

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.

sgiehl commented 2 years ago

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).

solevis commented 2 years ago

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?

sgiehl commented 2 years ago

@solevis Yes it should.

peterbo commented 2 years ago

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:

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

solevis commented 2 years ago

@solevis Yes it should.

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