Suggest Event Pixel - Bloomreach Experience - Open Source CMS

Suggest Event Pixel

Events always occur on a page view, so you must pass the associated page view pixel information together with the event pixel.

If you have an auto-suggest feature in your search form, when a user clicks on a search suggestion, BloomReach expects a Search Suggest Event to fire. 
The information captured in a suggest 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 Suggest Event information to Bloomreach. 

To get started, follow the steps given below:

1. Copy and paste the Suggest Event Tracking Snippet and install on all of your search suggestions. 
2. Map the search and suggest 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

Suggest Event Tracking Snippet

Scenario: User types "wo" in the Search Box and then clicks on the auto-suggested term "woven scarf"

var searchData = {};
searchData["aq"] = "wo";
searchData["q"] = "woven scarf";
searchData["catalogs"] = [{ "name" : "example_products" }];

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

Suggest Event Variables

Variable

Type

Example

Description

aq

String

Variable Example: wo

The display query (the one or more letters) that the user has actually typed. 
This is NOT the suggested word or phrase.

q

String

Variable Example: woven scarf

User's typed search query submitted to search box

catalogs Array of Objects

Variable Example: woven scarf

"name" : "example_products" 

Specific catalog for which the suggestion was chosen. 

Example: If you have text suggestions for Product and text suggestions for Content, then you will send the name of the catalog that those text suggestions belongs to (e.g. if a suggestion is picked from product text suggest then you'd send "example_products", otherwise "example_content")

Implementation Scenarios

Please review each of the following scenarios and implement as it applies to your site.

Scenario

Example

User types "wo " in Search Box and clicks on the auto-suggested term "woven scarf". 

The search result is displayed on a Search Results Page.

Implement the Suggest Event Code on the Suggest click.

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

User enters an exact product name (or product ID)  in the Search Bar. A product suggestions comes up and the user clicks on the Product Suggestions.

The search redirects to a Product Page.

Implement the Suggest Event Code on the Suggest click.

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.

User enters an exact category name (or cat ID)  in the Search Bar. A category suggestion comes up and the user clicks on the Category Suggestion.

The search redirects to a Category Page.
Implement the Suggest Event Code on the Suggest click.

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.

Native App Implementation

You can include the Global View variables and the following variables. For details on the native app implementation format, refer to the Non-JS Environment section in the Getting Started page. 

  • type
  • aq (see above)
  • 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.

For suggest events, group=suggest

Event Action Type etype  

Specifies the event's action type. Must not be empty.

For suggest events, etype=click

Example requests:

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?