Creating custom time-aware analytics

  • 27 September 2022
  • 0 replies

Userlevel 1

It’s always been a pain getting time-aware analytics I feel good about e.g. completed X action in the first 2 days.

I’d either do it with messy SQL or set up some custom function that felt complicated. I’ve been fleshing out this pattern in CIO recently I think can work well moving forward.

I have a “Setup” metric I track that’s roughly - “did they create X in the first 2 days?” This is super valuable to track the stages of my Activation funnel. If my Setup metric is not where I want it to be I know I need to improve user flows (or messaging strategy 😉).

Here’s how it works:

(1) Use the “Send event” action where I want to check the metric. This sends a generic “Custom Metric” event with the situational context in the body.


“Custom Metric” is generic and I can add specific details in the data properties. This pattern is useful for the next step.


If you set up the “Custom Metric” event in a generic way with specifics in the data properties (outlined above) you can reuse this pattern to send many different types of custom events.

(2) Then I have a “Send custom analytics” campaign listening for the “Custom Metric” event as a trigger.


Here are the details of the “Send to PostHog” tile (PostHog is analytics tool).


A couple things worth calling out.

  • Everything in the properties section is something you may want to filter on in your analytics tool to build charts
  • The context set in the previous step is now the event name when we send it to our analytics tool. You can see this in the next step. This abstraction helps reuse the pattern Custom Metric (action) + Send custom analytics (campaign).
  • Same idea with the analytics_value key. In this example it’s true/false. But in a different context it could be something else but we can still use the Custom Metric (action) + Send custom analytics (campaign) pattern. You only need to set up the new Custom Metric where you need it and the “Send custom analytics” campaign stays the same.

It now shows up in the Analytics tool (PostHog) whenever the Custom Metric trigger hits with all the context we set.


Now you can easily chart against it!


I like this because you can use the “Custom Metric” event (action) + “Send Custom Analytics” (campaign) pattern all over the place. You don’t need to a bunch of one-off campaigns. I’ve always wanted an easy way to generate this chart. I have “aha” and “habit” metrics that are similar time-aware events where I can use this pattern. 

Keen to hear any thoughts or suggestions folks have on this pattern. Or, if someone has something else they like. I think there’s probably a more real-time way to do this with the “wait until” action but I haven’t dug in too deep yet.

0 replies

Be the first to reply!