Analytics API Specifications


#1

Hi, I had a couple questions about the new Analytics API.

  1. Is there a way to make sure I don't hit a RESULT_POINT_LIMIT_EXCEEDED error when querying the analytics API using the daily time period? I found this in the documentation: "When using a :time_period of daily, weekly, or monthly, the results are limited to 500 time points." Does that mean if I make sure my days are a maximum of 500 days apart (if I'm using daily) or my months are a maximum of 500 months apart (if I'm using monthly) then I should never hit that error?

  2. When I use some of the breakdowns, they do not return the actual breakdown with the response. For instance, when I use sessions as the :breakdown_by parameter, it returns results that look like they are broken down but have no breakdown field with them.
    Edit: I figured out if I use daily instead of summarize/daily for these endpoints then it DOES return the breakdowns (I'm not sure why, but maybe you want to make note of that in the documentation?). However, when I use geolocation or any of the utm-types as the :breakdown_by parameter, then I get an error that says a filter is required but I cannot find the filter options anywhere. How am I supposed to know what I can filter by?

I have clients waiting for this integration so quick replies would be much appreciated.


#3

Hi again @Wes_Thompson,

Happy to clarify:

  1. That's correct. With the daily time period, for example, your start date and end date cannot exceed a span of 500 days. Keep in mind that the start and end dates are inclusive and will be treated as being in the time zone of the portal.
  2. I'll share your feedback on our documentation. Per your remaining questions:
  • The geolocation breakdown uses ISO 3166 Alpha-2 country codes. If you send a request to https://api.hubapi.com/analytics/v2/reports/geolocation/total?hapikey=demo&start=20180101&end=20180901, you'll see a number of countries returned.
  • Appropriate filters for utm-campaigns, utm-contents, utm-mediums, utm-sources, and utm-terms will depend on how your organization formats tracking URLs. To pull analytics data for all Facebook traffic, for example, you might use https://api.hubapi.com/analytics/v2/reports/utm-sources/total?hapikey=demo&start=20180101&end=20180901&f=facebook.

#4

Thanks again. This information is very helpful.


#5