Contentful Personalization & Analytics
    Preparing search index...

    Variable EntryReplacementVariantConst

    EntryReplacementVariant: ZodMiniObject<
        {
            hidden: ZodMiniOptional<ZodMiniBoolean<boolean>>;
            id: ZodMiniString<string>;
        },
        $strip,
    > = ...

    Zod schema describing a single entry replacement variant.

    Each variant is identified by an id and can carry a hidden flag.

    An empty variant — the content author's deliberate choice to show nothing for an audience — is always encoded as id: "". The resolver detects an empty variant via id === "" and returns isEmptyVariant: true in ResolvedData so renderers can suppress content while still emitting a component view impression for measurement.

    The hidden field on a variant has two possible states in Contentful-sourced data, but is not the detection signal for an empty variant:

    • hidden: true — the content author explicitly selected "Use empty variant" in the Personalization UI. This is the deliberate author intent described by this feature.
    • hidden: false (or absent) — an unfilled placeholder slot, created programmatically when a variant is added or unlinked but not yet filled with a real entry.

    Both states share id: "" and both result in isEmptyVariant: true. The hidden field itself is not a reliable detection signal because the Experience API strips it before runtime — hidden only survives in the Contentful CDA nt_config payload. Always use id === "" to detect an empty variant.

    The hidden field on the baseline (EntryReplacementComponent.baseline) has a different meaning: true excludes the entire component from variant resolution and allocation. This is unrelated to the empty-variant concept above.