Contentful Personalization & Analytics
    Preparing search index...
    • Unified component for tracking and personalizing Contentful entries.

      Handles both optimized entries (with nt_experiences) and non-optimized entries. For optimized entries, it resolves the correct variant based on the user's profile. For all entries, it tracks views and taps.

      Returns Element

      A wrapper View with interaction tracking attached

      "Tracking" refers to tracking Contentful content entries, not React Native UI components. Must be used within an OptimizationProvider. Works with or without an OptimizationScrollProvider — when outside an OptimizationScrollProvider, screen dimensions are used instead.

      By default the component locks to the first variant it receives to prevent UI flashing. Set liveUpdates to true or open the preview panel to enable real-time variant switching.

      <OptimizationScrollProvider>
      <OptimizedEntry entry={entry}>
      {(resolvedEntry) => (
      <HeroComponent
      title={resolvedEntry.fields.title}
      image={resolvedEntry.fields.image}
      />
      )}
      </OptimizedEntry>
      </OptimizationScrollProvider>
      <OptimizedEntry entry={productEntry}>
      <ProductCard name={productEntry.fields.name} />
      </OptimizedEntry>
      <OptimizedEntry entry={entry} trackTaps>
      {(resolvedEntry) => (
      <Pressable onPress={() => navigate(resolvedEntry)}>
      <Card title={resolvedEntry.fields.title} />
      </Pressable>
      )}
      </OptimizedEntry>