Every week, we will release tips to help you get the most out of Mixpanel. Want to see more? Click here to see other #mpknowledgedrop articles.
In this #MPKnowledgeDrop we will walk through some of the most common moments for errors when setting up webhooks.
Does this sound like you?:
You read our Webhooks developer docs and are interested in using a webhook message. However, you are in the process of implementing and have yet to send a successful webhook.
If this sounds familiar — you are in the right place! Together we will go through a series of steps to help you troubleshoot webhooks.
When creating a webhook campaign, make sure that your webhook is set to Active and Sending.
When using webhooks, you need a 200 OK HTTP response in order for Mixpanel to mark the users in the message as being successfully sent to the webhook. Otherwise, we will assume the webhook for the users in that POST request failed, and we will send them again in the next message attempt.
You can use a webhook testing service to see if it works, like https://www.webhook.site.
Next, you need to ensure that your servers can handle the webhook response. You can use this linked guide to confirm you have configured your server to receive webhooks or you can check your URL’s ability to receive webhooks with https://www.apirequest.io/.
Another worthwhile check is whether your server provider has any "Browser Integrity Check" options, or if you have any validations set up that could be interfering with your webhook. Some providers (e.g., Cloudflare) block requests from Mixpanel due to the useragent/header not matching a regular browser. If you can confirm that your webhook is set up to receive POST requests without validation, you should be in good shape to move to the last step.
Our last checkpoint together is helpful if you are seeing message errors such as
Webhook_HTTPError:400 Bad Request, messages like these tell us that we are sending the webhook to the saved address, but the web server doesn’t know how to handle it. Think about this analogy: we’re sending a package to someone's doorstep, but they aren’t opening the door (by responding with a 400) and we don’t have the keys to put it inside ourselves. If this is the case, make sure that your webhook is in the correct format and make sure it has the correct parameters.
Pro Tip: when you are sending test webhooks campaigns, you should always set the target criteria email addresses from your company — this helps you avoid sending user information to a third party.
These are some of the most common issues users face when sending webhooks, but please let us know if we missed something on this list.
If you have any tips to share about using webhooks, please feel free to post them in the thread below!