Skip to content

Implement real-time visit tracking and dynamic page title updates across all pages #123

@0xrinegade

Description

@0xrinegade

Context

Currently, the feed displays data from the Qdrant database and reflects user history only if that data is already recorded. As clarified in recent PRs (see commits 47c03b6 and 89ec292), the feed code now reliably queries and displays from Qdrant, but does not actively track user page visits. Visit tracking and feed display logic are separate concerns.

Request

This issue proposes two major feature additions vital for high-quality user analytics and SEO:

1. Real-time visit tracking on all pages

  • Goal: Whenever a user visits any page, their activity should be recorded and stored in Qdrant's user_history collection.
  • Implementation Steps:
    1. Add a client-side tracking hook/component that triggers on every page navigation (e.g. using Next.js router events).
    2. Expose an API endpoint to receive and persist each page visit into Qdrant user_history.
    3. Ensure that user/session identification is robust, including for guest users.
    4. Integrate the tracking logic tightly with Next.js routing so that visit recording occurs for every meaningful navigation.
  • Notes:
    • This should be layered to allow future expansion (custom events, anonymous telemetry, batch recording, etc).
    • Feed display code is already ready to display recorded visits once data exists in Qdrant.

2. Dynamic <title> tag updates

  • Goal: Ensure that page <title> is set contextually for every route, reflecting actual content (not just static text).
  • Implementation Steps:
    1. Leverage Next.js head management API (e.g. next/head or built-in route-level metadata).
    2. Provide logic for dynamic title generation based on page context or URL.

Scope, Review, and PR Structure

  • These features (tracking + SEO) are out of scope for basic feed display/query fixes and should be implemented in a dedicated PR.
  • Care should be taken to respect existing feed code (see commits 47c03b6, 89ec292), which expects the data pipeline to be actively collecting visits.

Reference


This implementation must:

  • Track visits on all pages, for all user/session types
  • Wire tracking logic into Next.js routing
  • Record visit data to Qdrant's user_history collection via new/existing API
  • Update page <title> for each route based on context/URL
  • Place new logic in a separate PR from feed display/query fixes

This issue supersedes simple feed fixes and initiates full data collection + SEO improvements.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions