# CTA Funnel Analysis: Button Clicks → Lead Generation

**Last Updated:** 2026-02-17

## Summary

The 11% completion rate (button click → form submit) in your GA4 Funnel Exploration is **correct** but **misleading**. The funnel is diluted by non-CTA clicks that GTM incorrectly categorizes as `buttonclick_demo_testen`.

## Verification via GA4 API

Run the analysis script to verify data:

```bash
php v2/scripts/dev-helpers/ga4-cta-funnel-analysis.php --start=2026-01-01 --end=2026-02-17
```

**API results (2026-01-01 to 2026-02-17):**

| Metric | Value |
|--------|-------|
| buttonclick_demo_testen (users) | 2,168 |
| generate_lead (users) | 343 |
| Completion rate (API) | 15.82% |
| Funnel completion (GA4 UI) | 11.34% |

The funnel uses stricter semantics (step 1 → step 2 in same session), hence the lower 11.34%.

## Root Cause: GTM Trigger Too Broad

The `button_text` breakdown reveals that **non-CTA elements** are being tracked as CTA clicks:

| button_text (truncated) | Users | Issue |
|-------------------------|-------|-------|
| Zuschlagsrechner Zuschläge berechnen... | 138 | **Tool card** – navigates away, 0% conversion |
| Ordio Funktionen Preise Kostenlose Analyse NEU... | 295 | **Header/nav** – not a lead CTA |
| Grundlohn / Stundenlohn (€) Nachtarbeit... | 45+ | **Calculator form labels** – not CTAs |
| Kostenlos testen | 984 | ✅ Actual CTA |
| Demo vereinbaren | 181 | ✅ Actual CTA |
| Erkenne versteckte Risiken... | 119 | CTA card (ShiftOps) |

### Why This Happens

1. **Tool cards** (`/tools/`) – When users click a tool card (e.g. Zuschlagsrechner), they navigate to the tool page. GTM captures the full card text. These users never see the lead form on the same page → 0% conversion.

2. **Header/nav** – "Ordio Funktionen Preise Kostenlose Analyse..." is likely the header/nav area. Clicks there are not lead CTAs.

3. **Calculator labels** – "Grundlohn / Stundenlohn (€) Nachtarbeit..." suggests GTM is capturing clicks on calculator form labels or table headers.

## Codebase Setup (Correct)

- **CTA buttons** use `data-event-type="button_click"` and `data-event-name="Kostenlos testen"` (or similar).
- **Footer** (`v2/base/footer.php`) sends clicks to server-side `tracking.php` via `trackEvent()`.
- **GTM** must be firing `buttonclick_demo_testen` from a different source (e.g. generic click trigger with `button_text` from Click Text variable).

The codebase does **not** push `buttonclick_demo_testen` to dataLayer. This event is configured in **Google Tag Manager**.

## Recommendations

### 1. Narrow GTM Trigger (High Priority)

In GTM, restrict the `buttonclick_demo_testen` trigger to **only** elements that open the lead capture modal:

- **Option A:** Fire only when `data-event-type="button_click"` is present (use Click – All Elements + condition: `Click Element` matches `[data-event-type="button_click"]`).
- **Option B:** Fire only when `data-event-name` is one of: `Kostenlos testen`, `Demo vereinbaren`, `Rückruf anfordern`, `Erkenne versteckte Risiken...` (ShiftOps CTA).

### 2. Add dataLayer Push for CTA Clicks (Optional)

To decouple from GTM’s generic click tracking, add an explicit dataLayer push in the footer’s `addTrackingToElements()`:

```javascript
// In footer.php, when CTA is clicked:
if (typeof dataLayer !== 'undefined') {
  dataLayer.push({
    event: 'buttonclick_demo_testen',
    button_text: eventName  // from data-event-name
  });
}
```

Then configure GTM to listen for this custom event instead of generic clicks.

### 3. Exclude Tool Cards

Tool cards (`<a href="/tools/...">`) should **not** fire `buttonclick_demo_testen`. They navigate away. Add a GTM exclusion: do not fire when `Click URL` contains `/tools/` and the click is on a tool card.

### 4. Add data-event-type to Missing CTAs

Some tools pages (e.g. `tools_zuschlagsrechner.php`) have CTA buttons **without** `data-event-type` / `data-event-name`. Add these attributes so tracking is consistent:

```html
<button data-event-type="button_click" data-event-name="Kostenlos testen" ...>
```

## Expected Impact

After narrowing the trigger:

- **True CTA clicks** (Kostenlos testen, Demo vereinbaren): ~1,100–1,200 users
- **Conversion rate** for true CTAs: likely **25–35%** (vs 11% today)
- **Funnel** will reflect actual CTA performance instead of tool cards and nav clicks

## References

- [GTM_CONFIGURATION_GUIDE.md](GTM_CONFIGURATION_GUIDE.md) – GTM trigger narrowing instructions
- GA4 Funnel script: `v2/scripts/dev-helpers/ga4-cta-funnel-analysis.php`
- CTA include: `v2/base/include_ctabuttons.php`
- Footer tracking: `v2/base/footer.php` (addTrackingToElements, trackEvent)
- Form tracking: `v2/js/gtm-form-tracking.js`, `.cursor/rules/form-tracking.mdc`
