Contentful Personalization & Analytics
    Preparing search index...

    Props for the Personalization component.

    interface PersonalizationProps {
        baselineEntry: Entry;
        children: (resolvedEntry: Entry) => ReactNode;
        liveUpdates?: boolean;
        onTap?: (resolvedEntry: Entry) => void;
        style?: StyleProp<ViewStyle>;
        testID?: string;
        threshold?: number;
        trackTaps?: boolean;
        trackViews?: boolean;
        viewTimeMs?: number;
    }
    Index

    Properties

    baselineEntry: Entry

    The baseline Contentful entry fetched with include: 10. Must include nt_experiences field with linked personalization data.

    const baselineEntry = await contentful.getEntry('hero-baseline-id', {
    include: 10,
    })
    children: (resolvedEntry: Entry) => ReactNode

    Render prop that receives the resolved variant entry. Called with the baseline entry if no personalization matches, or with the selected variant entry if personalization applies.

    Type Declaration

      • (resolvedEntry: Entry): ReactNode
      • Parameters

        • resolvedEntry: Entry

          The entry to display (baseline or variant)

        Returns ReactNode

        ReactNode to render

    <Personalization baselineEntry={entry}>
    {(resolvedEntry) => (
    <HeroComponent
    title={resolvedEntry.fields.title}
    image={resolvedEntry.fields.image}
    />
    )}
    </Personalization>
    liveUpdates?: boolean

    Whether this component should react to personalization state changes in real-time. When undefined, inherits from the liveUpdates prop on OptimizationRoot. When false (or inherited as false), the component locks to the first variant it receives, preventing UI flashing when user actions change their qualification. When true, the component updates immediately when personalizations change.

    undefined

    Live updates are always enabled when the preview panel is open, regardless of this setting.

    onTap?: (resolvedEntry: Entry) => void

    Optional callback invoked with the resolved entry after a tap tracking event is emitted. When provided, implicitly enables tap tracking unless trackTaps is explicitly false.

    undefined

    style?: StyleProp<ViewStyle>

    Optional style prop for the wrapper View.

    testID?: string

    Optional testID for testing purposes.

    threshold?: number

    Minimum visibility ratio (0.0 - 1.0) required to consider the component "visible".

    0.8

    trackTaps?: boolean

    Per-component override for tap tracking.

    • undefined: inherits from trackEntryInteraction.taps on OptimizationRoot
    • true: enable tap tracking for this entry
    • false: disable tap tracking (overrides the global setting)

    undefined

    trackViews?: boolean

    Per-component override for view tracking.

    • undefined: inherits from trackEntryInteraction.views on OptimizationRoot
    • true: enable view tracking for this entry
    • false: disable view tracking for this entry

    undefined

    viewTimeMs?: number

    Minimum time (in milliseconds) the component must be visible before tracking fires.

    2000