Analytics event catalog
Events are local-first. They dispatch oilmanual:analytics, optionally push to
dataLayer, and send to a network endpoint only when
window.OILMANUAL_ANALYTICS_ENDPOINT is configured.
Debug overlay: turn on analytics debug or turn it off.
Payload schema
| Field | Type | Meaning |
|---|---|---|
name | string | Event name, 2-80 chars, matching `[a-z0-9_.:-]`. |
detail | object | Sanitized event-specific fields with string/number/boolean values. |
path | string | Current site pathname, such as `/search`. |
ts | string | Client-side ISO timestamp. |
Events
| Event | Trigger | Fields |
|---|---|---|
search_query | A user types or submits a Pagefind search query. | query |
search_results | Pagefind returns one or more results. | query, count |
search_no_results | Pagefind returns zero results. | query, count |
search_shortcut | A popular-search or empty-state shortcut is selected. | query, source |
correction_submit_attempt | Correction form submit is attempted. | page, record |
correction_submit_success | Hosted correction endpoint accepts a correction. | page |
correction_submit_fallback | Hosted correction endpoint is unavailable and email fallback is shown. | page |
correction_submit_validation | Correction form is missing required evidence or the endpoint returns field errors. | page, record |
correction_mailto_opened | The prepared email fallback is opened. | page, record |
car_lookup_resolved | YMME lookup resolves to a car record. | make, model, year, engine |
car_lookup_unresolved | YMME lookup has no matching car record. | make, model, year, engine |
car_lookup_opened | User opens the resolved car record from lookup. | make, model, year, engine |
spec_checker_result | Oil spec checker returns a compatibility result. | status |
triage_result | Wrong-oil emergency triage returns a next-step branch. | status |
saved_garage_add | User saves a local garage record. | has_date |
saved_garage_delete | User deletes a local garage record. | none |
saved_garage_print | User prints a saved garage card. | none |
kit_checklist_copy | User copies an oil-change kit checklist. | none |
kit_checklist_print | User prints an oil-change kit checklist. | none |
cost_estimator_result | Oil change cost estimator calculates DIY and shop totals. | capacity, diy_total, shop_total |
cost_estimator_print | User prints the oil change cost estimate. | none |
Launch snippets
Set an endpoint before the analytics helper loads, or bridge the local event to a tag manager. Without either snippet, analytics remains local-only.
Endpoint
<script>
window.OILMANUAL_ANALYTICS_ENDPOINT = 'https://analytics.example.com/oilmanual';
</script> Data layer bridge
<script>
window.dataLayer = window.dataLayer || [];
window.addEventListener('oilmanual:analytics', (event) => {
window.dataLayer.push({
event: 'oilmanual.' + event.detail.name,
oilmanual: event.detail
});
});
</script>