Laying the groundwork with custom events

The problem

At Salable, a billing infrastructure platform, we have typically relied heavily on PostHog’s automatic events to track user behaviour.

Doing this meant we were missing out on useful event metadata and also risking events becoming splintered over time. For example, if we changed the text for a call-to-action button it would be tracked as a new, separate event—even though the action is identical.

The solution

To address this, I added custom event tracking to the dashboard application and our consumer API. The process of determining what these events should be led me to arrive at 50 unique actions.

Implementing the tracking itself was made simple by providing Claude with the event list and having it write the tracking logic. The harder part was identifying which events and pieces of metadata to capture.

How I narrowed down

I started with the “core” actions a user should be taking if they’re getting acquainted with Salable’s main flow. They are: creating a product, adding a plan, configuring some pricing, connecting a payment provider, and generating a checkout link.

After that, I focused on events that result as a byproduct of the user successfully getting started—like a subscription being created, or a user upgrading/downgrading their plan.

Then I looked to cover all of the tertiary actions the user may take in the dashboard, such as refreshing their API keys, editing a product, or running a manual entitlement check.

Next steps

Capturing these events will allow us to better analyse user behaviour and take action based on it. It’s too early to give specific examples now, but I will be writing a series of case studies going forward that document my efforts towards making Salable as streamlined and intuitive as possible.