Free

PostHog: track events and successful form submissions

Track one successful form-submission event in PostHog. Check it against practice actions and verify unique-user counts before using the metric.
Tools

Installation · Open the service

PostHog shows actions people take in an app. Start with one question: how many unique users successfully submitted a form? Verify events against practice actions before using the measure for decisions.

Measure successful submissions

Choose a form with an independently verifiable result: a database record, created enquiry or server confirmation. A click does not mean success. Send form_submitted only after a confirmed result.

Ask Codex to find the form, handler and existing analytics. Agree on success, report environments and counting period. A practice test can use two signed-in accounts and fictional data. Do not add a second SDK over an existing instance.

PostHog suits in-app action analysis. For visits and traffic sources alone, compare Yandex Metrica (website). Choose by the question and permitted data collection. Check current pricing for selected products and event volume.

How to collect one event

Open a practice PostHog project. Confirm project, region and event-ingestion URL from its settings rather than a random example. Use the Project token for events; Personal API keys serve other tasks and must stay out of browsers.

For ordinary JavaScript, documentation offers:

npm install --save posthog-js

Check the package manager and installed version before agreeing on installation. Use the relevant guide for other environments; browser examples do not belong in server files.

Keep only the required event for the trial. Following the configuration reference, disable automatic action collection, pageviews and session recording. Inspect real outgoing requests: disabling session recording does not disable all collection. Check option names and values against the installed SDK.

Properties should answer the question. A practice-environment marker and form type are enough. Do not send field contents, email, phone or message text. Following collection controls, agree when collection is allowed, stopped and how the user's choice persists next time.

How to count unique users

Two successful submissions from one person should produce two events and one unique user across the selected period.

Following identify documentation, associate signed-in events with a stable account ID. Use an internal ID without personal details for practice. Call reset() on sign-out so the next person's actions on that device do not continue the old analytics session.

Without sign-in, PostHog uses an anonymous browser identifier. This is not an exact people count: different browsers or cleared storage change it. Name anonymous metrics accordingly and record the limitation alongside the report.

In Trends, choose form_submitted, the full test period and practice-environment filter. Compare Total count and Unique users. Do not sum daily uniques to get period uniques: one person may appear on multiple days.

How to check results and find errors

Run a known sequence, waiting for each expected event before comparing full-period counts:

  1. A submits successfully: one stored result, one event and one user.
  2. A submits successfully again: two events and one user.
  3. Trigger an expected server error: no success event and unchanged counts.
  4. Sign A out, sign B in and submit successfully: three events and two users.

Browser retries must not silently duplicate business results. If network failures trigger retries, test server duplicate prevention separately. Analytics does not add it.

For missing events, check call location, SDK initialisation, region, request response, collection consent and browser blockers. For excessive events, inspect duplicate handlers or simultaneous client/server collection. For excessive users, check ID stability, identify timing and the report period. Repeat the sequence after fixes with a new filter isolating the trial.

Result

You get an event, clear identification rules and a saved report. Completion means three submissions by two accounts produce three events and two users, while an error adds no success. Keep period, filters and count limitations beside the report.

opt_out_capturing() stops collection; verify no new requests and persistence after reload. Delete collected history separately in the service for the agreed scope and retention rules. Removing the SDK does not remove history.

Next: web apps with accounts for the whole flow. For differences between events and real writes, use fixing a project bug.

Prompt for verifiable analytics

Paste into Codex or Work with project access:

Find my project, form, server handler and existing analytics. Configure PostHog to answer how many unique users successfully submitted the form in the selected period. Check official setup for our environment and installed version. Use an existing practice project or agree on a suitable project and region; perform available actions yourself.
Send form_submitted only after confirmed server success. Disable unnecessary automatic collection and session recording for the trial; do not transmit field contents or personal data. Check collection choice and real outgoing requests.
For signed-in accounts, use a stable internal ID, correct identify and reset after sign-out. Without sign-in, explain anonymous counting limits. Create a Trends report with the correct event, period and environment; compare Total count and Unique users.
Test two successful A submissions, a server error without a success event, and a successful B submission after A signs out. Expect three events and two users in an isolated trial. Compare each success with its stored result. Check duplicate protection on retries, fix causes and repeat. Show the report, limitations, collection-stop method and separate practice-history deletion method.
In This Article
Saved