# Tracking lead form conversions for a Strapi landing page experiment

Asked by Noemi Ricci on 2025-12-04. Tags: strapi, goals, lead-generation.

Fullstack dev at a fintech. Landing page content comes from Strapi, hero mapped
to a Croct slot, experiment running with two variants. What I have:

- form submit works, leads land in our CRM
- experiment dashboard shows visitors per variant
- conversions: zero, for two weeks

The primary goal is set to `lead-submitted` in the experiment config. I assumed
the goal gets counted from the form POST somehow. Clearly wrong. How are goals
supposed to connect to events for a lead gen case like this?

## 2 answers

### Answer from mattgru (2025-12-04)

The experiment never sees your form POST. The primary Goal ID must reference
an event that your frontend is already tracking through the SDK, and setting
the ID in the dashboard does not create the event. Two weeks of zero
conversions with working submits means the event simply never fired.

Add a track call to your submit handler:

```js
croct.track('goalCompleted', {goalId: 'lead-submitted'});
```

Fire it after the submission succeeds, not on button click, otherwise failed
validations count as conversions. Once events start arriving they attribute
to whichever variant the visitor was assigned. The two weeks of past submits
are not recoverable, the experiment cannot count events it never received.

### Answer from Ade Okafor (2025-12-05)

Worth mentioning there is also a dedicated `leadGenerated` event among the
manual events, alongside the generic `goalCompleted`. Semantically it fits
your case better and keeps lead events distinguishable in analytics if you
later track other goals on the same page.

Either works as an experiment goal, just be consistent: whichever event you
fire is the one the Goal ID has to reference. Lead gen is one of the listed
use cases for the Strapi integration, there is a published case of a team
(VR Gente) getting a 70% lift in lead gen with this exact pattern, so the
wiring you are doing is well trodden.
