A wrapper View with interaction tracking attached
Must be used within an OptimizationProvider. Works with or without a
OptimizationScrollProvider — when outside a OptimizationScrollProvider, screen dimensions are
used instead. Tracks with variantIndex: 0 and no experienceId to indicate
baseline/non-personalized content.
<OptimizationScrollProvider>
<Analytics entry={productEntry}>
<ProductCard
name={productEntry.fields.name}
price={productEntry.fields.price}
/>
</Analytics>
</OptimizationScrollProvider>
<Analytics entry={productEntry} trackTaps>
<Pressable onPress={() => navigate(productEntry)}>
<ProductCard name={productEntry.fields.name} />
</Pressable>
</Analytics>
Personalization for tracking personalized entries
Tracks views and taps of non-personalized Contentful entry components (content entries).
Use this component for standard Contentful entries you want analytics on (products, articles, etc.) that are not personalized.