Skip to content
Start free

Guides

Events

Send views, clicks, add-to-carts and orders from your pages and your server. The Analytics page's Events tab shows them, and orders are kept for Bought together lists.

Events say what shoppers do with your products: what they view, click, add to carts, and order. The Events tab of the dashboard's Analytics page shows them, for all your indexes or one, about a minute after they're sent. Each index's Events page shows how to send them and has their settings. Agents read the same counts, and the latest events, with get_event_analytics on the MCP server. Orders also build Bought together, a list of products that were bought in the same orders, in Recommendations. In a catalog without a popularity field, orders and then views decide which products get recommendations first.

Events carry no cookie or customer details, and no ID unless you turn on visitor IDs. They don't count as searches.

From your pages

With the browser SDK (0.8.0) and the index's public ID, the same client that searches:

import { SearchBrowserClient } from "@findlane/browser"

const client = new SearchBrowserClient({ publicId: "pub_…" })

// A search result was clicked: its place in the results, from 1 and counting earlier pages, the query, and the
// search's filters, if any.
client.events.click("sku-123", { query: "red shoes", position: 3, filters: { brand: { in: ["Nike"] } } })
// A recommendation was clicked: the list, and the product whose list it was.
client.events.click("sku-456", { list: "goesWith", from: "sku-123", position: 1 })
client.events.view("sku-123")
client.events.addToCart([{ objectID: "sku-123", quantity: 1, price: 49.9 }], { currency: "ISK" })

Events are sent in the background, a batch a second, and whatever is waiting goes when the page is hidden or closed. They're sent as text/plain, so browsers don't ask the API first (no CORS preflight), and by navigator.sendBeacon, which outlives the page. Requests come only from the index's allowed origins, as browser search does.

Events from crawlers and scripts are answered and dropped. The Events tab counts them under Not recorded.

Clicks you don't have to send

Findlane's own search UI sends clicks for you:

  • React (browser SDK 0.9.0): choosing a suggestion in SearchBox or SearchDialog, following a link in a Hits result, and following a link in Recommendations (with getHref or hrefTemplate). See React. From 0.21.0, following a link in a rule's banner sends a bannerClick.
  • Shopify: the search box, the results view, its banners, and the Recommendations block, when the shopper allows analytics. See Shopify.
  • WooCommerce (plugin 0.2.3): the search box, and on the search results page a product's link or its add-to-cart button. See WooCommerce.

These clicks carry their search's filters, for sales by filter value.

Searches opened from outside your site

An ad, an email or another site can link straight to a search page, such as /search?q=tent. The shopper didn't search, so revenue from search doesn't count what they buy after it. The browser SDK (0.24.0) and the search box tell such a page by its address and referrer:

  • an ad click ID (gclid, msclkid, ttclid and others), or utm_medium such as cpc or paid_social: an ad, with its network;
  • utm_medium email or newsletter: an email;
  • other utm_ tags, fbclid alone, or a referrer from another site: a link.

A page of your own site, or an address with no tags and no referrer, isn't marked. Clicks on that search are then marked with landing (and network for an ad), and with visitor IDs for the rest of the visit, while the search stays the same; a search the shopper makes is their own. React's SearchProvider with routing does this for you. Other pages that show a search from their address say so:

// The page shows the search in its address, such as ?q=tent.
client.events.landed(new URLSearchParams(location.search).get("q") ?? "")

Only the kind and the ad's network are kept, never the click ID or the campaign.

Analytics then shows each top query's click-through and where its clicks usually land, where clicks land on searches that fit on one page and on broader ones, the searches whose shoppers click further down than the top 3, and queries whose results nobody clicked. Each index's Recommendations page shows the clicks on each list.

Product views

A product page sends its view with one call when it shows, or with none:

  • React (browser SDK 0.11.0): useProductView(objectID) on the product page, or <ProductView objectID={…} /> where hooks can't go, such as a Next.js server component. See React.
  • Shopify: product pages, through the search app embed, when the shopper allows analytics. See Shopify.
  • Anything else: client.events.view(objectID) when the page shows.

A repeat view of the same product within 5 seconds isn't sent (browser SDK 0.11.0), so re-renders count once. Views count only products in the index, never other pages, and they show on the Events tab in Analytics.

Without visitor IDs, events hold no cookie or ID, but some EU guidance counts anything a page's script sends about a visit under its consent rules. If your consent banner should cover events, hold them until the shopper agrees:

const client = new SearchBrowserClient({ publicId: "pub_…", events: "afterConsent" })

// When the shopper accepts. consent(false) drops the events held so far.
client.events.consent(true)

events: false turns them off.

Through your own domain

Most ad blockers block beacons sent to other sites, so their users' events don't reach the API. Send events to a route on your own site instead, which passes them on, with the browser SDK (0.10.0) and the server SDK (0.11.0):

const client = new SearchBrowserClient({ publicId: "pub_…", eventsUrl: "/findlane/events" })

The route needs a key with the Events scope. In Next.js, app/findlane/events/route.ts:

import { SearchServerClient } from "@findlane/server"

const index = new SearchServerClient({
  workspaceId: process.env.FINDLANE_WORKSPACE_ID!,
  apiKey: process.env.FINDLANE_EVENTS_KEY!,
}).index("products")

export const POST = (request: Request) => index.events.proxy(request)

Cloudflare Workers, Hono, Bun and Deno take the same request:

if (url.pathname === "/findlane/events") return index.events.proxy(request)

In Express, relay takes the body and the visitor:

app.post("/findlane/events", express.text({ type: "*/*", limit: "256kb" }), async (req, res) => {
  const response = await index.events.relay(req.body, { ip: req.ip!, userAgent: req.get("user-agent"), origin: req.get("origin") })
  res.status(response.status).type("json").send(await response.text())
})

They're still the visitor's events. The API takes them as it takes a browser's: no timestamps or cancels, orders counted only as Orders from browsers says, crawlers' and scripts' dropped, and each visitor limited. So proxy sends the visitor's address and browser on, from the headers Cloudflare, Vercel and most proxies set (cf-connecting-ip, x-real-ip, x-forwarded-for). Where visitors reach your server directly, they can set those headers themselves, so pass the address: index.events.proxy(request, { ip }). The consent option works the same either way.

From your server

Send orders from your server, where they're paid. Use a key with the Events scope (write keys have it too), from the server SDK (0.9.0):

import { SearchServerClient } from "@findlane/server"

const index = new SearchServerClient({
  workspaceId: process.env.FINDLANE_WORKSPACE_ID!,
  apiKey: process.env.FINDLANE_EVENTS_KEY!,
}).index("products")

await index.events.send([
  {
    type: "purchase",
    orderID: "1001",
    currency: "ISK",
    items: [
      { objectID: "sku-123", quantity: 1, price: 49.9 },
      { objectID: "sku-456", quantity: 2, price: 9.9 },
    ],
  },
])

// An order that was cancelled or refunded: out of Bought together and revenue from search.
await index.events.cancelOrder("1001")

An order counts once, however often it's sent, so sending one again after an error is safe.

Past orders

Bought together is better from the first day with your order history. importOrders sends orders up to 400 days old, 200 a request, from a list or an async iterable such as a database cursor:

const result = await index.events.importOrders(
  db.orders.find({ createdAt: { $gte: lastYear } }).map((order) => ({
    orderID: order.number,
    timestamp: order.createdAt,
    items: order.lines.map((line) => ({ objectID: line.sku, quantity: line.quantity })),
  })),
)
// { accepted: 48210, rejected: [] }

Past orders go to Bought together and to the order counts on the Events tab. They don't appear among recent events.

The events

TypeFields
viewobjectID
clickobjectID; position, from 1, counting earlier pages (the first result on page 2 of 20 is 21); query for a search result, or list (goesWith, similar, together) and from for a recommendation; for a search, filters as the search took them, and landing (ad, email, link) with network for an ad, when it was opened from outside your site
addToCartitems; currency
purchaseorderID and items; currency
cancelorderID. From servers only: order numbers are often guessable.
suggestionquery, the search picked from query suggestions; position, from 1; kind: typed, popular, or recent
bannerClickrule, the rule whose banner was clicked, as each banner in a search response names it; query; position, the banner's place
facetMatchfield and value, one of the values of the facet match picked; label; query; position, its place among the rows. From browsers, field must be a facet the public policy lets them count.

Each item is { objectID, quantity, price }; only objectID is required. currency is a three-letter code, such as ISK or EUR. From servers, any event may have a timestamp, in milliseconds, up to 400 days back.

Object IDs aren't checked when events arrive. Products that aren't in the index are left out when lists are built.

Products

With an index chosen, the Events tab lists its products with the most views, the most add-to-carts and the most orders in the range, counted exactly from every event:

Column
ViewsViews your product pages sent.
ViewersDifferent visitors who viewed it, when the index takes visitor IDs.
From searchClicks on it in search results, as a share of its views.
Add to cartsAdd-to-carts with it. A cart counts for each product in it.
OrdersStored orders with it: from your server, the Shopify app and your past orders, and from browsers when they count.
Per 100 viewsAdd-to-carts and orders for every 100 views.

Click a column to sort by it. Viewed, not bought lists products with 50 or more views in the range and the fewest orders per view, which may need better photos, prices or descriptions. It shows once the index has orders.

The counts are about two minutes behind, and start on 9 October 2026. Agents get the same numbers from get_product_analytics on the MCP server, and the weekly report names the three most viewed products.

With an index chosen, the Analytics page shows how much shoppers bought of products they found through search:

  • Revenue from search: the value of purchased products that the shopper clicked in search results in the 24 hours before buying them, beside the value of all orders.
  • Orders after a search: orders with at least one such product, and the same for add-to-carts.
  • Per query: its searches, clicks on its results, and the add-to-carts, orders and revenue those clicks led to. A query typed on the way to a longer one, such as perfor for performance, counts as the longer one.
  • Per product: its revenue from search beside all its revenue, and the query that found it most.

It needs three things:

  1. Visitor IDs on, so a purchase can be linked to the same shopper's search click.
  2. Clicks on search results with query and position. Findlane's React components and the Shopify app send them.
  3. Purchases sent as events, with each item's price and quantity, from your pages or your server. A purchase from your server needs the shopper's visitorId to be linked.

How it counts:

  • Each order counts once, by its order ID, even when your pages and your server both send it.
  • Cancelled orders don't count: a cancel with the order's ID, from your server or the WooCommerce plugin, for a cancellation or a refund, takes it out whenever it comes. The cancelled orders show apart.
  • Prices are the ones the events carry, such as before a discount at checkout.
  • Amounts are in the main currency, the one most orders use. Orders in other currencies are listed apart, with no conversion.
  • Last click wins: a product counts for the query of the last search click on it.
  • Searches opened from outside your site don't count (from 26 October 2026): when the last click was on a search an ad, an email or another site's link opened, the order shows on its own line, by kind, and in each query's and product's From ads and links.

On WooCommerce, the plugin (0.2.3) links each paid order to the shopper's searches on the order received page, when they allow statistics.

It counts orders with a product found through search, not sales that search alone caused: a shopper might have bought it anyway. The numbers are exact and about two minutes behind, and start on 9 October 2026, or when the index started taking visitor IDs. The API's /analytics/revenue, the server SDK's analytics.revenue() (0.20.0), and get_search_revenue on the MCP server give the same numbers, and the weekly report sums them up.

Sales by filter value

Under revenue from search, Sales by filter shows which filter values lead to sales: for each facet field, such as brand or price, the values shoppers filtered on, with the clicks on results while each was chosen, and the add-to-carts, orders and revenue of the products clicked. It counts as revenue from search does: a product's last click, by the same visitor within 24 hours.

  • Searches and category pages apart. A category page is filtered results without words; its own filter, such as the category, counts there too.
  • A click with several filters counts for each, so a field's rows can add up to more than its sales.
  • Searches without filters show below, to compare with.
  • Ranges show as chosen, such as 50–100: the 10 most clicked per field.
  • Only the index's facet fields, and ranges of its other filter fields, such as a price slider's; searches opened from outside your site are left out.

Clicks carry their filters from 26 October 2026, from the search box, the WooCommerce plugin, React, and InstantSearch through the compatible API. The API's /analytics/filter-sales, the server SDK's analytics.filterSales() (0.26.0), and get_sales_by_filter on the MCP server give the same numbers.

Orders from browsers

Orders sent from browsers show on the Events tab, but don't count for Bought together, unless you turn on Count orders sent from browsers on the index's Events page. It's off because anyone with the public ID can send an order, and a store that also sends orders from its server would count each one twice.

Turn it on if your store has no server to send orders from. Each visitor then counts for at most 3 orders a day. To tell visitors apart for that, a browser order keeps a hash of the visitor's network address and browser, made with a random value that changes every day and is then deleted, so the hash can't be traced back to the address. It's removed from the order after two days.

Visitor IDs

Events can carry two random IDs that link one shopper's events on your store: the browser's, which is replaced 13 months after it's made, and the visit's, which ends after 30 minutes without events. They show which products the same people look at, and the path from a view to an order. Neither names the shopper.

They're off until you turn on Link each shopper's events on the index's Events page, and your pages turn them on too, with the browser SDK (0.12.0):

const client = new SearchBrowserClient({ publicId: "pub_…", visitorIds: true, events: "afterConsent" })

The browser keeps the visitor ID in localStorage and the visit ID in sessionStorage, a pair for each public ID. With events: "afterConsent", the IDs are made only after consent(true), and consent(false) deletes them from the browser.

Getting consent is up to your store. Turn visitor IDs on only if your consent banner covers analytics, or your shoppers don't need one. The Shopify app sends them only while the shopper allows analytics.

From your server, send your own anonymous IDs with the events (server SDK 0.12.0): 16 to 64 letters, digits, - or _. Never use an email address, a phone number, or a customer number. IDs of digits only, or with @ or spaces, are refused.

await index.events.send(events, { visitorId: session.anonymousId, visitId: session.id })

Findlane keeps a keyed hash of each ID, different for each index, never the ID itself, so one index's events can't be linked to another's. While an index doesn't take visitor IDs, they're dropped, and the answer says "visitorIds": "off".

Forgetting a visitor

When a shopper asks you to delete their data, client.events.forget() deletes the IDs from their browser and asks Findlane to delete the events sent with them. From your server, send the IDs you sent:

await index.events.forget([visitorId])

The events are deleted within a week. A request to forget is taken whether or not the index takes visitor IDs now.

Limits

Events a request100 from browsers, 200 from servers
IDs to forget a request2 from browsers, 1,000 from servers
Requests a minute600 per visitor for each public ID, through your domain or not, and 600 per API key for a server's own
Items an event1,000; an order keeps its first 50 different products
position1 to 1,000
queryKept as search analytics keep queries: lowercase, up to eight words
timestampFrom servers only, up to 400 days back

The API answers 202 with what it accepted, and which events it refused and why. One bad event doesn't refuse the rest:

{ "accepted": 3, "rejected": [{ "index": 1, "reason": "position must be a whole number from 1 to 1,000" }] }

A request that isn't a list of events answers 400, and over the rate limit 429. If orders can't be accepted for a moment, the request answers 503 and is safe to send again. The SDKs retry it, and wait out the rate limit.

What's kept

  • Each event: its type, product, query words, list, position, quantities, prices and currency, with the country, device type, and site it came from, and the hashed visitor and visit IDs when the index takes them; for a click, its search's filter values (of the index's public facet fields, from browsers), and whether an ad (with its network), an email or another site opened the search. Never an IP address, a user agent, a raw ID, or an order ID. Kept 13 months, a year to compare a season with the last plus a month, then deleted. The Events tab shows the last three months.
  • For Bought together: which products were in each order, when, and a hash of its order ID, so it's counted once and can be cancelled. No customer, address, or amounts. Kept 400 days, and deleted with the index.
  • When an index is deleted, its events are deleted within a week.

HTTP

POST /api/public/indexes/{publicId}/events
POST /api/teams/{workspaceId}/indexes/{index}/events

The body is { "events": [...] }, with visitorId and visitId beside events when you send them. To forget IDs, send { "forget": ["…"] } instead, which answers { "forgotten": 1 }. Browser requests need an allowed Origin, as browser search does; server requests need an API key with the events or write scope. A server passing on a visitor's events adds findlane-visitor-ip, and findlane-visitor-agent, findlane-visitor-origin and findlane-visitor-country when it has them; they're then taken as browser events. See the HTTP API.