List view
Understanding Nobi
Understanding Nobi
Getting Started
Getting Started
Implementing Nobi
Implementing Nobi
Knowledge Base
Knowledge Base
Merchandising
Merchandising
Custom Actions
Custom Actions
Query Overrides
Query Overrides
Plans And Billing
Plans And Billing
Developers Guide
Developers Guide
Beta Products
Beta Products
References
References
Tracking Events From Nobi
Nobi automatically emits analytics events that merchants can capture for their internal analytics, A/B testing, and business intelligence. This guide explains how to capture these events and what data they contain.
Overview
Nobi emits events through the following channels:
- Window Events - Custom events dispatched to
windowfor merchant capture
- Shopify Analytics - Native Shopify analytics events (for Shopify stores)
Emitted events
For every Nobi event, there are two dispatched events:
- Generic nobi-analytics event - This fires for all Nobi events and contains the specific event name in the detail.event property
- Specific event - Like nobi-search, etc.
For example, when a user searches, Nobi dispatches:
nobi-analyticswith detail:{ event: "Search", data: {...} }
nobi-searchwith detail:{ event: "Search", data: {...} }
When a product is added to cart, we dispatch:
nobi-analyticswith detail:{ event: "Product Added To Cart", data: {...} }
nobi-search:{ event: "Search", data: {...} }
The nobi-analytics listener captures all events because it's a catch-all that fires for every single Nobi event. The specific
event name is passed in the detail.event property.
event name is passed in the detail.event property.
This gives you two options:
- Listen to everything:
addEventListener('nobi-analytics', ...)
- Listen to specific events:
addEventListener('nobi-search', ...)
Capturing Events
Window Event Listeners
All Nobi events are dispatched as custom events to the browser's
window object. You can capture them using standard JavaScript event listeners:// Listen to all Nobi events window.addEventListener('nobi-analytics', function(event) { const { event: eventName, data, timestamp, source } = event.detail; // Send to your analytics platform analytics.track(eventName, { ...data, timestamp, source }); }); // Listen to specific event types window.addEventListener('nobi-search', function(event) { console.log('User performed a search:', event.detail); });
Event Structure
All Nobi events follow this structure:
{ detail: { event: "Search", // Event name data: { // Event-specific data query: "red sweater", searchEngine: "Nobi", // ... other properties }, timestamp: "2024-01-15T10:30:00Z", // ISO timestamp source: "nobi" // Always "nobi" } }
Event Reference
Search Events
Search
Event Name: Search
Window Event: nobi-search
Description: Fired when a user performs any search.
Data Properties:
- query (string) - The search query
- searchEngine (string) - "Nobi" or site-specific engine
- pageType (string) - Type of page the search was initiated from
Search On Nobi
Event Name: Search On Nobi
Window Event: nobi-search-on-nobi
Description: Fired when a search is handled by Nobi's AI engine.
Data Properties:
- query (string) - The search query
- pageType (string) - Type of page the search was initiated from
Search On Shopify
Event Name: Search On Shopify
Window Event: nobi-search-on-shopify
Description: Fired when a search falls back to Shopify's default search.
Data Properties:
- query (string) - The search query
Typeahead Query Clicked
Event Name: Typeahead Query Clicked
Window Event: nobi-typeahead-query-clicked
Description: Fired when a user clicks a suggested query in the typeahead dropdown.
Data Properties:
- query (string) - The clicked suggestion query
- originalQuery (string) - What the user originally typed
- pageType (string) - Type of page
Typeahead Product Clicked
Event Name: Typeahead Product Clicked
Window Event: nobi-typeahead-product-clicked
Description: Fired when a user clicks a product in the typeahead dropdown.
Data Properties:
- productId (string) - The product ID
- query (string) - The current search query
Typeahead View All Clicked
Event Name: Typeahead View All Clicked
Window Event: nobi-typeahead-view-all-clicked
Description: Fired when a user clicks "View All" in the typeahead dropdown.
Data Properties:
- query (string) - The current search query
- pageType (string) - Type of page
User Interface Events
Click On Search Icon
Event Name: Click On Search Icon
Window Event: nobi-click-on-search-icon
Description: Fired when user clicks the Nobi search icon to open the search interface.
Data Properties: None (only common properties are included)
Click Search With AI Button
Event Name: Click Search With AI Button
Window Event: nobi-click-search-with-ai-button
Description: Fired when user clicks the "Search With AI" button.
Data Properties: None (only common properties are included)
Shop With AI Button Shown
Event Name: Shop With AI Button Shown
Window Event: nobi-shop-with-ai-button-shown
Description: Fired when the "Shop With AI" button becomes visible on the page.
Data Properties: None (only common properties are included)
Click On Search Result
Event Name: Click On Search Result
Window Event: nobi-click-on-search-result
Description: Fired when user clicks on a product in search results.
Data Properties:
- productVariantId (string) - Clicked variant ID
- openInNewTab (boolean) - Whether it opened in a new tab
- positionInGrid (number, optional) - Position in the results grid
- merchandisingRuleId (string, optional) - Applied merchandising rule ID
- merchandisingRuleAction (string, optional) - Applied merchandising action
- isBoostedVariant (boolean) - Whether the product was boosted by a rule
- isBuriedVariant (boolean) - Whether the product was buried by a rule
- isSlottedVariant (boolean) - Whether the product was slotted by a rule
Quick Add Product
Event Name: Quick Add Product
Window Event: nobi-quick-add-product
Description: Fired when user quick-adds a product to cart from search results.
Data Properties:
- productVariantId (string) - Variant ID added
- size (string) - Selected size
- price (string) - Product price
- conversationId (string) - Associated conversation ID
Click On Show More Products Button
Event Name: Click On Show More Products Button
Window Event: nobi-click-on-show-more-products-button
Description: Fired when user clicks "Load More" to see additional products.
Data Properties:
- conversationId (string) - Associated conversation ID
Close Drawer
Event Name: Close Drawer
Window Event: nobi-close-drawer
Description: Fired when user closes the Nobi chat drawer.
Data Properties:
- query (string) - The initial user message/query
Chat and Conversation Events
Chatbot Viewed
Event Name: Chatbot Viewed
Window Event: nobi-chatbot-viewed
Description: Fired when the Nobi chatbot interface is first viewed.
Data Properties: None (only common properties are included)
Send Message
Event Name: Send Message
Window Event: nobi-send-message
Description: Fired when user sends a message to the Nobi assistant.
Data Properties:
- query (string) - The message content
- pageType (string) - Type of page the message was sent from
- conversationId (string) - Conversation ID
Click New Chat Button
Event Name: Click New Chat Button
Window Event: nobi-click-new-chat-button
Description: Fired when user clicks the button to start a new chat.
Data Properties:
- conversationId (string, optional) - Previous conversation ID
Start New Conversation
Event Name: Start New Conversation
Window Event: nobi-start-new-conversation
Description: Fired when a new conversation is initiated.
Data Properties: None (only common properties are included)
Product and Cart Events
These events track product interactions and cart activity. On Shopify stores, Nobi captures native Shopify events and re-emits them as Nobi window events.
Product Viewed
Event Name: Product Viewed
Window Event: nobi-product-viewed
Description: Fired when a product page is viewed (captured from Shopify analytics).
Data Properties:
- productId (string) - The product ID
- productVariantId (string) - The variant ID
Product Added To Cart
Event Name: Product Added To Cart
Window Event: nobi-product-added-to-cart
Description: Fired when a product is added to cart.
Data Properties:
- productVariantId (string) - The variant ID added
- productId (string) - The product ID
- price (string) - Product price
- quantity (number) - Quantity added
Product Removed From Cart
Event Name: Product Removed From Cart
Window Event: nobi-product-removed-from-cart
Description: Fired when a product is removed from cart.
Data Properties:
- productVariantId (string) - The variant ID removed
Cart Drawer Assistant Viewed
Event Name: Cart Drawer Assistant Viewed
Window Event: nobi-cart-drawer-assistant-viewed
Description: Fired when the cart drawer assistant (cross-sell suggestions) is viewed.
Data Properties: None (only common properties are included)
Respond To Cart Assistant
Event Name: Respond To Cart Assistant
Window Event: nobi-respond-to-cart-assistant
Description: Fired when user responds to a cart assistant suggestion.
Data Properties:
- icebreaker (string) - The assistant's prompt message
- message (string) - The user's response
Checkout Completed
Event Name: Checkout Completed
Window Event: nobi-checkout-completed
Description: Fired when a customer completes checkout. Includes the last known conversationId for attribution.
Data Properties:
- conversationId (string, optional) - Last Nobi conversation ID (for attribution)
- variants (string) - JSON array of purchased variant details
Product Collection Events
Displayed Product Collection
Event Name: Displayed Product Collection
Window Event: nobi-displayed-product-collection
Description: Fired when a product collection/grid is rendered for the user.
Data Properties:
- conversationId (string) - Associated conversation ID
- collectionName (string) - Collection name/title
- collectionSize (number) - Number of products shown
- isSubCollection (boolean) - Whether this is a sub-collection
- filteringStrategy (string) - How results were filtered
- hasBoostedVariants (boolean) - Whether any products were boosted
- hasBuriedVariants (boolean) - Whether any products were buried
Displayed Slotted Product
Event Name: Displayed Slotted Product
Window Event: nobi-displayed-slotted-product
Description: Fired when a product placed by a merchandising slot rule is displayed.
Data Properties:
- productVariantId (string) - The slotted variant ID
- merchandisingRuleId (string) - The rule that placed this product
- positionInGrid (number) - The slot position in the grid
- conversationId (string) - Associated conversation ID
Click Expand Product Collection Button
Event Name: Click Expand Product Collection Button
Window Event: nobi-click-expand-product-collection-button
Description: Fired when user expands a collapsed product collection.
Data Properties:
- conversationId (string) - Associated conversation ID
Click Collapse Product Collection Button
Event Name: Click Collapse Product Collection Button
Window Event: nobi-click-collapse-product-collection-button
Description: Fired when user collapses an expanded product collection.
Data Properties:
- conversationId (string) - Associated conversation ID
Recommendation and PDP Events
These events apply to merchants using Nobi's AI-generated product recommendations on product detail pages (PDPs).
PDP Assistant Loaded
Event Name: PDP Assistant Loaded
Window Event: nobi-pdp-assistant-loaded
Description: Fired when the PDP assistant (Q&A or recommendations panel) loads on a product page.
Data Properties: None (only common properties are included)
Request Product Recommendations
Event Name: Request Product Recommendations
Window Event: nobi-request-product-recommendations
Description: Fired when product recommendations are requested (from cart or PDP context).
Data Properties:
- productInternalId (string) - The product being viewed
PDP Recommendations Loaded
Event Name: PDP Recommendations Loaded
Window Event: nobi-pdp-recommendations-loaded
Description: Fired when PDP recommendations finish loading.
Data Properties:
- productInternalId (string) - The product being viewed
PDP Recommendations Panel Viewed
Event Name: PDP Recommendations Panel Viewed
Window Event: nobi-pdp-recommendations-panel-viewed
Description: Fired when the PDP recommendations panel becomes visible (scrolled into view).
Data Properties:
- productInternalId (string) - The product being viewed
Search Product Inquiry
Event Name: Search Product Inquiry
Window Event: nobi-search-product-inquiry
Description: Fired when user initiates a product inquiry from the PDP assistant.
Data Properties: None (only common properties are included)
Suggestion Pill Events
Suggestion Pills Container Loaded
Event Name: Suggestion Pills Container Loaded
Window Event: nobi-suggestion-pills-container-loaded
Description: Fired when the suggestion pills container loads on a page.
Data Properties:
- productInternalId (string, optional) - Product ID if on a PDP
- variant (string, optional) - A/B test variant
- productVariantInternalId (string, optional) - Variant ID if on a PDP
Suggestion Pills Container Viewed
Event Name: Suggestion Pills Container Viewed
Window Event: nobi-suggestion-pills-container-viewed
Description: Fired when the suggestion pills container becomes visible (scrolled into view).
Data Properties:
- productInternalId (string, optional) - Product ID if on a PDP
- variant (string, optional) - A/B test variant
- productVariantInternalId (string, optional) - Variant ID if on a PDP
Suggestion Pills Viewed
Event Name: Suggestion Pills Viewed
Window Event: nobi-suggestion-pills-viewed
Description: Fired when individual suggestion pills become visible.
Data Properties:
- content (string, optional) - Last message content (in chat context)
- productInternalId (string, optional) - Product ID (in PDP/cart context)
- pillText (string, optional) - Text of the viewed pill (PDP context)
Click Suggestion Pill
Event Name: Click Suggestion Pill
Window Event: nobi-click-suggestion-pill
Description: Fired when user clicks a suggestion pill.
Data Properties:
- pillText (string) - The text of the clicked pill
- pillType (string, optional) - Type of pill (in PDP context)
- productInternalId (string, optional) - Product ID (in PDP/cart context)
Citation and Source Events
Click Citation Pill
Event Name: Click Citation Pill
Window Event: nobi-click-citation-pill
Description: Fired when user clicks an inline citation reference in an assistant response.
Data Properties:
- sourceName (string) - Name of the cited source
- sourceUrl (string) - URL of the cited source
- sourceIndex (number) - Citation index number
- clusterSize (number) - Number of citations in this cluster
Click View Sources Button
Event Name: Click View Sources Button
Window Event: nobi-click-view-sources-button
Description: Fired when user clicks the "View Sources" button to open the sources sidebar.
Data Properties:
- sourceCount (number) - Number of sources available
Click Source In Sidebar
Event Name: Click Source In Sidebar
Window Event: nobi-click-source-in-sidebar
Description: Fired when user clicks a specific source in the sources sidebar.
Data Properties:
- sourceName (string) - Name of the source
- sourceUrl (string) - URL of the source
- sourceIndex (number) - Position in the source list
Site Activity Events
These events track general visitor behavior on the site, independent of Nobi chat interactions. They are useful for understanding browsing patterns.
Page Viewed
Event Name: Page Viewed
Window Event: nobi-page-viewed
Description: Fired when a visitor navigates to a new page.
Data Properties:
- pageUrl (string) - The page URL
- pageTitle (string) - The page title
- referrer (string) - The referring URL
- navigationMethod (string) - How the user navigated (e.g., "direct", "link")
- previousPageUrl (string, optional) - The previous page URL
Page Exited
Event Name: Page Exited
Window Event: nobi-page-exited
Description: Fired when a visitor leaves a page (via navigation or tab close). Uses sendBeacon for reliable delivery.
Data Properties:
- pageUrl (string) - The page URL
- timeOnPageMs (number) - Total time on page in milliseconds
- activeTimeMs (number) - Active (non-idle) time on page in milliseconds
Scroll Depth Reached
Event Name: Scroll Depth Reached
Window Event: nobi-scroll-depth-reached
Description: Fired when a visitor scrolls past 25%, 50%, 75%, or 100% of the page. Each milestone fires only once per page view.
Data Properties:
- pageUrl (string) - The page URL
- depth (number) - Scroll depth milestone reached (25, 50, 75, or 100)
On-Site Search Detected
Event Name: On-Site Search Detected
Window Event: nobi-on-site-search-detected
Description: Fired when a site search is detected from URL parameters (e.g., ?q=shoes).
Data Properties:
- pageUrl (string) - The page URL
- searchQuery (string) - The detected search query
- searchSource (string) - The URL parameter key that contained the query
Common Event Properties
All events automatically include these common properties:
conversationId(string, optional) - Associated conversation ID
entryPoint(string) - How user accessed Nobi ("SearchBar", "Cart", "PDP")
shopperId(string) - Unique shopper identifier (persisted in localStorage)
isMobile(boolean) - Whether user is on mobile device
pageUrl(string) - Current page URL
timestamp(string) - ISO timestamp when event occurred
source(string) - Always "nobi"
Merchant Information
When available, events may also include:
Nobi Merchant Name(string) - Your store name in Nobi
Implementation Examples
Google Analytics 4
// Track all Nobi events in GA4 window.addEventListener('nobi-analytics', function(event) { const { event: eventName, data } = event.detail; gtag('event', eventName.toLowerCase().replace(/\s+/g, '_'), { event_category: 'nobi', ...data }); });
Segment
// Track Nobi events with Segment window.addEventListener('nobi-analytics', function(event) { const { event: eventName, data } = event.detail; analytics.track(eventName, { ...data, source: 'nobi' }); });
Custom Analytics
// Send to your custom analytics endpoint window.addEventListener('nobi-analytics', function(event) { const { event: eventName, data, timestamp } = event.detail; fetch('/api/analytics/track', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ event: eventName, properties: data, timestamp: timestamp, source: 'nobi' }) }); });
Shopify Analytics Integration
For Shopify stores, Nobi also publishes events to Shopify's native analytics system. These events are automatically available in:
- Shopify Admin Analytics
- Shopify Scripts
- Shopify Flow
- Third-party apps that use Shopify's Web Pixels API
Shopify Event Names
Nobi publishes these events to Shopify Analytics:
- Custom Nobi events (non-Shopify native events)
- All events except:
product_added_to_cart,product_viewed,search_submitted,product_removed_from_cart,checkout_completed(these are native Shopify events)
Privacy and Data Handling
User Privacy
- Events include a unique
shopperIdthat persists across sessions but doesn't contain PII
- No email addresses, names, or other personal information are included in events
- IP addresses are not included in event data
GDPR Compliance
- The
shopperIdcan be reset by clearing localStorage
- All event data is aggregated and anonymized in Nobi's systems
- Merchants are responsible for obtaining appropriate consent for their own analytics tracking
Data Retention
- Window events are ephemeral and only exist in the browser session
- Merchants control retention of captured event data in their own systems
- Nobi retains aggregated analytics data according to our privacy policy
Troubleshooting
Events Not Firing
- Check browser console for JavaScript errors
- Verify Nobi is properly initialized on your site
- Test with the browser's developer tools:
// Check if events are being dispatched window.addEventListener('nobi-analytics', function(event) { console.log('Nobi Event:', event.detail); });
Missing Event Data
- Some properties are only available in certain contexts (e.g.,
conversationIdonly exists during chat sessions)
- Shopify-specific data (like product IDs) only exists on Shopify stores
- Mobile detection may vary based on device and browser
Event Timing
- Events are dispatched synchronously when actions occur
- Network delays may affect when your analytics platform receives the data
- Some events (like
Checkout Completed) may fire with a slight delay due to Shopify's event timing
Tracking Events From NobiOverviewEmitted eventsCapturing EventsWindow Event ListenersEvent StructureEvent ReferenceSearch EventsUser Interface EventsChat and Conversation EventsProduct and Cart EventsProduct Collection EventsRecommendation and PDP EventsSuggestion Pill EventsCitation and Source EventsSite Activity EventsCommon Event PropertiesMerchant InformationImplementation ExamplesGoogle Analytics 4SegmentCustom AnalyticsShopify Analytics IntegrationShopify Event NamesPrivacy and Data HandlingUser PrivacyGDPR ComplianceData RetentionTroubleshootingEvents Not FiringMissing Event DataEvent Timing