How to Improve API Product Analytics for Business Users

Posted in

The majority of B2B collaboration now happens over APIs. Ergo the data flowing through your API is a good representation of the health of your business. Yet, outside of infrastructure engineering, there’s a lack of tooling around how to leverage that API data.

Today, business analytics tools either focus on:

  1. Offline transactional data sitting in databases and warehouses such as Redshift or Snowflake, or
  2. Online usage metrics sitting in tools like Mixpanel and Amplitude to understand how consumers interact with web and mobile interfaces.

This has left a gap for companies trying to extract insights on not only their web and mobile assets, but any digital asset that is API-driven. These could be partner integrations, vendor APIs, or APIs served to customers.

With the API industry standardizing around common design patterns like REST, JSON, and GraphQL, it’s becoming easier for companies to collect and analyze that data without building elaborate custom solutions.

Architecture of an API Analytics Solution

Baseline API Analytics for Technical Users

To start, an API analytics system should capture basic info around the API. This includes the HTTP verb, path or route, and HTTP headers. Additional metadata should also be tracked, such as status code, authentication information, and latency. Such attributes enable technical metrics such as 90th percentile latency broken down by endpoint, and discovery of any outliers.

Expanding API Analytics to Business Users

Tracking only performance and functional API metrics is not enough for a system to be leveraged by business users. For an API analytics system to be useful, requests need to be tied back to business concepts.

Business concepts could include what an API transaction means, the direction in which money or value flowed, and who the API user is. Because APIs are technical in nature, adding more context, such as a transaction description and which team owns the API, is paramount. For example, if we were to see the top endpoints being used by the largest customers, one might do a top k aggregation like so:

Endpoint Daily Event Count
GET /items 545451
GET /items/:id/categories/ 454151
POST /comments 3488
POST /purchase 101

API analytics for business users may tag API transactions with an easy description. Today, this can be done automatically via popular API markup languages like OpenAPI Specification to generate a report like so:

Endpoint Daily Event Count
Get a List of Items 545451
Get a List of an Item’s Categories 454151
Create a Comment 3488
Create a Purchase 101

Analyzing Request and Response Body

Capturing the entire payload enables drilling into not just which endpoints are called or how much latency it takes, but what the actual customers of your API are querying or posting to the API. This allows tracking business entities like sales and orders. Additional metadata should also be tracked, such as status code and authentication information and latency. The below image shows the number of API calls grouped by the “label” field in the response JSON and then grouped by customer name.

By looking at the actual data over the wire, we are able to see when our API was responding with Out of Stock as a Label or Type.

Adding Customer Demographic Information

By pulling customer information in systems like Salesforce and internal user tables, business users can slice and dice the API data by customer name, employee count, and marketing attribution. This enables business users to understand which types of users are adopting and successfully using APIs while investing in the right sales and marketing initiatives that drive results. For example, the below chart shows unique API users broken down by marketing channel.

How Can Business Users Leverage API Analytics?

By adding customer demographic information, a well-designed API analytics system can answer questions like:

  • Track the customer journey from initial touch to fully activated/integrated accounts, while finding which marketing initiatives drive higher activation rates.
  • Discover whether a specific API program is healthy by looking at product retention rates.
  • Plan a better product strategy by knowing which API features are used or not used.
  • Monitor when a new account activates or has struggles and preempt any hard discussions.

In the below image, we are able to track the customer journey and understand where they dropped. For this, we need to define north star metrics such as Time to First Hello World and Time to Valuable Action

Making API Analytics Actionable

To be actionable, end-users need the ability to create triggers and workflows when specific criteria are reached. For example, an account executive or customer success manager can create an alert whenever a specific new user changes in API traffic. A product manager can create a dashboard showing various metrics on unique active users and feature usage, whereas a Chief Marketing Officer may want a dashboard showing which marketing channels are driving the most activations and how conversion rates are trending. This means an API analytics system should have an ability to create dashboards for each team consuming the service, including sales, customer success, support, product, and marketing.

Obstacles to Deploying API Analytics

While deploying API analytics can have a tremendous impact to the growth trajectory of an organization deploying APIs, there are issues that organizations need to think about.

Maintenance Cost

High-volume APIs can heavily tax a poorly designed analytics system. Teams are always oversubscribed, which means shortcuts are taken when creating internal systems that are not exposed to customers, whether on scalability, security, or both.

Compliance Risk

Analytics systems can potentially track PII or sensitive information that is subject to regulation, such as GDPR and CCPA. Having the correct processes and workflows in place to expire and remove data is critical when storing such data. In addition, robust access control should be in place to safeguard user data.

Ease of Use

While technical users may be fine directly parsing logs and digging into time-series metrics in APM tools like Splunk and Datadog, business users’ productivity will drop if they are forced to adopt such tools. In such cases, the extra burden is placed on engineering and data science teams to generate reports. Self-serve analytics is critical for any organization serious about agile development and speed of innovation.