10: Stat Metrics & Graphing Analytics

This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/10-stat-metrics-graphing-analytics

Hey, I believe the Keen API docs have been updated. I had to add a “timeframe” parameter in my Keen.Metric method. See below:

var metric1 = new Keen.Metric("Engagements", { analysisType: "count", timeframe: "today" // <<<<< I got an error message when I didn't include this });

The Error message I was getting in the web inspector console:

{"message": "Your request is missing a required field. Field: 'Queries must contain a time range. The easiest way to do this is with the timeframe parameter. You may also use filters on the keen.timestamp or keen.created_at properties.'.", "error_code": "MissingRequiredRequestFieldError"}

I love the topic, the this video is outdated for creating Keen clients, tracking, events, and displaying visuals using Keen. Might want to update accordingly or provide links to the docs.

1 Like