Overview
The Tagging module provides comprehensive analytics tracking for your search interface. It captures user interactions, search events, and result engagement to help you:- Measure search performance and user behavior
- Track click-through rates and conversion metrics
- Analyze search effectiveness and relevance
- Integrate with external analytics platforms
- Support A/B testing and experimentation
When to Use
Implement tagging when you need to:- Track user clicks on search results
- Measure search query performance
- Monitor conversion events (add-to-cart, purchases)
- Collect data for search relevance tuning
- Integrate with analytics platforms (GA, Adobe Analytics, etc.)
- Comply with privacy regulations (GDPR, CCPA)
Configuration and Setup
Basic Setup
Add theTagging component to enable analytics tracking:
Configuration Options
Configure the tagging module using theTaggingConfigProvided event:
Consent Management
Handle user consent for tracking:API Reference
Configuration Interface
Store State
Store Actions
Store Mutations
Events
Examples
Track Search Queries
Queries are tracked automatically with debouncing:- Query text
- Total results
- Search response time
- User session ID
Track Result Clicks
Result clicks are tracked automatically when users click on results:- Result ID and position
- Query that generated the result
- Click timestamp
- User session ID
Track Add-to-Cart Events
Track when users add products to cart:Track Display Events
Track when results appear in the viewport:Custom Tracking
Dispatch custom tracking events:Integrate with Google Analytics
Bridge tagging events to Google Analytics:Handle No-Results Scenarios
Track no-results queries with fallback solutions:totalHits to -1 to differentiate from true no-results scenarios.
Advanced Usage
Session Management
The tagging module uses a session service to track user sessions:External Tagging Service
Customize how tagging data is sent:Query Tagging Debouncing
Query tracking is debounced to avoid excessive tracking. The debounce is:- Canceled when the query is cleared
- Forced when user clicks a result or reaches end of results
Best Practices
- Always respect user consent - Check consent before tracking personal data
- Configure appropriate debounce - Balance between data accuracy and API calls
- Track meaningful interactions - Focus on events that indicate user intent
- Monitor session duration - Adjust
sessionTTLMsbased on user behavior - Handle privacy compliance - Anonymize data when required by regulations
- Test tracking implementation - Verify events are sent correctly before production
- Document custom events - Keep track of custom tracking implementations
- Set up monitoring - Alert on tracking failures or anomalies
