Sending Beacons

Sending Beacons Through Tracker Functions

Tracker is a piece of code that you need to embed in every page of your web application. These functions capture your shopper’s action and store it in a beacon which is then sent to GroupBy. Once the tracker client is installed, instantiated, and has its Visitor and Session IDs set (e.g. with autoSetVisitor), you can start sending beacons.

Implement beacons using these instructions if the following describes your relationship with GroupBy:

  • You have not begun to use GroupBy Search on your site
  • You have been asked by your Customer Success Director at GroupBy to implement beacons on your site to power GroupBy demos

Following are the event types you can send with the GbTracker tracker:

Event Type Description
Search When a shopper views search results from a non-GroupBy search engine.
View Product When a shopper clicks a product from the product details page.
Add to Cart When a shopper adds products to their cart. Only the items added to the cart must be included, not the entire cart.
Remove from Cart When a shopper removes at least one product from their cart. Only the items removed from the cart must be included, not the entire cart.
View Cart When a shopper views their cart.
Order When a shopper checks out items from their cart.

search

gbTracker.sendSearchEvent()

Use Search tracker function if:

  • The search results are from your existing search engine.
  • You are performing an A/B test between your existing search engine and GroupBy Search.
sendSearchEvent Parameter
object
search
object

The search results.

required
experiments
array[object]

If you are leveraging our Refinement Based Personalization API, include this property. You can reach out to your GroupBy representative for help. The data from this property will be stored in our data warehouse and will be useful to provide insights on how a given ML model impacted your ecommerce platform’s search performance.

viewProduct

gbTracker.sendViewProductEvent()

This beacon should be sent when a shopper clicks a product. This can be loading a web page dedicated to a product or when a new HTML element is inserted into the DOM (or displayed in a modal), showing the shopper product details.

sendViewProductEvent Parameter
object
product
object

Details of the product viewed.

experiments
array[object]

addToCart

gbTracker.sendAddToCartEvent()

This beacon should be sent when a shopper adds an item to their cart. This must only include the items that were added to the cart as a result of the shopper’s interaction with the page (e.g. by clicking on an “add to cart” button), not the entire cart.

sendAddToCartEvent Parameter
object
cart
object

The cart containing the items added to the shopper’s cart, not the entire cart, during the shopper’s interaction with the page.

required
experiments
array[object]

removeFromCart

gbTracker.sendRemoveFromCartEvent()

This beacon should be sent when a shopper removes an item from their cart. It must only include the items that were removed from the cart as a result of the shopper’s interaction with the page, not the entire cart.

sendRemoveFromCartEvent Parameter
object
cart
object

The cart containing the items removed from the shopper’s cart, not the entire cart, during the shopper’s interaction with the page.

required
experiments
array[object]

viewCart

gbTracker.sendViewCartEvent()

This beacon should be sent when the shopper views their cart. All of the items in the shopper’s cart when they view it must be included in this event.

sendViewCartEvent Parameter
object
cart
object

The cart containing the items present in the shopper’s cart when they viewed it during the shopper’s interaction with the page.

required
experiments
array[object]

order

gbTracker.sendOrderEvent()

This beacon should be sent when the shopper places an order.

sendOrderEvent Parameter
object
cart
object

The cart containing the items present in the shopper’s cart when they viewed it during the shopper’s interaction with the page.

required
experiments
array[object]