Avatar photo

Spying on you guys is so much fun! Part 2.

Right now our #1 goal at Keen IO is to get developer feedback on our product. We don’t simply want people to go to our site. We want them to really engage with our API, so we can get detailed advice on how we can make it better.

I wanted a way to count of the number of “engaged developers” so we could measure our progress toward our goal. I came up with a loose definition of “engaged developers”: organizations that have created their own event collections, sent events, AND run analysis queries on those events. Here’s how I built the query to count that:

1. We have an event collection that records every time someone makes an analysis API call. We record the type of analysis query (count, extract, average, etc), the details of the query, and other relevant information, such as the organization and project being queried. We record as much contextual information about every event as we can, because that opens up a lot more segmentation and analysis capabilities later.

2. To build my analysis query on this event collection, I started with a “count unique” of all the organizations represented in it. This is essentially a de-dupe of all of the analysis events by organization ID.

3. I applied filters to this query to get rid of the noise. For example, I’m excluding analysis calls done on the the default Sample Project we generate for each account, as well as activity coming from our own internal Keen projects.

This is much easier to do since we released a new query builder. It dynamically builds the URL for me as I add more filters, and also gives a live update of the count as I apply filters.

What’s left after the filtering are organizations who have created their own custom projects and run analysis calls on them.

Now we have a metric that correlates directly with our goal for the next few months. We cheer every time the number goes up. I think this is a good example of how you can use analytics to focus your business and align your team.

Saved Queries

Here’s what that raw HTTP query looks like. It’s really long because it has 9 filters and they are JSON-encoded.

https://api.keen.io/3.0/projects/projID/queries/count_unique?event_collection=analysis_api_call&filters=%5B%7B%22property_name%22%3A%22project.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Sample%20Project%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Keen%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Kirk’s%20Test%20Organization%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Keen%20Monitoring%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Ryan’s%20Test%20Org%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Michelle’s%20org%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Apptastic%2C%20Inc.%22%7D%2C%7B%22property_name%22%3A%22project.organization.id%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22000000000000000c%22%7D%2C%7B%22property_name%22%3A%22project.organization.name%22%2C%22operator%22%3A%22ne%22%2C%22property_value%22%3A%22Big%20Data%20and%20Bigger%20Data%20Science%22%7D%5D&target_property=project.organization.id&api_key=123456

It works great, but it’s kind of annoying if I want to add another filter later. Lucky for me, we have a feature called saved queries. Now I can save this query with a short name. I called it “engaged_devs”.

Here’s what the saved query URL looks like.

https://api.keen.io/3.0/projects/<projID>/saved_queries/engaged_devs/result?api_key=<key>

The short URL is much easier to work with. If I want to add additional filters later (for example, exclude Kirk’s activity on his re-route project), I can simply login to Keen.io and add a filter to that saved query. No need to update the reports & dashboards where I’ve embedded this query, since the URL doesn’t change.

===

This post is Part 2 in Michelle’s Analytics Showcase. Here are some links to other posts in the series:

====

Michelle’s Analytics Showcase:

Part 1: Logins

Part 2: Filtering & Saved Queries

Part 3: Pushing results to a dashboard