Events always occur on a page view, so you must pass the associated page view pixel information together with the event pixel.
If a user types \`woven scarf\` in the search box and then clicks the search button or hits enter to submit the search, Bloomreach expects a search event pixel to fire that contains information about the search query. The information captured in a search event persists until the next page load happens (deferred) and the next page view pixel is fired. E.g. if the search leads to a Search Results Page, the [Search Page View Pixel](🔗) will send the Search Event information to Bloomreach.
To get started, follow the steps given below:
1\. Copy and paste the **Search Event Tracking Snippet** and install on all of your search buttons. 2\. Map the search event variables in the tracking snippet. 3\. Make sure to review the implementation scenarios to ensure that the search event data are sent to Bloomreach.
### **Search Event Parameters**
**query**
Column Title | Column Title | Column Title | Column Title |
**Variable** | **Format** | **Examples** | **Description** |
**q** | String | Variable Example: woven scarf | User's typed search query submitted to search box |
**catalogs** | Array of Catalog objects | \[{ "name" : "example_en" }\] | List of all catalogs that are displayed when the search page view loads:<br><br>\- E.g. if search page loads with 3 tabs - "products","content","videos", all three catalogs should be sent in the search event pixel |
#### **Implementation Scenarios**
Please review each of the following scenarios and implement as it applies to your site.
Scenario | Example |
User types "woven scarf" in Search Box and clicks the search button or hits enter to submit the search. <br> <br>The search result is displayed on a Search Results Page. | Implement the Search Event code on the Search button. <br> <br>The [Search Page View Pixel](🔗) that fires on the Search Results Page will automatically send the information captured in the Search Event to Bloomreach. <br>Make sure that the Search Event Pixel fires before the Search Page View Pixel. |
Enter an exact product name (or product ID) in the Search Bar. Click the Search Icon or hit Enter to start a Search. <br> <br>The search redirects to a Product Page. | Implement the Search Event code on the Search button. <br> <br>The [Product Page View Pixel](🔗) that fires on the Product Page will automatically send the information captured in the Search Event to Bloomreach. <br>Make sure that the Search Event Pixel fires before the Product Page View Pixel. |
Enter an exact category name (or cat ID) in the Search Bar. <br>Click the Search Icon or hit Enter to start a Search. <br> <br>The search redirects to a Category Page. | Implement the Search Event code on the Search button. <br> <br>The [Category Page View Pixel](🔗) that fires on the Category Page will automatically send the information captured in the Search Event to Bloomreach. <br>Make sure that the Search Event Pixel fires before the Category Page View Pixel. |
### Native App Implementation
Discovery SDKs
For details on using the Discovery [Android](🔗) and [iOS](🔗) SDKs for specific Native App Implementation, refer to their respective linked guides.
You cannclude the [Global View variables](🔗) and the following variables.
type
q (see above)
group
etype
Name | Variable | Example | Description |
Tracking Type | type | | The type of tracking fire. For events, type=event |
Group Type | group | | Specifies the event grouping. Must not be empty.<br><br>For search events, group=suggest |
Event Action Type | etype | | Specifies the event's action type. Must not be empty.<br><br>For search events, etype=submit |
Example requests: