Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

Event values being rounded? (1 reply)

$
0
0
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.

The problem:

1. I am setting a custom variable called 'timestamp' (which contains a unix timestamp) on my pages:

myTracker.setCustomVariable(2, 'timestamp','<?php echo time(); ?>', 'page');


2. 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:



3. 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:

1. 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:

http://[myhost]/piwik/?module=API&method=Events.getName&idSite=2&period=day&date=today&segment=eventCategory==[theEventIwant];customVariableName1==custid;customVariableValue1==[specificCustomerId];customVariablePageName2==timestamp;customVariablePageName2<=[setTo24hoursAgo]&format=json&filter_limit=5000&token_auth=[myAPIkey]

I added &filter_sort_column=max_event_value&filter_sort_order=desc to the end of it, but it had no impact.

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

Viewing all articles
Browse latest Browse all 4243

Trending Articles