I’m new to piwik, but I got it up running and working in good order except for one major problem.
Let me try to summarize my steps:
-
Installed piwik correctly on my server.
-
Installed site tracking code correctly on the footer of my site tracking multiple pages.
-
Checked - stats tracking. Db looks OK (piwik_log_action tracking)
-
Set up cron job to to automatically archive the reports.
Here is the following command i used in cpanel:
0 * * * * /bin/sh /home/usr/site/piwik/misc/cron/archive.sh
Note: In piwik ‘general settings’ default values used (Allow Piwik archiving to trigger when reports are viewed from the browser = YES; Reports for today will be processed at most every = 10sec)
Additional Note: I alternatively later disabled auto-triggering since i had the cron job running and put the processing to every 1/2hr), neither setting though would appear to influence the issue experienced. -
Cron job reports sent hourly to my site email, here’s an excerpt from the email body for yearly archiving:
Archiving period = year for idsite = 1…
<?xml version="1.0" encoding="utf-8" ?> Archiving for idsite = 1 done! Reports archiving finished. Starting Scheduled tasks...No data availableFinished Scheduled tasks.
*** In Piwik, there was yearly and weekly archive data available all day today. The cron job is running hourly. Yearly/Weekly Data has been available and showing throughout, also outputted to website OK for several hours.
NUTSHELL: Then all of the data including for ‘today’ gone. Within the hour, ‘today’ data back, archive data/api output gone. Over the course of the last two hours, still no archive data being generated or live visitors, for today = 0.
I heavily suspect that if I go on tomorrow morning, there will be archive data, which will be collected starting fresh, which will then disappear and be deleted later in the day again.
PROBLEM/DETAILS:
Let’s take today for the example where I have been monitoring and setting up an api feed of data onto my site for the duration of the last 8 hours.
Stats have been compiling up fine, where the a) weekly and yearly archives have been showing data and b) the Live Visitors dashboard widget has been both showing data for ‘Today’ and ‘Last 30 minutes.’
Using api I have been outputting data to my site using the following parameters:
piwik/index.php?module=API&method=Actions.getPageUrls&format=XML&idSite=1&period=year&date=yesterday&token_auth=[(enabledtokenhere)]&filter_limit=100
Over the last several hours, everything great, data compiling, api feed working. OK.
Then all the sudden ( A )
- No data coming through the api feed
- An xml reading would show this only: and an error message i have triggered is the feed is empty.
( B ) Refreshing Piwik, All archive data disappears, showing “There is no data for this report.” For ‘today’ as well as yearly archive.
A short time later (1/2hr or so, approximately), reports for today reappear minus ‘Live Visitors’ widget: Visits, Pageviews are reset to 0. Last 30 minutes showing hits.
Checking weekly or yearly date range for stats: “There is no data for this report.”
Exporting the XML for instance back from today’s reports that is showing data:
piwik/index.php?module=API&method=Actions.getPageUrls&format=XML&idSite=1&period=day&date=2010-12-06&token_auth=[(enabledtokenhere)]&filter_limit=100
YES, showing data.
Exporting the XML for instance back for yearly or weekly reports of course is outputting nothing except:
The previous couple day’s since I set up piwik I noticed that the stats or archived data from previous day around the same time just disappear.
For my own experience the only thing I’m new at is setting up cron jobs and since I suspect the issue involves something that is obviously happening on a schedule daily, erasing all previous data, I’m guessing it is cron-related?
Could someone please help me figure this out, or let me know what the problem is from my scenario, if my cron command is correct, etc.
Cron command in cpanel again:
0 * * * * /bin/sh /home/usr/site/piwik/misc/cron/archive.sh
THANKS