Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@algolia/autocomplete-plugin-algolia-insights

Package Overview
Dependencies
Maintainers
84
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/autocomplete-plugin-algolia-insights

A plugin to add Algolia Insights to Algolia Autocomplete.

  • 1.9.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
269K
decreased by-50.81%
Maintainers
84
Weekly downloads
 
Created

What is @algolia/autocomplete-plugin-algolia-insights?

@algolia/autocomplete-plugin-algolia-insights is a plugin for Algolia's Autocomplete library that integrates Algolia Insights, allowing you to track user interactions and improve search relevance based on user behavior.

What are @algolia/autocomplete-plugin-algolia-insights's main functionalities?

Initialize the plugin

This code initializes the Algolia Insights plugin by passing the Algolia Analytics (aa) client to it. This setup is necessary to start tracking user interactions.

const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({
  insightsClient: window.aa,
});

Track search results click

This code tracks when a user clicks on a search result. It sends the event name, index name, object IDs, positions, and query ID to Algolia Insights.

algoliaInsightsPlugin.onClick({
  insightsMethod: 'clickedObjectIDsAfterSearch',
  payload: {
    eventName: 'Product Clicked',
    index: 'your_index_name',
    objectIDs: ['objectID1'],
    positions: [1],
    queryID: 'queryID',
  },
});

Track search results conversion

This code tracks when a user converts (e.g., makes a purchase) after searching. It sends the event name, index name, object IDs, and query ID to Algolia Insights.

algoliaInsightsPlugin.onConversion({
  insightsMethod: 'convertedObjectIDsAfterSearch',
  payload: {
    eventName: 'Product Purchased',
    index: 'your_index_name',
    objectIDs: ['objectID1'],
    queryID: 'queryID',
  },
});

Other packages similar to @algolia/autocomplete-plugin-algolia-insights

FAQs

Package last updated on 24 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc