How would you generate the SiteCatalyst -> Site Metrics -> Time Spent per Visit using the API?

Posted: December 12, 2008, 1:36pm
How would you generate the SiteCatalyst -> Site Metrics -> Time Spent per Visit using the API?

How would you generate the SiteCatalyst -> Site Metrics -> Time Spent per Visit using the API?

I have tried a ranked report specifying metric=visits, element=timeVisit,top=10 and for various forms of date and dateTo/DateFrom (not exceeding one month), dateGranularity = month. I always get error 5022, Invalid reporting date or date range.

Thanks.

Thank you very much -- that

Thank you very much -- that got things working: 1) do not supply dateGranularity for a ranked report, and 2) use "instances" for the metric in this particular report.

The reason that you get this

The reason that you get this error is because the you have defined the dateGranularity field for a ranked report. For a ranked report this field is invalid since you are only going to get one period back. See table 5.1 in the manual for dateGranularity. This field should not be set and it will work.

Also I see that you are using the visits metric. Time spent per Visit is a little special. The metric in the UI shows as Visits, or Visits(report specific), When using the ReportingAPI, you should use the instances metric

Hope this helps

Frank S

report description

If I could see your report description that would really help out. But I came across this issue a bunch of times. I usually need to enter false in for the date part of the report description.

There is also a chance you are not entering the date correctly for the dateTo dateFrom fields. It needs to be in the format YYYY-MM-DD

I hope that helps

p.s. I am part of Omniture Engineering Services Team. We sell consulting hours for using the API if you are interested. You can e-mail me at paurigemma@omniture.com