A browser sign-up event depends on a page loading and the tracker running on it. Your backend knows the moment the account is actually created. Hardal's guide to measuring sign-up completion puts it plainly: a click on a sign-up button does not establish that an account was created.
So send each business step from the system that confirms it. For a SaaS funnel, the web tracker records page visits, and your backend sends sign-up, activation and first payment.
Decide which system sends each step
Give every step one sender. Hardal's guide to server-confirmed purchases is explicit that a shared ID alone does not deduplicate submissions. If both the browser and the server send sign_up, it is recorded twice.
| Step | Recorded when | Sender | Event |
|---|---|---|---|
| Pricing and sign-up page visits | The page loads | Web tracker | page_view, collected automatically |
| Sign-up | Your backend creates the account | Sign-up handler | sign_up |
| Activation | Your activation rule is met for the first time | Backend job or handler | A custom event you name, e.g. activated |
| First payment | Your payment provider confirms the first paid invoice | Webhook handler | A custom event you name, e.g. first_payment |
sign_up is one of Hardal's standard events. Activation and first payment are specific to your product, so you send them as custom events. Hardal asks for lowercase snake_case names that you keep stable, because renaming an event splits its history. activated and first_payment are example names; choose your own.
Send sign_up from the server
Hardal takes server events as an HTTP POST to the collection URL shown in Setup, with tenantId at the top level of the body and sourceId inside the payload. The API & Server-side Setup page lists every field. One helper keeps all calls the same:
// Node 18+. One helper for every server-side funnel event.
async function sendHardalEvent({ eventName, occurredAt, url, data, consent, userId, userAgent }) {
const granted = consent === "granted";
const res = await fetch(process.env.HARDAL_COLLECT_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": userAgent, // the visitor's UA when forwarding their request, your app's UA for backend jobs
"x-hrd-consent": granted ? "granted" : "denied",
},
body: JSON.stringify({
tenantId: process.env.HARDAL_TENANT_ID,
type: "event",
eventName,
payload: {
sourceId: process.env.HARDAL_SOURCE_ID,
url,
timestamp: occurredAt, // when the step happened, in Unix milliseconds
...(granted && userId && { userId }),
data,
},
}),
});
const body = await res.json();
if (res.status !== 202 || body.data?.accepted !== 1) {
throw new Error(`Hardal did not accept ${eventName}: ${res.status}`);
}
}
Call it right after the account is saved, with eventName: "sign_up" and data: { method: "email" }. Three details come straight from the docs:
- Timestamp. Send the time the step happened, in Unix milliseconds. If you retry a delayed event, reuse the stored time.
- Consent. You can send server events without a known identity. Send
x-hrd-consent: grantedand auserIdonly when your consent rules allow identification. Otherwise senddeniedand leave identity out. - User-Agent. It is required. Forward the original client user agent when you are forwarding a request, and use your application's user agent for backend events.
Send activation and first payment once
These two steps run in a different code path from sign-up: a background job or a webhook. Make each one fire once per account.
- Activation. Store an
activated_atvalue on the account. Sendactivatedonly in the same step that sets it for the first time. - First payment. Stripe, for example, retries webhook delivery for up to three days in live mode, and its docs note that an endpoint may receive the same event more than once. Record the invoice ID before you send
first_payment, and skip invoices you have already sent.
Put the value and currency in data, and keep the same keys and types every time. Hardal's custom event docs ask for that consistency, so the parameter stays usable in reports.
Check each step in Hardal
Open Engagement → Events. To compare the steps, pick sign_up, activated and first_payment in the timeline's Events picker so they chart side by side over the same report range. To check one step's parameters, find it in the Event Log and open it. To scope the scorecards to these events, use Filters → Behavior → Event name. Hardal's Events report docs describe each control.
Test with one account first
- Sign up with a test account. Expect HTTP
202withdata.accepted: 1. - Find
sign_upin the Event Log and check its time and parameters. - Trigger activation twice and confirm that only one
activatedevent arrives. - Pay with a test card, deliver the same webhook event to your handler twice, and confirm that only one
first_paymentarrives.
Once all four pass, every step comes from the system that confirmed it, and each one is recorded once. The full endpoint and payload reference is in Hardal's API & Server-side Setup docs.