This form calls preventDefault(), posts in the background and swaps in a success
message. The page never changes. This is the single most common reason a lead form produces
no conversions.
fetch('/api/lead', { method: 'POST', body: data })
.then(function (r) { return r.json(); })
.then(function () {
// Wrap in the callback so the Tag is guaranteed to be ready.
AnyTrack(function () {
AnyTrack('trigger', 'Lead', {
email: emailField.value, // raw — AnyTrack hashes it per platform
unique: 'client' // one Lead per visitor, even on a retry
});
});
showSuccess();
});
value, not revenue or amount. If the
lead is worth something, value: 29.90 as a number — and then the event should be
CompleteRegistration rather than Lead, since Lead is the
zero-value one. A key AnyTrack does not recognise is ignored silently, not rejected.