Expand my Community achievements bar.

SOLVED

How to filter out zero values from hourly report in API

Avatar

Level 2

Hey,

I'm trying to request a hourly trended report through API request, it'll always returned 24 * daily report rows, even some rows the metrics count are all zero. Is there any way I can filter out with only non-zero metric counts returned through hourly report?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

maybe not

remark: your request just doesn't make sense for me. have a look at the following situations:

a) a visit with just one page view for 20 minutes (maybe very interested visitor) and the evar78 set will give you the counts 1 visit, 1 bounce, 0 time spent. what do you get out of the numbers? maybe filter out all bounces for time calculation afterwards

b) a very interested visitor had a visit with page views every 10-15 minutes over 3 hours (maybe drinking some coffee between?). if the visit has the evar touched in one hit at the beginning, the visit shows up in every report with the following numbers: 1 visit, 0 bounces, 3 hours (time for visit!). if you count up those numbers of all reports, you end up with 3 visitors and 9 hours time spent (or maybe 4 visits depending on when the visit started). only average remains the same

i don't know if it is useful to get those numbers in an hourly report other than just for interest. if you really want to calculated on those numbers, better change to a monthly reporting window.

View solution in original post

5 Replies

Avatar

Employee Advisor

What is the current API request that you're using? Perhaps the format can be improved upon.

Avatar

Level 2

Thanks for the reply. My current API request is like this:

{

"reportDescription":{

"reportSuiteID":"RS_ID",

"date":"2017-08-14",

"dateGranularity":"hour",

"metrics":[

{

"id":"bounces"

},

                        {

"id":"visits"

},

                        {

"id":"totaltimespent",

                                "type":"time"

}

],

"elements":[

{

"id":"evar78",

"top":"1000",

"startingWith":"0",

}

],

}

}

Avatar

Community Advisor

i guess you can't filter out the zeros within the request. this is due to the metrics you use: thise are calculated based on the lookback window! sehe more here: Data appearing outside reporting window

example: maybe there is a hit with the desired evar78 in a visit, therefore the evar-dimension appears in the result list of your report (due to the visit!). but if the hit was not in the desired timefrime (eg. one second before, but visit still active), the visit remains 0.

i guess you can only set a filter after retrieving the data ...

Avatar

Level 2

Thanks for the reply. Does that mean as long as I'm requesting in "Hour" granularity and with evar-dimension, we can't filter out zeros within the response?

Avatar

Correct answer by
Community Advisor

maybe not

remark: your request just doesn't make sense for me. have a look at the following situations:

a) a visit with just one page view for 20 minutes (maybe very interested visitor) and the evar78 set will give you the counts 1 visit, 1 bounce, 0 time spent. what do you get out of the numbers? maybe filter out all bounces for time calculation afterwards

b) a very interested visitor had a visit with page views every 10-15 minutes over 3 hours (maybe drinking some coffee between?). if the visit has the evar touched in one hit at the beginning, the visit shows up in every report with the following numbers: 1 visit, 0 bounces, 3 hours (time for visit!). if you count up those numbers of all reports, you end up with 3 visitors and 9 hours time spent (or maybe 4 visits depending on when the visit started). only average remains the same

i don't know if it is useful to get those numbers in an hourly report other than just for interest. if you really want to calculated on those numbers, better change to a monthly reporting window.