For detailed API specifications in Swagger/OpenAPI format, see Platform APIs.
UI components required to implement the Signals API
Two values you need to use the Signals API are the signal store ID and embed token. This section provides the steps in the necessary order to create and obtain those values from the UI.1. Create a signal store
-
Navigate to the megamenu and click Signals.
-
Click Create New.
- In the Name field, enter a unique user-defined for the signals store.
-
In the Region field, select the geographical area for the signal store.
This selection cannot be changed. If you need a signal store in a different region, you need to create another signal store with the other region specified.
- Click Create.
2. Generate and copy the embed token to your codebase
To generate the embed token, navigate to the megamenu and click Signals.- Click the signal store where you want to configure the signals beacon and then click Integrations > Signals Using Embed Token.
-
If you haven’t configured embeds for this signal store, the “No embed token found” message displays.
-
Click Generate. It may take a few moments to generate the token.
The generated embed token for the signal store is permanent and cannot be changed.
-
In the Embed Token section, click Copy and then paste the token into your codebase. To view the token, click Show or click Hide to prevent it from displaying.
The embed token also displays in asterisks in the Authorization header line of all of the cURL examples. When you copy and then paste the cURL example, the value of the embed token displays instead of the asterisks. For example:
3. Obtain the signal store ID
To obtain the signal store ID, navigate to the megamenu and click Signals.- Click the signal store where you want to configure the signals beacon and then click Integrations > Signals Using Embed Token.
-
The signal store ID displays in first line of all of the cURL examples. Copy that ID to paste into your codebase. For example:
4. Copy or create code to collect signals
Lucidworks provides cURL command examples for the query, click, cart-add, and purchase signals that you can copy into your backend codebase and modify based on the language you use, such as Java, C#, Python, or Nodejs.For detailed API specifications in Swagger/OpenAPI format, see Platform APIs.
- Click the signal store where you want to configure the signals beacon and then click Integrations > Signals Using Embed Token.
- Click Copy to copy the cURL command example for the signal you want to add to your codebase.
- Paste the command in your codebase and modify based on your organizational needs. If you choose not to use the examples Lucidworks provides, enter code into your codebase manually.
Example user flow and signal events
This section provides a typical user interaction flow for browsing and purchasing a product by describing the required API signals and UUID generation necessary for event tracking. You can program your site to generate UUIDs using any standards-compliant method. Each signal depends on proper UUID generation and tracking. Consistent IDs are necessary for signal integrity and accurate metrics for analytics. To successfully create signals and ensure complete signal tracking, your site must generate and persist the following UUIDs:visitorId
andsessionId
are required in every signal (query, click, cartadd, and purchase) to identify the user and session.queryId
is required in every signal (query, click, cartadd, and purchase) to identify the query, including refinements like facet selection.searchTerms
is required in the query signal to return results.cartId
is required in the cartadd and purchase signals for cart activity and must be replaced with a different UUID for each new user cartadd signal.orderId
is optional, and is used on the purchase_complete signal and identifies an actual purchase as opposed to an attempted purchase.
visitorId
is typically stored in localStorage
to persist across sessions, and sessionId
is usually stored in sessionStorage
to reset between sessions.
Other parameters are detailed in the Signals API specification.
Sample user interaction flow
The following example provides typical interactions when a customer searches for and purchases a refrigerator.1. Site entry and ID generation
When a user visits your site, the site must generate thevisitorId
and sessionId
universal unique identifiers (UUIDs).
2. Search query and initial query signal
When the user searches for “silver french door bottom freezer refrigerator,” your site must generate a newqueryId
UUID and send a query signal.
Generate queryID
3. Product click and click signal
When the user clicks a product, your site must generate a click signal that uses the samequeryId
generated in the query request that returned the results on which the user clicks.
Click signal
4. Cart addition and cart-add signal
When the user adds the product to their cart, your site must generate acartId
and send a cart-add signal.
Cart add signal
5. Purchase and purchase signal
When the user completes the purchase, your site can generate an optionalorderId
along with the purchase signal using the cartId
from the cart-add signal. After the purchase, the site must replace that cartId
with a new UUID for the next cart-add signal.
Purchase signal
Additional signal information
Facet refinement and query signal generation
When the user applies a facet, for example, the query parameter of “?facet=appliances”, the signals beacon considers it to be a new query. Your site must determine if you want to generate a newqueryId
UUID and new query signal, or if you handle that interaction in a different way.
Facet signal