Skip to content

Add link click redirect endpoint (/go/:id) for JS-free analytics #19

Description

@Manak-hash

Problem

Currently links are direct <a href> tags. Click tracking happens client-side via /api/track — if a visitor has JS disabled, clicks aren't counted.

Proposed solution

Add a /go/:linkId server-side redirect endpoint:

  1. Receives click request
  2. Records the click server-side (no client JS needed)
  3. 302-redirects to the target URL

Make this configurable in settings:

  • Direct mode (current): links point to real URLs, tracked client-side
  • Redirect mode (new): links point to /go/:id, tracked server-side

Benefits

  • Analytics work without client JS
  • Destination URLs masked from page source
  • More accurate click counting

Acceptance criteria

  • /go/:linkId endpoint records click + redirects
  • Setting to toggle between direct and redirect mode
  • Works with all link types (url, mailto, tel, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions