Search Event Pixel

What are Search Event Pixels

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.

How to Implement Search Event Pixels

Follow the steps below:

  1. Copy and paste the Search Event Tracking Snippet inside all your search buttons to install the Pixel.
  2. Configure the Search Event Variables in the Tracking Snippet.
  3. Make sure to review the implementation scenarios to ensure that the search event data is correctly sent to Bloomreach.

Search Event Pixels Variables Checklist

Listed below are the tracking variables required specifically for Search Event Pixels.

Required Variables

VariableValue type, ExampleDescription
acct_idString, “1235”The Bloomreach-provided Account identifier.

Value must be consistent with the account_id value passed in API call.
prod_idString (Case sensitive), “prod123”The unique product ID, which describes a product, product bundle, product collection or SKU set.
groupString, “product”This specifies the event grouping.

Allowed values: suggest, cart, product, widget
etypeString, “click”Specifies the event’s action type.
Allowed values: click, click-add, quickview, submit
qString, “blue dress”The search query typed (and submitted) by the user in the search box.

Conditional variables - based on your implementation

VariableValue type, ExampleDescription
view_idString (Case sensitive), “10200”The name of the product catalog view that would be searched against on the page where the event occurred.

It identifies the catalog view to show when one Bloomreach account ID hosts multiple site versions.
domain_keyString (Case sensitive), “bloomreach_fr”The Bloomreach-provided ID of the domain receiving the request.

Set Domain Key to the name of the product catalog that would be searched against on the page where the event occurred.
titleString, “Best Sellers”This is the title of the current page or screen name of the app view.
refString, “https://www.homeoasis.com/category/mens-clothes"This is the URL from the referrer screen.

For a native mobile app, “ref” follows a synthetic structure that is used for identifying the content within the app rather than actual navigable URLs.
catalogsArray of Catalog objects,
“[ { name : "products_en" } ]”
List of catalogs that are shown on the page.

📘

For a full list of required and optional variables, see Pixel Reference

Implementation Scenarios

Please review each of the following scenarios and implement they apply to your site.

ScenarioExample
User types "woven scarf" in Search Box and clicks the search button or hits enter to submit the search. 

The search result is displayed on a Search Results Page.
Implement the Search Event code on the Search button.

The Search Page View Pixel that fires on the Search Results Page will automatically send the information captured in the Search Event to Bloomreach.
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. 

The search redirects to a Product Page.
Implement the Search Event code on the Search button.

The Product Page View Pixel that fires on the Product Page will automatically send the information captured in the Search Event to Bloomreach. 
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.
Click the Search  Icon or hit Enter to start a Search. 

The search redirects to a Category Page.
Implement the Search Event code on the Search button.

The Category Page View Pixel that fires on the Category Page will automatically send the information captured in the Search Event to Bloomreach. 
Make sure that the Search Event Pixel fires before the Category Page View Pixel.

Tracking Snippet for Search Event Pixels

JavaScript Implementation

var searchData = {};
searchData["q"] = "woven scarf";
searchData["catalogs"] = [{ "name" : "example_en" }];

BrTrk.getTracker().logEvent("suggest", "submit",searchData,{},true);

Non-JavaScript Implementation

To integrate Bloomreach Pixels in a Non-JS Environment, you can choose one of the following options:

https://p.brsrvr.com/pix.gif?
acct_id=6702
&cookie2=uid%3D1e7724c751a3f6e6241018d150144832e7528383%3Av%3Dapp%3Ats%3D0%3Ahc%3D1
&rand=86838131966165760
&type=event
&title=Blue%20Lace%20Dress
&url=http%3A%2F%2Fmerchantname.app%2Fproduct%2Fblue%2520lace%2520dress
&ref=http%3A%2F%2Fmerchantname.app%2Fcategory%2Fdresses
&group=suggest
&etype=submit
&ptype=product
&prod_id=prod1234
&prod_name=Blue%20Lace%20Dress
&sku=123-45
&q=blue%20lace%20dress

Validate Pixel Implementation

Once Pixel implementation is complete, use the Pixel Validator Chrome Plug-in to validate if the Search Event Pixel is working as expected. Follow the scenarios listed in the Test Scenarios - Search guide.

Troubleshooting

If you’re having issues with the ‘q’ parameter, refer to this debugging article.

Monitor and Manage Pixel Data

For long-term monitoring, use Pixel Monitor to get more detailed trend lines and set pixel error alerts. We recommend that you subscribe to pixel alerts.