Contentful Personalization & Analytics
    Preparing search index...
    interface PersonalizationProps {
        baselineEntry: Entry;
        children: (resolvedEntry: Entry) => ReactNode;
        style?: StyleProp<ViewStyle>;
        testID?: string;
        threshold?: number;
        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 // Required to load all variant data
    })
    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>
    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 component "visible".

    0.8 (80% of the component must be visible in viewport)
    
    viewTimeMs?: number

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

    2000 (2 seconds)