31 Days Without a Lead: What Our Investigation Found
A commit swapped the homepage CTA and the site went 31 days without a lead. The post-mortem: root cause, two silent bugs, and a misconfigured GA4 metric.
Thirty-one days. That's how long the site went without a single new lead, an ugly enough number to make us stop everything and investigate. The result was a post-mortem with one clear root cause, plus two more bugs that had nothing to do with it but had been hiding behind the real problem for weeks without tripping a single alarm.
The root cause: a click that led to the wrong CTA
Tracing commits, we found the culprit one day after the last lead came in: a commit had swapped the link on the homepage hero's main button. It used to point to /contato. After the change, it pointed to Raio-X, our automated diagnostic tool that records the visitor's screen to generate a report. From that commit on, whoever clicked the homepage's most visible button no longer landed on the contact form: they landed on a different feature entirely.
Why Raio-X never converted
Raio-X wasn't sitting idle: we logged 159 requests in 3 days just at the screen-recording step. None of them turned into a lead. The cause is a platform dependency: Raio-X uses the browser's getDisplayMedia API to capture the screen, and that API simply doesn't exist in iOS Safari or Android Chrome. Cold traffic from social media is mostly mobile, so most of the people who clicked ran into a feature their device couldn't use.
The fix had two parts. First, the hero's main CTA went back to pointing at /contato: Raio-X became a secondary option. Second, we added a compatibility check before attempting to record the screen. When the browser doesn't support it, the visitor no longer gets stuck with no alternative: they now see a notice pointing to a manual video upload path.
A second bug, found along the way: negative time
While investigating the funnel, an unrelated bug turned up in the contact form itself. Our anti-bot protection rejects submissions that happen less than 5 seconds after the form opens, a common signal of automation. The elapsed-time calculation had no guard against a negative value: if the visitor's computer clock was ahead of our server's, elapsed time came out negative, which is less than 5 seconds just like any other number. The submission was silently discarded, but the response the visitor saw was still a success (HTTP 200). People were filling out the form, seeing the confirmation on screen, and the lead never arrived anywhere.
A third problem, in a completely separate system
The investigation also turned up a third bug, unrelated to the first two: the automated routine that re-engages leads who don't reply (lead-nurture) had been broken in production for weeks. The cause was a type error in the database query, a comparison between an enum and a text value. The effect matched the other two: the routine returned a success code even while failing, so no re-engagement emails were going out and nobody noticed, because nothing about it looked like a failure.
GA4 was wrong too, just in the opposite direction
Reconfiguring conversion metrics in Google Analytics 4 after the fixes, we found one more loose piece: two conversions were marked as the "primary conversion" in GA4, but neither one actually existed in the site's code. The platform had shown "no data" for both, always. In other words, the zero conversions we'd been seeing didn't measure what we thought it measured: it was a configuration problem, not a real picture of the site's performance.
The lesson: a silent bug never trips an alarm
Two of the three code bugs share a dangerous trait: the form that discards the submission and answers 200, and the lead-nurture routine that fails its query and answers 200 anyway. In both cases the system reported success while doing the wrong thing, with no error log to show for it. The CTA problem was different in kind (a link pointing to the wrong place, no status code involved), but had the same practical effect: nothing visibly broke, the click happened, the page loaded. Silent failure, whether it's an undeserved HTTP 200 or a misconfigured link, is the most dangerous kind of problem precisely because there's no alarm ready to trip. The only reason we caught this was that one essential number (new leads) sat visibly at zero for too long, and someone went looking for why.
The GA4 configuration we fixed here was just the start: the full conversion attribution architecture (how we measure campaign and referral origin without requiring a cookie banner) is detailed in How we measure conversion attribution without a cookie banner.
If your site's funnel also depends on a CTA, a form, and an automation routine running with nobody checking the actual outcome, it's worth reviewing them with the same lens before your own number hits zero. Tell us about your context and we'll see if it makes sense to look at it together.