Method Signature
trackRecommendationResultsLoaded but provides more granular control over what constitutes a “view”.
Parameters
The tracking parameters.
Network-specific parameters.
Returns
Returnstrue on success or an Error object on failure.
Examples
Basic Usage
With Intersection Observer (Viewport Tracking)
Tracking Carousel Views
Lazy-Loaded Recommendations
With Analytics Tags
When to Use
UsetrackRecommendationView when:
- You want to track only the recommendations actually visible in the viewport
- Implementing scroll-based lazy loading
- Tracking carousel or slider views
- You need more control than
trackRecommendationResultsLoadedprovides
Difference from trackRecommendationResultsLoaded:
trackRecommendationResultsLoaded: Track when recommendations are loaded/renderedtrackRecommendationView: Track when recommendations are actually viewed by the user
Best Practices
-
Track Actual Views: Use
numResultsViewedto indicate how many recommendations were actually seen, not just rendered. - Viewport Detection: Consider using Intersection Observer API to accurately track when recommendations enter the viewport.
- Deduplicate: If tracking carousel views, ensure you don’t double-count items as users navigate.
-
Combine with Load Tracking: Use
trackRecommendationResultsLoadedfor when results load, and this method for when they’re viewed.
Error Handling
Related Methods
- trackRecommendationResultsLoaded - Track when recommendations are loaded
- trackRecommendationClick - Track clicks on recommendations
- getRecommendationResults - Get recommendation results