search
Use this event to track when users make a purchase unrelated to a previous Algolia request.
For example, if you don’t use Algolia to build your category pages,
use purchasedObjectIDs
.
For details, where this event is used, see Event types.
Related methods:
purchasedObjectIDsAfterSearch
: track purchase events related to Algolia requests.addedToCartObjectIDs
: track Add to cart events not related to Algolia requests.convertedObjectIDs
: track other conversion events not related to Algolia requests.sendEvents
: if you don’t want to send real-time events.
Examples
For more information about initializing the JavaScript Insights clientaa
,
see Initialize the Insights client.
JavaScript
Parameters
Name of the specific event.Format: 1-64 ASCII characters, except control characters.To maximize the impact of your events,
use consistent event names and consistent formatting,
for example, “Product Added To Cart” (always in title case).For example, you can adopt Twilio Segment’s object-action framework.
Name of the Algolia index.Format: same as the index name used by the search engine.Some API clients use
index
instead of indexName
.List of object IDs for items of an Algolia index.You can include up to 20 object IDs.
Anonymous user identifier.See also: User token
Pseudonymous identifier for authenticated users.See also: User token
Don’t include personally identifiable information in user tokens.
If you include pricing information in the
objectData
parameter or provide value
,
you must also specify the currency as ISO-4217 currency code,
such as USD or EUR.Absolute value of the discount in effect for this object,
measured in
currency
.Must be a decimal number with no more than 16 characters (including non-digit characters).Extra information about the records involved in the event,
for example, price and quantities of purchased products.If provided, must be the same length as
objectIDs
.If you include pricing information, you must also specify the currency
parameter.The price of the item.
This should be the final price,
inclusive of any discounts in effect.Must be a decimal number with no more than 16 characters (including non-digit characters).
The quantity of the purchased or added-to-cart item.
The total value of a purchase is the sum of
quantity
multiplied by the
price
of each purchased item.The monetary value of the event, measured in
currency
. For example, the total value of a purchase.If you assign a value
, you must also specify the currency
parameter.Must be a decimal number with no more than 16 characters (including non-digit characters).