# subnautica2maps P0 analytics verification

Task: t_beec6f66
Original blocked task: t_80fac998
Site: https://subnautica2maps.com/
Verified URL: https://subnautica2maps.com/map/?q=silver
Captured at: 2026-05-26T13:44:50Z

## Production source

Cloudflare Pages production deployment list shows the latest Production deployments are Source `ff15a5a` on branch `main`:

- https://4658e57f.subnautica2maps.pages.dev — Source `ff15a5a`
- https://1b539128.subnautica2maps.pages.dev — Source `ff15a5a`

Local repo HEAD is also `ff15a5a` (`feat: add map funnel analytics events`).

## Code implementation points confirmed

Files inspected:

- `src/lib/analytics.ts`
  - Defines `map_search`, `resource_filter`, `marker_open`, `copy_coordinates`, `route_hint_click`, `mark_found`, `external_source_click`, `youtube_embed_activate`.
  - `trackEvent()` dispatches browser `subnautica2maps:event`, Plausible custom event, GA4 event, and Clarity custom event when enabled.
  - Adds default `source_page` and `device_context`.
  - Blocks raw coordinate props (`current_x`, `current_y`, `current_z`, `raw_coordinates`, `coordinates`, `coordinate_triplet`).
- `src/components/MapTool.tsx`
  - Search input emits `map_search` with `query`, `query_length`, `result_count`.
  - Marker selection emits `marker_open` with marker metadata.
  - Copy coordinates emits `copy_coordinates` with marker metadata and `success`; raw coordinates are not sent.

Static contract check passed:

```text
npm run build && node scripts/verify-analytics-events.mjs
analytics event contract ok: map_search, resource_filter, marker_open, copy_coordinates, route_hint_click, mark_found, external_source_click
```

## Production browser/network evidence

Browser instrumentation attached listeners for:

- `window.addEventListener('subnautica2maps:event', ...)`
- `window.fetch` network calls
- `navigator.sendBeacon`

Providers loaded on production:

```json
{"plausible":"function","gtag":"function","clarity":"function"}
```

Verified events:

### 1. map_search

Action: typed `copper` into the map search input.

Browser event:

```json
{
  "name": "map_search",
  "props": {
    "source_page": "/map/",
    "device_context": "desktop",
    "query": "copper",
    "query_length": 6,
    "result_count": 9
  }
}
```

Network:

- Plausible POST `https://plausible.shipsolo.io/api/event`
- GA4 POST `https://region1.google-analytics.com/g/collect?...&en=map_search...`

### 2. marker_open

Action: opened `Copper early cave east of Lifepod` marker.

Browser event:

```json
{
  "name": "marker_open",
  "props": {
    "source_page": "/map/",
    "device_context": "desktop",
    "marker_id": "resource-copper-early-cave-east-of-lifepod",
    "slug": "resource-copper-early-cave-east-of-lifepod",
    "resource": "Copper",
    "category": "Resources",
    "confidence": "corroborated",
    "index_policy": "index"
  }
}
```

Network:

- Plausible POST `https://plausible.shipsolo.io/api/event` with `n=marker_open`
- GA4 batched POST body includes `en=marker_open` and marker props

### 3. copy_coordinates

Action: clicked `Copy coordinates`.

Browser event:

```json
{
  "name": "copy_coordinates",
  "props": {
    "source_page": "/map/",
    "device_context": "desktop",
    "marker_id": "resource-copper-cave-under-lifepod",
    "slug": "resource-copper-cave-under-lifepod",
    "resource": "Copper",
    "category": "Resources",
    "confidence": "corroborated",
    "index_policy": "index",
    "success": true
  }
}
```

Network:

- Plausible POST `https://plausible.shipsolo.io/api/event` with `n=copy_coordinates`
- GA4 batched POST body includes `en=copy_coordinates` and `ep.success=true`

Privacy note: no raw coordinate value was present in `copy_coordinates` analytics payload; only marker metadata and success flag were sent.

## Repo status

`git status --short` contains only pre-existing untracked ops/data files under `data/subnautica2maps/`; they were not touched or committed for this verification task:

```text
?? data/subnautica2maps/ahrefs-site-audit-2026-05-26.json
?? data/subnautica2maps/backlink-log.md
?? data/subnautica2maps/backlink-resources.md
?? data/subnautica2maps/utm-guidelines-2026-05-26.md
?? data/subnautica2maps/utm-urls-2026-05-26.csv
```

## Residual risk

P0 implementation is verified by production browser events and Network payloads. GA4/Plausible dashboard UI may still show normal ingestion/reporting delay; backend recheck window: 15–60 minutes after `2026-05-26T13:44:50Z`.

Verdict: P0 analytics implementation verified. t_94a8dad7 can continue from the P0 analytics gate.
