Results Page
These are the analytics events to fire when building a custom Smart Search Results Page integration that calls the Rebuy API directly. The Results Page is the dedicated search results page, typically triggered by a URL search parameter or manual submission.
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 Results Page is first loaded. Call this once per page load 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 a search query runs on the Results Page. 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-results-page": true,
"page_of_search": "/pages/search",
"filters": "tags=nike, color=red",
"result:562415992868": true,
"result:562415992869": true
}
}
defined_noun_id
- The search term, lowercased.
meta.is-results-page
- Always
true for the Results Page.
meta.page_of_search
- The URL pathname of the search results page (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.
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.
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-results-page": 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-results-page": true,
"index": 0,
"product_id": 562415992868,
"quantity": 1,
"subtotal": 7999
}
}
defined_noun_id
- The product ID as a string.
meta.is-results-page
- Always
true for the Results Page.
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 Results Page. 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-results-page": true,
"product_id": 562415992868,
"variant_id": 39478392528932,
"quantity": 1,
"subtotal": 7999,
"conversion": true,
"source": "Search Result"
}
}
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-results-page": true,
"product_id": 562415992868,
"variant_id": 39478392528932,
"quantity": 1,
"subtotal": 7999,
"conversion": true,
"source": "Search Result"
}
}
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.
meta.is-results-page
- Always
true for the Results Page.
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
"Search Result" for the Results Page. Use "Quick View" for Quick View.
Event Sequence
| Event |
When |
| Search Session Start |
Results Page first loads |
| User Searched |
Search query runs 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) |
| Click to PDP (×2) |
User navigates to a product detail page |
| Add to Cart (×2) |
User adds a product to cart |
---
title: "Smart Search Tracking: Results Page"
excerpt: Analytics events for custom Results Page integrations using the Rebuy API directly
deprecated: false
hidden: false
metadata:
title: ''
description: ''
robots: index
next:
description: ''
---
These are the analytics events to fire when building a custom Smart Search Results Page integration that calls the Rebuy API directly. The Results Page is the dedicated search results page, typically triggered by a URL search parameter or manual submission.
!!! note "Identification fields"
Every request must also include the standard identification fields (`uuid`, `customer_id`, etc.) documented at [Rebuy Analytic 2.0 Endpoints](rebuy-analytic-v2-endpoints.md). The payloads below show only the tracking-specific fields.
## Sending a tracking event
```javascript
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 Results Page is first loaded. Call this once per page load before any search events.
```json
{
"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 a search query runs on the Results Page. If the search returns zero results, fire [No Search Results](#no-search-results) instead.
```json
{
"subject": "user",
"verb": "searched",
"noun": "term",
"defined_noun_id": "<lowercase search term>",
"meta": {
"is-results-page": true,
"page_of_search": "/pages/search",
"filters": "tags=nike, color=red",
"result:562415992868": true,
"result:562415992869": true
}
}
```
`defined_noun_id`
: The search term, lowercased.
`meta.is-results-page`
: Always `true` for the Results Page.
`meta.page_of_search`
: The URL pathname of the search results page (e.g., `window.location.pathname`).
`meta.filters`
: Comma-separated string of active filters. Omit if no filters are applied. See [Filter string format](#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](#user-searched).
```json
{
"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](#filter-value-applied) which fires per individual value.
```json
{
"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](#filter-type-applied).
```json
{
"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](#user-searched) when results are empty.
```json
{
"subject": "search",
"verb": "returned",
"noun": "no-search-results",
"defined_noun_id": "running shoes"
}
```
`defined_noun_id`
: The search term, lowercased.
---
## 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
```json
{
"subject": "user",
"verb": "clicked-to-pdp-from",
"noun": "search-result",
"defined_noun_id": "running shoes",
"meta": {
"is-results-page": true,
"index": 0,
"product_id": 562415992868,
"quantity": 1,
"subtotal": 7999
}
}
```
`defined_noun_id`
: The search term, lowercased.
### Event B — by product
```json
{
"subject": "user",
"verb": "clicked-to-pdp-from",
"noun": "searched-products",
"defined_noun_id": "562415992868",
"meta": {
"is-results-page": true,
"index": 0,
"product_id": 562415992868,
"quantity": 1,
"subtotal": 7999
}
}
```
`defined_noun_id`
: The product ID as a string.
### Shared meta fields
`meta.is-results-page`
: Always `true` for the Results Page.
`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 Results Page. This action fires **two separate events**.
### Event A — by search result
```json
{
"subject": "user",
"verb": "added-from",
"noun": "search-result",
"defined_noun_id": "running shoes.562415992868",
"meta": {
"is-results-page": true,
"product_id": 562415992868,
"variant_id": 39478392528932,
"quantity": 1,
"subtotal": 7999,
"conversion": true,
"source": "Search Result"
}
}
```
`defined_noun_id`
: `<search_term>.<product_id>`.
### Event B — by product
```json
{
"subject": "user",
"verb": "added-from",
"noun": "searched-products",
"defined_noun_id": "562415992868",
"meta": {
"term:running shoes": true,
"is-results-page": true,
"product_id": 562415992868,
"variant_id": 39478392528932,
"quantity": 1,
"subtotal": 7999,
"conversion": true,
"source": "Search Result"
}
}
```
`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-results-page`
: Always `true` for the Results Page.
`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 `"Search Result"` for the Results Page. Use `"Quick View"` for Quick View.
---
## Event Sequence
| Event | When |
|-------|------|
| Search Session Start | Results Page first loads |
| User Searched | Search query runs 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) |
| Click to PDP (×2) | User navigates to a product detail page |
| Add to Cart (×2) | User adds a product to cart |
## Related
- [Smart Search Tracking Overview](smart-search-tracking-overview.md) — Quick View vs Results Page comparison
- [Smart Search Tracking: Quick View](smart-search-tracking-quick-view.md) — Quick View event payloads
- [Rebuy Analytic 2.0 Endpoints](rebuy-analytic-v2-endpoints.md) — Base endpoint and identification fields
- [Smart Search Event Listeners](smart-search-event-listeners.md) — JS lifecycle events for the Rebuy JS package
<!-- Source: onsite-js/src/onsite/js/modules/Tracker/Tracker.js, onsite-js/src/onsite/js/modules/SmartSearch/SmartSearch.js -->