Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
search-insights
Advanced tools
Library for reporting click, conversion and view metrics using the Algolia Insights API
The search-insights npm package is a JavaScript library that allows you to send analytics events to Algolia's Insights API. It helps you track user interactions with your search and discovery experiences, such as clicks, conversions, and view events.
Sending Click Events
This feature allows you to send click events to Algolia's Insights API. You can track which products users are clicking on after performing a search.
const searchInsights = require('search-insights');
searchInsights('init', { apiKey: 'yourAPIKey', appId: 'yourAppId' });
searchInsights('clickedObjectIDsAfterSearch', {
eventName: 'Product Clicked',
index: 'yourIndexName',
queryID: 'theQueryID',
objectIDs: ['objectID1', 'objectID2'],
positions: [1, 2]
});
Sending Conversion Events
This feature allows you to send conversion events to Algolia's Insights API. You can track which products users are purchasing after performing a search.
const searchInsights = require('search-insights');
searchInsights('init', { apiKey: 'yourAPIKey', appId: 'yourAppId' });
searchInsights('convertedObjectIDsAfterSearch', {
eventName: 'Product Purchased',
index: 'yourIndexName',
queryID: 'theQueryID',
objectIDs: ['objectID1', 'objectID2']
});
Sending View Events
This feature allows you to send view events to Algolia's Insights API. You can track which products users are viewing.
const searchInsights = require('search-insights');
searchInsights('init', { apiKey: 'yourAPIKey', appId: 'yourAppId' });
searchInsights('viewedObjectIDs', {
eventName: 'Product Viewed',
index: 'yourIndexName',
objectIDs: ['objectID1', 'objectID2']
});
Segment is a customer data platform that helps you collect, clean, and control your customer data. It provides a unified API to track user interactions and send them to various analytics services. Compared to search-insights, Segment offers a broader range of integrations and data management capabilities.
Mixpanel is an advanced analytics platform that helps you track user interactions with your web and mobile applications. It provides detailed insights into user behavior and allows you to create custom reports. Mixpanel is more focused on in-depth analytics and user behavior tracking compared to the more search-focused search-insights.
Google Analytics is a widely-used web analytics service that tracks and reports website traffic. It provides comprehensive insights into user behavior, traffic sources, and conversion rates. While Google Analytics offers a broader range of analytics features, search-insights is specifically tailored for tracking search-related events.
Search Insights lets you report click, conversion and view metrics using the Algolia Insights API.
NOTE: You're looking at the documentation of
search-insights
v2. (Click here for v1.x documentation.)
v2 introduces a breaking change which is useCookie
being false
by default.
Since v2.0.4, search-insights no longer validates event payloads. You can visit https://algolia.com/events/debugger instead.
We have created dedicated integrations for Google Tag Manager and Segment. If you are using either of these platforms, it is recommended to use the dedicated integrations to manage sending events to the Insights API.
For information on how to set up search-insights.js
in a browser environment, see our documentation on Installing and Initializing the Insights Client.
We also have documentation for using search-insights.js
with InstantSearch and Autocomplete.
search-insights.js
with InstantSearch, see our documentation on Sending click and conversion events with InstantSearch.js.search-insights.js
with Autocomplete, see our documentation on Sending Algolia Insights events with Autocomplete.NOTE: If you are using Require.js, see our Note for Require.js users.
For information on how to set up search-insights.js
in a Node.js environment, see our guide on Installing and Initializing the Insights Client for Node.js.
Documentation for search-insights.js
can be found in our main Algolia Docs website.
For API Client reference information, see the Insights API Client Documentation.
To run the examples and the code, you need to run two separate commands:
yarn dev
runs webpack and the Node.js serveryarn build:dev
runs Rollup in watch modeFor information on releasing, see RELEASE.md.
Search Insights is MIT licensed.
FAQs
Library for reporting click, conversion and view metrics using the Algolia Insights API
The npm package search-insights receives a total of 663,147 weekly downloads. As such, search-insights popularity was classified as popular.
We found that search-insights demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.