-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blog] Practical alerts examples #10147
base: master
Are you sure you want to change the base?
Changes from 7 commits
b5e940b
8c978d6
ef3c56a
c8c3886
02797a5
775d987
91b8ee6
2b95890
9a77bf4
9c8919a
fbe8b95
4c95c8a
02017f7
b69b2c1
6c879f3
07f5b41
462961a
eb1927a
bd4c2eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,139 @@ | ||||||
--- | ||||||
title: '6 practical uses for PostHog alerts' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love this headline. We should workshop some ideas before we go live |
||||||
date: 2024-12-16 | ||||||
author: | ||||||
- bijan-boustani | ||||||
rootpage: /blog | ||||||
category: General | ||||||
tags: | ||||||
- Alerts | ||||||
- Product updates | ||||||
--- | ||||||
|
||||||
To keep life interesting, it's important to live in a state of perpetual ignorance. When things are going well, there's no need to find out why. When things go south, let anxiety run its course. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrote this as a fun, funny introduction. But if it doesn't land then it's no big deal to me if we want to rip it out and start with the "PostHog's new alert features..." line below. |
||||||
|
||||||
![Homer covers his eyes](https://res.cloudinary.com/dmukukwp6/image/upload/319051_c8e072f85e.gif) | ||||||
|
||||||
An alternative, less exciting, approach to life is to become aware as things change. For example, you can use PostHog's new alert features to receive notifications based on your [insights](/docs/product-analytics/insights). | ||||||
bijanbwb marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
You can track important metrics and get email notifications when they cross threshold that you specify. The threshold can be an absolute value (e.g. pageviews exceeded 1,000) or a relative amount (e.g. conversion rate increased by 10%). | ||||||
|
||||||
So, instead of having to remember to check in on the status of a a metric or feature; you can receive an email alert when changes occur. | ||||||
|
||||||
Let's get started with how to create alerts, and then we can dive into some practical examples of how they can be helpful. | ||||||
|
||||||
## How to create alerts | ||||||
|
||||||
Alerts are based on your insights. You can select from your existing [trends](/docs/product-analytics/trends/overview), or create a new one. | ||||||
bijanbwb marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
To create an alert, click the **Alerts** button on the top right of the insight page. | ||||||
|
||||||
<ProductScreenshot | ||||||
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/alerts_button_4ecd022cd6.png" | ||||||
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/alert_button_dark_c2f642fde3.png" | ||||||
alt="alerts button" | ||||||
classes="rounded" | ||||||
/> | ||||||
|
||||||
To configure the alert, we'll set the following: | ||||||
|
||||||
- **Name:** the name you'll see when the alert is triggered. | ||||||
- **When:** the data points the alert will be based on. The drop-down contains a list of all the series in your insight's graph. For example, if you have an insight that tracks the number of pageviews and signups, you can use either of these series as the basis for the alert threshold. | ||||||
- **Type:** select "has value" to check if the series is more or less than an absolute amount. Or, select "increases by/decreases by" to check if the series increased or decreased by a relative amount. These can also be configured with a percentage instead of a static value (e.g. signups increased by 10%). | ||||||
- **Frequency:** set how often you want to check the alert threshold (hourly, daily, weekly, monthly). | ||||||
- **Who to notify:** select who should receive an email when the alert is triggered. | ||||||
bijanbwb marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
<ProductScreenshot | ||||||
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/filled_alert_627158e6bb.png" | ||||||
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/alert_people_dark_0ccd7611bd.png" | ||||||
alt="filled alert" | ||||||
classes="rounded" | ||||||
/> | ||||||
|
||||||
Then, you can click **Create alert**, and you're all set. | ||||||
|
||||||
<ProductScreenshot | ||||||
imageLight="https://res.cloudinary.com/dmukukwp6/image/upload/insight_alerts_5k_daef47ade1.png" | ||||||
imageDark="https://res.cloudinary.com/dmukukwp6/image/upload/created_alert_dark_1710da74dc.png" | ||||||
alt="insight alerts" | ||||||
classes="rounded" | ||||||
/> | ||||||
|
||||||
For a more detailed walkthrough, you can also check out our our [Alerts docs](https://posthog.com/docs/alerts), which we'll also update as new alerting features get added. | ||||||
|
||||||
## Practical uses for alerts | ||||||
|
||||||
Now that we can create alerts, let's take a look at a handful of practical examples. | ||||||
|
||||||
### 1. Get an alert when traffic spikes | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could I track all my blogs and get a notification when one of them goes viral? |
||||||
|
||||||
Want to investigate spikes in traffic to your website? This can be useful when testing marketing campaigns to see if they trigger the expected spikes in traffic. | ||||||
|
||||||
But these kinds of alerts can also be useful to investigate an _unexpected_ spike in traffic. We often see this at PostHog when our content gets featured in a popular email newsletter or shared on Hacker News. When we notice an influx of new signups, it can be interesting to dig in and try to figure out where they came from. | ||||||
|
||||||
For example, we can get an alert when the number of pageviews for our [pricing page](/pricing) rises above 8,000 views for the week. First, you can [create a new trend insight](/docs/product-analytics/trends/overview#1-creating-a-new-trend) to track pageviews where "Path Name" equals "/pricing". Then, filter by the year to date and group by week. | ||||||
|
||||||
Then, set up an alert using the steps above to trigger a notification when the number of pageviews rises above 8,000. When the threshold is crossed, this is what the email looks like: | ||||||
|
||||||
![Pricing pageviews alert](https://res.cloudinary.com/dmukukwp6/image/upload/posthog_alert_df58e89828.png) | ||||||
|
||||||
### 2. Get notified for 404 page anomalies | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwiw, I feel like the 404 section is a bit on the long side. Would be good if you could simplify a little. |
||||||
|
||||||
You can also use alerts to track down errors. For example, you can track the number of visits to your 404 page. If someone visits `posthog.com/some-nonexistent-url` they will land on our 404 page, and some number of these kinds of visits to this page is to be expected. Anyone that misspells a URL or finds a dead link is bound to land here at some point. | ||||||
|
||||||
But what about anomalous spikes in 404s? It might mean you deployed a broken link somewhere. Or perhaps you moved a page and need to set up a redirect to prevent users from missing it. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
In this case, you can set up another trend insight to graph the number of pageviews for your 404 page. You can examine the graph to establish a baseline for a standard amount of traffic to the 404 page. Then, set up an alert to check when 404s are significantly higher than this baseline. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs a mention that you'd have to set up a custom event to capture 404 pages (or maybe there is a way to do it with an action). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also have a tutorial on this that might be worth linking: https://posthog.com/tutorials/broken-link-checker |
||||||
|
||||||
![Graph of 404s](https://res.cloudinary.com/dmukukwp6/image/upload/404_graph_79107f52bb.png) | ||||||
|
||||||
One of the great things about these graphs is you can click the graph where you see a spike and it will display a list of all the users effected. And if you have [session replay](/session-replay) enabled, you can go through and watch the session where the 404 occurred and figure out exactly which link is broken. | ||||||
|
||||||
In addition to 404s, this same logic can be applied to other anomalous events like "rageclicks." Rageclick events are when a user has rapidly and repeatedly clicked in a single place. It could be an indicator that there is some visual affordance that looks like it should be interactive, but users are surprised to find out it does nothing. You can use the same process we used for the 404 visits to hunt down rageclicks as well. | ||||||
|
||||||
### 3. Alert if billing emails are not sent | ||||||
|
||||||
Alerts can also be used to check for the _absence_ of something happening. | ||||||
|
||||||
For example, PostHog tracks the number of transactional billing emails that get sent out every day. If these emails aren't getting sent, it would be a big deal. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would someone track this? |
||||||
|
||||||
To do something similar, you can track events when you trigger these transactional emails. Then, create an insight to track the number of transactional emails sent every day. | ||||||
|
||||||
Then, we can set up an alert called "No billing events sent" that gets triggered when the transactional emails have a value less than 1. | ||||||
|
||||||
We can set the frequency to check this daily. And for critical alerts like this, you can add more than one email to the notification list and ensure the entire billing team gets the alert. | ||||||
|
||||||
### 4. Monitor deploys and new features | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole section is a bit too vague, what are some specific ways they can use alerts to make sure their deploy goes well? Also, what are the most important alerts to set up? |
||||||
|
||||||
With feature flags, you can set up [canary releases](/tutorials/canary-release) to slowly roll out changes and make sure your new features work well before they're released to all your users. | ||||||
|
||||||
But you still want to monitor deploys and new features to verify that they're having the intended effect and not triggering unexpected errors. | ||||||
|
||||||
![Simpson, you've got a 513](https://frinkiac.com/meme/S08E23/385084.jpg?b64lines=U0lNUFNPTiwgWU9VJ1ZFIEdPVCBBIDUxMyE=) | ||||||
![That got it](https://frinkiac.com/video/S08E23/XOUcScbq8W_7yoA6nti16cCC31A=.gif) | ||||||
Comment on lines
+119
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of gif and they aren't the same size which is a bit jarring
|
||||||
|
||||||
For example, you could track error events and trigger an alert if the error rate rises above a particular threshold after a new feature launch. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you mention that you could use a feature flag property to filter for these errors? |
||||||
|
||||||
But there are more subtle issues that aren't necessarily bugs or errors. For example, you could launch a big redesign for the product pages on your marketing website. Or change the copy on some of your CTAs. Those won't necessarily trigger errors, but they could still have a drastic impact on engagement. | ||||||
|
||||||
So you can set up an alert that coincides with the launch of your redesigned pages, and verify that the number of clicks for the CTAs on those pages should be increasing, not decreasing. | ||||||
|
||||||
### 5. Alert on changes in conversion rates | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good section |
||||||
|
||||||
To set alerts on changes in your conversion rate, you can set up an insight that tracks visits to your pricing page as well as user signups. For example, we can create a trend insight and filter for pageviews where "Path Name" equals "/pricing". And then add a filter for our `user_signed_up` event. So this insight will display a graph with a line for the number of pageviews for the pricing page as well as a separate line for the number of users that signed up. | ||||||
|
||||||
![Conversions](https://res.cloudinary.com/dmukukwp6/image/upload/conversion_graph_d4ac533adf.png) | ||||||
|
||||||
To find out if the conversion rate is increasing or decreasing by a specified percentage, we can set up multiple alerts. We can set up one alert for when the `user_sign_up` event is increasing by 5% and a separate alert for when the `user_sign_up` event is decreasing by 5%. | ||||||
|
||||||
### 6. Alert on breakdown in referral sources | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is basically the same as the first one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I think the differentiation for this one was just to show that you can create alerts for trends that have a breakdown. But I'll take another look and see if there's a way to further differentiate. It's a decent example that was mentioned in the GitHub issue, but you're right it could be redundant. |
||||||
|
||||||
Alert on major changes in breakdowns. "For example, I have a graph showing traffic to my site by day broken down by referrer - if there's a major change in who's referring traffic (a bunch of new traffic from a new source, or a previous major source of traffic disappearing) I'd love to be able to get alerts about that, even if the overall traffic total doesn't shift. | ||||||
|
||||||
> Note: For trends with breakdown, the alert will fire if any of the breakdown values breaches the threshold. | ||||||
|
||||||
## Upcoming improvements and suggestions | ||||||
|
||||||
Alerts are currently available for trends insights. But we're currently working on adding alerts for [funnels](/docs/product-analytics/funnels), which will make it easier to track conversions across various stages. For example, we can create a funnel to see how many users are following through and signing up after visiting our pricing page. | ||||||
|
||||||
Thanks to [Anirudh](/community/profiles/30974) for making this much-requested feature a reality. The idea for threshold-based alerts started as a [GitHub Issue](https://github.com/PostHog/posthog/issues/14331), so if you have other interesting use cases and suggestions for how to improve the features be sure to let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth thinking about how we are going to promote this piece, likely needs some solid backlinks to help people find their way there.
Could we plan a social post/thread for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. I think we could probably pick out the most compelling example(s) and share those on social.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Should link from the Alerts docs for a start. Could probably add to some product analytics pages.
We can also turn the individual ideas into social posts.