Contentful Personalization & Analytics
    Preparing search index...

    Props for the Analytics component.

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

    Properties

    children: ReactNode

    Child components to render. Unlike Personalization, this uses a standard children pattern since no variant resolution is needed.

    entry

    entry: Entry

    The Contentful entry to track (non-personalized content).

    const productEntry = await contentful.getEntry('product-123')
    
    onTap?: (entry: Entry) => void

    Optional callback invoked with the 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