Home > widget-integration > InstantSearchService > saveRequestId

InstantSearchService.saveRequestId() method

Save request ID to localStorage for analytics tracking.

Stores the API request ID under the suggest key in boostSdPreRequestIds so that downstream analytics can attribute product-click events to this specific search request.

**Legacy**: saveRequestId('suggest', requestId, bundles) in @deprecation/api/search.js **New**: Protected method on the service, called immediately after getSuggestions()

Signature:

protected saveRequestId(type: "suggest", requestId?: string, bundles?: SuggestionBundle[]): void;

Parameters

Parameter

Type

Description

type

"suggest"

Request type (always 'suggest' for ISW)

requestId

string

(Optional) The rid value from the API response metadata

bundles

SuggestionBundle[]

(Optional) Optional bundles array for widget-specific placement tracking

Returns:

void