Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Search Analytics Tracking to Documentation Site #275

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tharropoulos
Copy link
Collaborator

Rationale

Currently, our documentation search functionality doesn't track how users interact with search results, making it difficult to understand user behavior and improve search relevance. By implementing search analytics tracking, we can:

  • Understand which search results users find most helpful
  • Identify potential gaps in documentation coverage
  • Improve search result rankings based on user interaction patterns
  • Make data-driven decisions for documentation improvements

Changes

Added Features:

  1. In TypesenseSearchBox.vue:
    • Added anonymous user tracking with UUID generation
    • Implemented click event tracking for search result selections
    • Added analytics event sending functionality with error handling

Code Changes:

  1. In TypesenseSearchBox.vue:

    • Added guid and currentQuery data properties for tracking
    • Implemented sendAnalyticsEvent method to handle analytics event submission
    • Enhanced suggestion click handler to track user interactions
    • Added error handling for analytics event submission
  2. In .vuepress/config.js:

    • Updated Typesense server configuration with new cluster endpoints
    • Added new API key with analytics permissions
    • Added id field to included fields in search params
    • Updated vector search parameters

Configuration Updates:

  1. In .gitignore:
    • Added .env to protect sensitive configuration

Context

This change is part of our initiative to improve search relevance by understanding how users interact with our documentation search. The analytics events are anonymized and only track:

  • Search queries
  • Clicked document IDs
  • Anonymous user IDs (randomly generated per session)

These analytics will help us:

  • Identify most valuable documentation pages
  • Understand common search patterns
  • Improve search result rankings
  • Guide future documentation improvements

PR Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant