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 plugin for Matomo to track site search keywords #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Jan 15, 2024

  1. Add plugin for Matomo to track site search keywords

    Use the plugins API for autocomplete, hook into the state change,
    retrieve the query term from the use, and send the query term together
    with the search results from the global context to Matomo.
    
    * autocomplete plugins: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/
    * autocomplete state: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/
    * autocomplete access data with context: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/
    
    https://developer.matomo.org/guides/tracking-javascript-guide#internal-search-tracking
    
    Relates to typesense#16
    ngulden committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    cddc491 View commit details
    Browse the repository at this point in the history
  2. Matomo plugin: Add conditions for sending search analytics data

    The Matomo plugin only sends data under the following conditions:
    
    * The modal UI is opened
    * The query string has length greater than 0
    * The query term wasn't used before
    
    Increase debounce limit to 500 ms.
    ngulden committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    4df8dff View commit details
    Browse the repository at this point in the history
  3. Matomo plugin: Add configuration switch

    To activate the Matomo plugin, add `matomoSearchAnalytics: true` to the
    properties in the call to the docsearch function. Per default, the
    plugin is deactivated.
    ngulden committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    a546796 View commit details
    Browse the repository at this point in the history
  4. feat(MatomoPlugin): At least 3 characters for Search analytics

    Only send search terms when they have a least three characters of
    length. Otherwise, search analytics is cluttered with strings of no
    further use.
    
    Refs typesense#4
    ngulden committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    1a73cc3 View commit details
    Browse the repository at this point in the history