Hey, there! First, love Piwik. Easy to get up and going, easy to track advanced features, and (so far) a good API to do stuff with that data.
- I am setting a custom variable called ‘timestamp’ (which contains a unix timestamp) on my pages:
myTracker.setCustomVariable(2, 'timestamp','<?php echo time(); ?>', 'page');
- When I look at it in the Detailed Visitor Log, I see two things: the correct timestamp, and a timestamp rounded to the nearest 1000:
- When I pull an event report from the API, I get the WRONG, ROUNDED numbers in the max_event_value field.
There are a couple of questions I have here:
- I am trying just to get the latest events from this query - in order, from most recent event to least recent event. I have thousands of events a day, so it needs to be granular at least to the minute, but preferably second. To do this, I’ve put the timestamp in the custom variable, then I pull the last day’s events, then I sort them after the fact in a script. Is this the easiest way to do this? I tried using the sort parameters with the getEvent method, but they didn’t work. Here’s my call to the API:
I added &filter_sort_column=max_event_value&filter_sort_order=desc to the end of it, but it had no impact.
- If I am doing it the best way, what can I do to get the exact timestamp reflected in the max_event_value field?
Thank you for your help! I’ve dug through all the forums and the web with no luck on this one.