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

Cannot display evolution chart for segmented data before plugin installation date

Open mimmovele opened this issue 7 years ago • 9 comments

Hi Piwik team, we've installed the Marketing Campaigns Reporting plugin on Apr 5, 2017, v3.0.2. We can't see data before the installation date of the plugin, only data after. How can we generate reports for the past? Shouldn't the referral data (the UTMs) be in the piwik db anyway? Please note that we've already executed the core:archive task for the past w/o success.

Any help would be greatly appreciated, thanks.

mimmovele avatar Apr 13 '17 14:04 mimmovele

I'll investigate this. Guess we should be able to make it possible to view the campaign names and keywords for periods before the installation of this plugin

sgiehl avatar Apr 13 '17 19:04 sgiehl

Ok. This is a bit tricky to solve. The new campaign data ist stored in other database fields. To get segmented data for old and new campaign you could adjust the segment you are using instead of campaignName==x you could use campaignName==x,referrerName==x

Alternatively you could update the log_visit table, I could provide a simple update sql or maybe add a command to the plugin to make that possible. But doing that automatically on install isn't something we can do, as such an update can run really long for big databases.

sgiehl avatar Apr 13 '17 19:04 sgiehl

@sgiehl thanks for your help. What would that SQL query be?

Facens avatar Apr 21 '17 13:04 Facens

UPDATE `log_visit` SET `campaign_name` = `referer_name`, `campaign_keyword` = `referer_keyword` WHERE `referer_type` = 6;

You may add your table prefex (eg piwik_) to the table name log_visit

sgiehl avatar Apr 21 '17 18:04 sgiehl

@sgiehl we've applied the query:

UPDATE `piwik_log_visit` SET `campaign_name` = `referer_name`, `campaign_keyword` = `referer_keyword` WHERE `referer_type` = 6

but no data previous the plugin's installation have been shown.

We've also performed a core:archive action for a period of time previous to the plugin's installation date: sudo -u www-data ./console core:archive --force-idsites=1 --force-date-range=2017-03-20,2017-04-04 --url=https://xxxxx

Thanks for your help.

mimmovele avatar Apr 24 '17 12:04 mimmovele

The initial question was about segmented data. Are you using preprocessed segment reports? Or are you referring to the normal reports now?

sgiehl avatar Apr 24 '17 12:04 sgiehl

@sgiehl we need both.

mimmovele avatar Apr 24 '17 13:04 mimmovele

Running the archiver only might not have been enough, as it skips already archived data. You may need to invalidate or remove the reports for that dates. See https://piwik.org/faq/how-to/faq_59/ or https://piwik.org/faq/how-to/faq_155/

sgiehl avatar Apr 24 '17 13:04 sgiehl

@sgiehl I'm afraid the above did not help.

We've invalidated: sudo -u www-data ./console core:invalidate-report-data --dates=2017-03-01,2017-04-04 --sites=1

and then re-processed: sudo -u www-data ./console core:archive --force-idsites=1 --force-date-range=2017-03-20,2017-04-04 --url=https://xxxxx

but nothing changed. Are we still missing something?

mimmovele avatar Apr 24 '17 15:04 mimmovele