Contentful Personalization & Analytics
    Preparing search index...

    Options for the useTapTracking hook.

    interface UseTapTrackingOptions {
        enabled: boolean;
        entry: Entry;
        onTap?: (entry: Entry) => void;
        personalization?: {
            experienceId: string;
            sticky?: boolean;
            variantIndex: number;
            variants: Record<string, string>;
        };
    }
    Index

    Properties

    enabled: boolean

    Whether tap tracking is enabled for this component.

    entry

    entry: Entry

    The resolved Contentful entry to track (baseline or variant).

    onTap?: (entry: Entry) => void

    Optional callback invoked with the entry after the tap tracking event is emitted.

    undefined

    personalization?: {
        experienceId: string;
        sticky?: boolean;
        variantIndex: number;
        variants: Record<string, string>;
    }

    Personalization data for variant tracking. Omit for baseline/non-personalized entries.

    Type Declaration

    • experienceId: string

      Identifier of the personalization or experiment experience.

    • Optionalsticky?: boolean

      Indicates whether this personalization selection is sticky for the user.

      false
      

      Sticky selections should be reused on subsequent requests for the same user, rather than re-allocating a new variant.

    • variantIndex: number

      Index of the selected variant within the experience configuration.

      Typically corresponds to the index of the selected PersonalizationConfig entry.

    • variants: Record<string, string>

      Mapping of baseline entry IDs to their selected variant entry IDs.

      The keys are component identifiers and the values are the identifiers of the selected variant for that component.