Tracking

Tracking - Record Page View

Called by the SPA on EVERY navigation. Reads session_token from the juju_tracking_session cookie set by /tracking/session, writes one juju.page_tracking row, increments the session's page_count.

─── prev_duration_ms — the exit-beacon substitute ───────── When the SPA records page N+1 it reports how long the user spent on page N via prev_duration_ms. That avoids the beforeunload beacon (unreliable, doubles the request volume). The last page of each session is unmeasured — acceptable.

─── page_type + entity_id ───────────────────────────────── page_type is a stable enum-ish string the SPA sends explicitly (home|search|job_detail|register|offer|saved-jobs|profile|...). entity_id is what the page is ABOUT (solr_id for a job page, category slug for a category page, offer_id for an offer). Together they make funnel + engagement queries trivial without regex-parsing url_path.

Bots: the endpoint silently 200-with-recorded=false when the session is bot-flagged and tracking.store_bot_page_views is false (default). No 4xx — bots would fill the SPA console with errors we don't want.

post/api/v1/tracking/page-view

Request

  • Base URL: https://api.juju.com
  • URL: https://api.juju.com/api/v1/tracking/page-view
  • Auth: none declared

Request body

url_pathstring required
query_stringstring nullable
page_typestring nullable
entity_idstring nullable
prev_duration_msinteger nullable

Milliseconds spent on the PREVIOUS page. Omitted on the first page of a session.

Response

Page view recorded, or silently skipped (bot session / missing session cookie / DB failure). SPA MUST proceed regardless.

metaobject required

Pagination and context metadata. Always present, empty object ({}) when no metadata applies to the response.

errorsstring[] required

Empty array on success. On failure, human-readable error strings suitable for surfacing to end users.

Example response

{
  "errors": []
}

Changes

No recorded changes to this operation across all 1 revision of this API.