How do I find out that my contact form broke before a visitor tells me?

Report a caught failure with Sentry.captureException, and record a named goal only after the server accepts the message. Owners and Administrators get one email the first time that error appears. Compare goal completions with the previous period and with pageviews of the form page. A form that stays broken does not email again.

Last updated 26 November 2026. By Paul Badarau.

Ida, a fictional developer, runs a pottery workshop. The contact form shows a thank-you line even when the server refused the message, and nobody writes to tell her.

  1. In the catch, call Sentry.captureException with the error. A catch that only changes the page text swallows the failure, so Monitoring never sees it. An exception that escapes the catch is stored on its own once the SDK is running.
  2. Create a named goal first. Owners and Administrators add goals. The collector refuses a name that is not already a goal. Look the form up inside DOMContentLoaded. Call postdeploy.track('message-sent') only after the server accepts. In this sketch, sendMessage resolves on that accept. document.addEventListener('DOMContentLoaded', function () { var form = document.querySelector('form'); if (form) form.addEventListener('submit', function () { sendMessage().then(function () { postdeploy.track('message-sent'); }); }); });
  3. Compare that goal's completions with the previous period, and with pageviews of the form page. Pageviews that hold while completions fall mean the page still loads and the accept path stopped. New Projects respect Do Not Track and Global Privacy Control, and both counts follow that rule.

Owners and Administrators get the new-issue email once per fingerprint, in a digest at most every 10 minutes, with at most 20 emails an hour and 100 a day per Workspace. A send still waiting after 6 hours is dropped. Viewers are not mailed. A form that stays broken sends no second email. If the form file never runs, there is no exception and no goal, while the deferred analytics snippet can still record the pageview. That split, pageviews present and completions absent, is the signal that the form code did not finish.

The product page for this is Monitoring.

Start your 14-day free trial