# Apex Admins — CRO & Analytics Specification

**Version:** 1.0  
**Date:** 2026-06-27

---

## 1. Conversion Goals

| Goal | Primary Metric | Secondary Metric |
|------|----------------|------------------|
| Book consultation | Calendly bookings | CTA click → booking page |
| Capture lead | Form submission | Lead magnet download |
| Phone contact | tel: clicks | — |
| Hire intent | Hire page → form/call | Time on hire pages |

---

## 2. CRO Elements

### 2.1 Sticky CTA Bar

**Settings keys:** `cta.sticky_enabled`, `cta.sticky_text`, `cta.sticky_url`, `cta.sticky_show_after_scroll`

- Appears after 400px scroll (configurable)
- Fixed bottom on mobile, bottom-right pill on desktop
- Dismissible per session (localStorage)
- One primary action only

### 2.2 Floating Contact Button

**Settings:** `contact.floating_enabled`, `contact.floating_phone`, `contact.floating_email`, `contact.floating_position`

- Expandable FAB: phone, email, book link
- Pulse animation (respect reduced-motion)
- Track opens and action clicks

### 2.3 Exit Intent Popup

**Settings:** `cro.exit_intent_enabled`, `cro.exit_intent_title`, `cro.exit_intent_body`, `cro.exit_intent_cta`, `cro.exit_intent_form_slug`

- Trigger: mouse leave viewport top (desktop), 45s idle (mobile)
- Max 1 show per session
- Lead magnet or book CTA
- Track: impression, close, convert

### 2.4 Lead Magnets

- Gated PDF/resource via form slug
- Deliver via email (queued) + on-screen download link
- UTM preserved through flow

### 2.5 Multi-Step Forms

- Progress bar: Step X of Y
- Save partial (session) optional
- Field validation per step
- Final step: consent checkbox (Privacy Policy link)

### 2.6 Calendly Integration

- Embed inline on contact + hire final CTA sections
- Webhook `invitee.created` → create/update Lead with `calendly_event_id`
- Settings: `integrations.calendly_url`, `integrations.calendly_webhook_secret`

---

## 3. CTA Strategy (Anti-Spam)

Max **3 intent-based CTAs** per page:

| Intent | Label Example | Placement |
|--------|---------------|-----------|
| High | Book Free Consultation | Hero, final section |
| Mid | Download Hiring Playbook | Mid-page lead magnet |
| Browse | Explore All Roles | Hero secondary only |

---

## 4. Social Proof Elements

- Trusted by logos (homepage)
- Animated stats counters (60% savings, 70% faster hiring)
- Testimonial carousel with star ratings
- Case study results metrics
- "Pay $0 until you hire" risk badge (configurable in settings)

---

## 5. Analytics Event Schema

**Table:** `analytics_events`

| event_type | payload fields |
|------------|----------------|
| `form_submit` | form_id, form_slug, page_url, utm |
| `cta_click` | cta_id, label, href, position |
| `scroll_depth` | depth_percent (25,50,75,100) |
| `phone_click` | phone_number, page_url |
| `email_click` | email, page_url |
| `exit_popup_show` | popup_id |
| `exit_popup_convert` | popup_id, action |
| `calendly_booked` | event_id, invitee_email |

### 5.1 Client Tracker (`analytics.js`)

```js
// Debounced scroll depth
// Delegated click on [data-track-cta]
// fetch POST /api/analytics/events (sendBeacon)
```

Session ID: UUID in sessionStorage.

### 5.2 UTM Capture

On first visit, store in session: `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`.  
Attach to all form submissions.

---

## 6. Admin Analytics Dashboard

**Widgets:**
- Submissions last 7/30 days (chart)
- Top CTAs by clicks
- Scroll depth distribution
- Conversion funnel: pageview → scroll 75% → CTA click → form submit
- Top landing pages by leads

**Filters:** Date range, page, form, UTM source

---

## 7. A/B Testing (Backlog)

Structure settings for CTA variants:
`cta.hero_variant_a`, `cta.hero_variant_b` — not implemented at launch.

---

## 8. Funnel Diagram

```
Traffic → Landing Page
    ├─ High intent → Book Consultation (Calendly) → Lead (won pipeline)
    ├─ Mid intent → Lead Magnet → Email nurture → Book
    └─ Browse → Hire Role Page → Book / Form
Exit Intent → Lead Magnet
Sticky CTA → Book (any page)
```

---

## 9. Privacy & Compliance

- Cookie notice if analytics/marketing pixels enabled (settings toggle)
- Privacy policy link on all forms
- IP stored as hash only in analytics_events
- Australian Privacy Act compliant data retention settings
