Skip to content

Quick View

These are the analytics events to fire when building a custom Smart Search Quick View integration that calls the Rebuy API directly. Quick View is the instant search overlay that appears as users type.

Identification fields

Every request must also include the standard identification fields (uuid, customer_id, etc.) documented at Rebuy Analytic 2.0 Endpoints. The payloads below show only the tracking-specific fields.

Sending a tracking event

async function trackSearchEvent(body) {
  await fetch('https://rebuyengine.com/api/v2/analytics/event', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Rebuy-User-Token': 'YOUR_API_KEY'
    },
    body: JSON.stringify(body)
  });
}

Search Session Start

Fires when the Quick View overlay opens. Call this once per session before any search events.

{
  "subject": "search",
  "verb": "used-in",
  "noun": "session",
  "defined_noun_id": "<first character of session ID, or '-' if unavailable>"
}
defined_noun_id
The first character of the user's session ID. Use "-" if you do not have a session ID.

User Searched

Fires each time the user performs a search query. If the search returns zero results, fire No Search Results instead.

{
  "subject": "user",
  "verb": "searched",
  "noun": "term",
  "defined_noun_id": "<lowercase search term>",
  "meta": {
    "is-quick-view": true,
    "page_of_search": "/collections/all",
    "filters": "tags=nike, color=red",
    "result:562415992868": true,
    "result:562415992869": true
  }
}
defined_noun_id
The search term, lowercased.
meta.is-quick-view
Always true for Quick View.
meta.page_of_search
The URL pathname of the page where the search occurred (e.g., window.location.pathname).
meta.filters
Comma-separated string of active filters. Omit if no filters are applied. See Filter string format below.
meta.result:<product_id>
Include one entry per product in the results, where the key is result: followed by the product ID and the value is true.

Filter string format

Build the filter string by joining active filters with ", ":

Filter type Format Example
Price price.min=<value> and/or price.max=<value> price.min=10, price.max=100
Tags tags=<value> tags=nike
Vendors vendors=<value> vendors=nike
Options <option_name>=<value> (strip # from color values) color=red
Metafields <metafield_key>=<value> material=cotton

Searched Product Viewed

Fires once per product in the search results, immediately after User Searched.

{
  "subject": "user",
  "verb": "viewed",
  "noun": "searched-product",
  "defined_noun_id": "562415992868",
  "meta": {
    "term:running shoes": true,
    "position": 0
  }
}
defined_noun_id
The product ID as a string.
meta.term:<search_term>
Key is term: followed by the search term. Value is true.
meta.position
Zero-based position of the product in the full result set, accounting for pagination offset. The first product on page 2 (if showing 24 per page) has position 24.

Filter Type Applied

Fires when the user applies a filter. Fire one event per filter type used (e.g., one event for price, one for tags). Pair with Filter Value Applied which fires per individual value.

{
  "subject": "user",
  "verb": "filtered-with",
  "noun": "search-filter-type",
  "defined_noun_id": "tags"
}
defined_noun_id
The filter type. Valid values: price, tags, vendors, options, metafields.

Filter Value Applied

Fires for each individual filter value applied. Paired with Filter Type Applied.

{
  "subject": "user",
  "verb": "filtered-with",
  "noun": "search-filter-values",
  "defined_noun_id": "tags.nike",
  "tags": ["FT.tags"]
}
defined_noun_id
<filterType>.<filterValue>, e.g., tags.nike, vendors.adidas, color.red.
tags
Array containing "FT.<filterType>", e.g., ["FT.tags"].

No Search Results

Fires when a search returns zero products. Use this instead of User Searched when results are empty.

{
  "subject": "search",
  "verb": "returned",
  "noun": "no-search-results",
  "defined_noun_id": "running shoes"
}
defined_noun_id
The search term, lowercased.

Search Term Changed

Fires when the user changes their search term after having already performed a search. This event is Quick View only — the Results Page does not fire it.

{
  "subject": "user",
  "verb": "changed",
  "noun": "search-term",
  "defined_noun_id": "trail shoes",
  "meta": {
    "is-quick-view": true
  }
}
defined_noun_id
The new search term, lowercased.
meta.is-quick-view
Always true for Quick View.

Click to PDP

Fires when the user clicks a product to navigate to its product detail page. This action fires two separate events.

Event A — by search result

{
  "subject": "user",
  "verb": "clicked-to-pdp-from",
  "noun": "search-result",
  "defined_noun_id": "running shoes",
  "meta": {
    "is-quick-view": true,
    "index": 0,
    "product_id": 562415992868,
    "quantity": 1,
    "subtotal": 7999
  }
}
defined_noun_id
The search term, lowercased.

Event B — by product

{
  "subject": "user",
  "verb": "clicked-to-pdp-from",
  "noun": "searched-products",
  "defined_noun_id": "562415992868",
  "meta": {
    "is-quick-view": true,
    "index": 0,
    "product_id": 562415992868,
    "quantity": 1,
    "subtotal": 7999
  }
}
defined_noun_id
The product ID as a string.

Shared meta fields

meta.is-quick-view
Always true for Quick View.
meta.index
Zero-based position of the clicked product in the result set.
meta.product_id
The product ID as a number.
meta.quantity
Quantity selected (typically 1).
meta.subtotal
Price in cents (e.g., 7999 for $79.99).

Add to Cart

Fires when the user adds a product to cart from the Quick View search results. This action fires two separate events.

Event A — by search result

{
  "subject": "user",
  "verb": "added-from",
  "noun": "search-result",
  "defined_noun_id": "running shoes.562415992868",
  "meta": {
    "is-quick-view": true,
    "product_id": 562415992868,
    "variant_id": 39478392528932,
    "quantity": 1,
    "subtotal": 7999,
    "conversion": true,
    "source": "Quick View"
  }
}
defined_noun_id
<search_term>.<product_id>.

Event B — by product

{
  "subject": "user",
  "verb": "added-from",
  "noun": "searched-products",
  "defined_noun_id": "562415992868",
  "meta": {
    "term:running shoes": true,
    "is-quick-view": true,
    "product_id": 562415992868,
    "variant_id": 39478392528932,
    "quantity": 1,
    "subtotal": 7999,
    "conversion": true,
    "source": "Quick View"
  }
}
defined_noun_id
The product ID as a string.
meta.term:<search_term>
Key is term: followed by the search term. Value is true. Only in Event B.

Shared meta fields

meta.is-quick-view
Always true for Quick View.
meta.product_id
The product ID as a number.
meta.variant_id
The selected variant ID as a number.
meta.quantity
Quantity added to cart.
meta.subtotal
Price in cents (e.g., 7999 for $79.99).
meta.conversion
Always true.
meta.source
Always "Quick View" for Quick View. Use "Search Result" for Results Page.

Event Sequence

Event When
Search Session Start Quick View overlay opens
User Searched User submits a query with results
Searched Product Viewed Once per product in results (fires after User Searched)
Filter Type Applied User applies a filter (once per type)
Filter Value Applied User applies a filter (once per value)
No Search Results Search returns zero products (replaces User Searched)
Search Term Changed User modifies an existing search term
Click to PDP (×2) User navigates to a product detail page
Add to Cart (×2) User adds a product to cart
See something that needs updating? Suggest an edit