Contentful Personalization & Analytics
    Preparing search index...

    Interface InsightsQueueInternal

    Internal Insights queueing and flush runtime used by CoreStateful.

    interface InsightsQueue {
        clearPeriodicFlushTimer(): void;
        clearQueuedEvents(): void;
        clearScheduledRetry(): void;
        flush(options?: InsightsQueueFlushOptions): Promise<void>;
        send(
            event:
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    entityId: string;
                    entityKind: "Experience"
                    | "ExperienceFragment";
                    entityKindId?: string;
                    entryIds?: string[];
                    messageId: string;
                    optimizationId?: string;
                    originalTimestamp: string;
                    parameters?: Record<string, JSONType>;
                    parentExperienceId?: string;
                    parentVariantId?: string;
                    sentAt: string;
                    timestamp: string;
                    type: "exo_node_view";
                    userId?: string;
                    variantId?: string;
                    variantIndex?: number;
                    viewDurationMs: number;
                    viewId: string;
                }
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    componentId: string;
                    componentType?: "Entry" | "Variable";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    experienceId?: string;
                    messageId: string;
                    originalTimestamp: string;
                    sentAt: string;
                    timestamp: string;
                    type: "component";
                    userId?: string;
                    variantIndex?: number;
                    viewDurationMs?: number;
                    viewId?: string;
                }
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    componentId: string;
                    componentType?: "Entry" | "Variable";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    experienceId?: string;
                    messageId: string;
                    originalTimestamp: string;
                    sentAt: string;
                    timestamp: string;
                    type: "component_click";
                    userId?: string;
                    variantIndex?: number;
                }
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    entityId: string;
                    entityKind: "Experience"
                    | "ExperienceFragment";
                    entityKindId?: string;
                    entryIds?: string[];
                    messageId: string;
                    optimizationId?: string;
                    originalTimestamp: string;
                    parameters?: Record<string, JSONType>;
                    parentExperienceId?: string;
                    parentVariantId?: string;
                    sentAt: string;
                    timestamp: string;
                    type: "exo_node_click";
                    userId?: string;
                    variantId?: string;
                    variantIndex?: number;
                }
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    entityId: string;
                    entityKind: "Experience"
                    | "ExperienceFragment";
                    entityKindId?: string;
                    entryIds?: string[];
                    hoverDurationMs: number;
                    hoverId: string;
                    messageId: string;
                    optimizationId?: string;
                    originalTimestamp: string;
                    parameters?: Record<string, JSONType>;
                    parentExperienceId?: string;
                    parentVariantId?: string;
                    sentAt: string;
                    timestamp: string;
                    type: "exo_node_hover";
                    userId?: string;
                    variantId?: string;
                    variantIndex?: number;
                }
                | {
                    anonymousId?: string;
                    channel: "server"
                    | "mobile"
                    | "web";
                    componentId: string;
                    componentType?: "Entry" | "Variable";
                    context: {
                        app?: { name: string; version: string };
                        campaign: {
                            content?: string;
                            medium?: string;
                            name?: string;
                            source?: string;
                            term?: string;
                        };
                        gdpr?: { isConsentGiven: boolean };
                        library: { name: string; version: string };
                        locale?: string;
                        location?: {
                            city?: string;
                            continent?: string;
                            coordinates?: { latitude: number; longitude: number };
                            country?: string;
                            countryCode?: string;
                            postalCode?: string;
                            region?: string;
                            regionCode?: string;
                            timezone?: string;
                        };
                        page?: {
                            path: string;
                            query: Record<string, string | string[]>;
                            referrer: string;
                            search: string;
                            title?: string;
                            url: string;
                            [key: string]: JSONType;
                        };
                        screen?: { name: string; [key: string]: JSONType };
                        userAgent?: string;
                    };
                    experienceId?: string;
                    hoverDurationMs: number;
                    hoverId: string;
                    messageId: string;
                    originalTimestamp: string;
                    sentAt: string;
                    timestamp: string;
                    type: "component_hover";
                    userId?: string;
                    variantIndex?: number;
                },
            optimizationContext?: EventOptimizationContext,
        ): Promise<void>;
    }
    Index

    Methods

    • Parameters

      • event:
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                entityId: string;
                entityKind: "Experience"
                | "ExperienceFragment";
                entityKindId?: string;
                entryIds?: string[];
                messageId: string;
                optimizationId?: string;
                originalTimestamp: string;
                parameters?: Record<string, JSONType>;
                parentExperienceId?: string;
                parentVariantId?: string;
                sentAt: string;
                timestamp: string;
                type: "exo_node_view";
                userId?: string;
                variantId?: string;
                variantIndex?: number;
                viewDurationMs: number;
                viewId: string;
            }
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                componentId: string;
                componentType?: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component";
                userId?: string;
                variantIndex?: number;
                viewDurationMs?: number;
                viewId?: string;
            }
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                componentId: string;
                componentType?: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component_click";
                userId?: string;
                variantIndex?: number;
            }
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                entityId: string;
                entityKind: "Experience"
                | "ExperienceFragment";
                entityKindId?: string;
                entryIds?: string[];
                messageId: string;
                optimizationId?: string;
                originalTimestamp: string;
                parameters?: Record<string, JSONType>;
                parentExperienceId?: string;
                parentVariantId?: string;
                sentAt: string;
                timestamp: string;
                type: "exo_node_click";
                userId?: string;
                variantId?: string;
                variantIndex?: number;
            }
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                entityId: string;
                entityKind: "Experience"
                | "ExperienceFragment";
                entityKindId?: string;
                entryIds?: string[];
                hoverDurationMs: number;
                hoverId: string;
                messageId: string;
                optimizationId?: string;
                originalTimestamp: string;
                parameters?: Record<string, JSONType>;
                parentExperienceId?: string;
                parentVariantId?: string;
                sentAt: string;
                timestamp: string;
                type: "exo_node_hover";
                userId?: string;
                variantId?: string;
                variantIndex?: number;
            }
            | {
                anonymousId?: string;
                channel: "server"
                | "mobile"
                | "web";
                componentId: string;
                componentType?: "Entry" | "Variable";
                context: {
                    app?: { name: string; version: string };
                    campaign: {
                        content?: string;
                        medium?: string;
                        name?: string;
                        source?: string;
                        term?: string;
                    };
                    gdpr?: { isConsentGiven: boolean };
                    library: { name: string; version: string };
                    locale?: string;
                    location?: {
                        city?: string;
                        continent?: string;
                        coordinates?: { latitude: number; longitude: number };
                        country?: string;
                        countryCode?: string;
                        postalCode?: string;
                        region?: string;
                        regionCode?: string;
                        timezone?: string;
                    };
                    page?: {
                        path: string;
                        query: Record<string, string | string[]>;
                        referrer: string;
                        search: string;
                        title?: string;
                        url: string;
                        [key: string]: JSONType;
                    };
                    screen?: { name: string; [key: string]: JSONType };
                    userAgent?: string;
                };
                experienceId?: string;
                hoverDurationMs: number;
                hoverId: string;
                messageId: string;
                originalTimestamp: string;
                sentAt: string;
                timestamp: string;
                type: "component_hover";
                userId?: string;
                variantIndex?: number;
            }
        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              entityId: string;
              entityKind: "Experience"
              | "ExperienceFragment";
              entityKindId?: string;
              entryIds?: string[];
              messageId: string;
              optimizationId?: string;
              originalTimestamp: string;
              parameters?: Record<string, JSONType>;
              parentExperienceId?: string;
              parentVariantId?: string;
              sentAt: string;
              timestamp: string;
              type: "exo_node_view";
              userId?: string;
              variantId?: string;
              variantIndex?: number;
              viewDurationMs: number;
              viewId: string;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • entityId: string

            Identifier of the rendered ExO entity.

          • entityKind: "Experience" | "ExperienceFragment"

            Kind of ExO entity represented by this event.

          • OptionalentityKindId?: string

            Optional identifier of the entity's concrete content kind.

          • OptionalentryIds?: string[]

            Contentful entry identifiers rendered by the entity.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • OptionaloptimizationId?: string

            Identifier of the optimization that selected the entity variant, when available.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • Optionalparameters?: Record<string, JSONType>

            Parameter values used to render the entity.

          • OptionalparentExperienceId?: string

            Identifier of the containing experience, when the entity is nested.

          • OptionalparentVariantId?: string

            Selected variant of the root experience, or default for its baseline. Omitted on the experience itself.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "exo_node_view"
          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantId?: string

            Identifier of the selected entity variant, when available.

          • OptionalvariantIndex?: number

            Index of the selected variant when available.

          • viewDurationMs: number
          • viewId: string
        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              componentId: string;
              componentType?: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component";
              userId?: string;
              variantIndex?: number;
              viewDurationMs?: number;
              viewId?: string;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • OptionalcomponentType?: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.

            Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions can occur outside of a specific experiment/personalization.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "component"

            Discriminator indicating that this is an entry or flag view event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantIndex?: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry. Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

          • OptionalviewDurationMs?: number

            Monotonically increasing visible duration for the active view.

            This value is updated and re-emitted while the same view remains active.

          • OptionalviewId?: string

            UUID identifying a single active view session.

            Multiple events emitted for the same active view share this identifier.

        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              componentId: string;
              componentType?: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component_click";
              userId?: string;
              variantIndex?: number;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • OptionalcomponentType?: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.

            Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions can occur outside of a specific experiment/personalization.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "component_click"

            Discriminator indicating that this is an entry click event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantIndex?: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry. Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              entityId: string;
              entityKind: "Experience"
              | "ExperienceFragment";
              entityKindId?: string;
              entryIds?: string[];
              messageId: string;
              optimizationId?: string;
              originalTimestamp: string;
              parameters?: Record<string, JSONType>;
              parentExperienceId?: string;
              parentVariantId?: string;
              sentAt: string;
              timestamp: string;
              type: "exo_node_click";
              userId?: string;
              variantId?: string;
              variantIndex?: number;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • entityId: string

            Identifier of the rendered ExO entity.

          • entityKind: "Experience" | "ExperienceFragment"

            Kind of ExO entity represented by this event.

          • OptionalentityKindId?: string

            Optional identifier of the entity's concrete content kind.

          • OptionalentryIds?: string[]

            Contentful entry identifiers rendered by the entity.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • OptionaloptimizationId?: string

            Identifier of the optimization that selected the entity variant, when available.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • Optionalparameters?: Record<string, JSONType>

            Parameter values used to render the entity.

          • OptionalparentExperienceId?: string

            Identifier of the containing experience, when the entity is nested.

          • OptionalparentVariantId?: string

            Selected variant of the root experience, or default for its baseline. Omitted on the experience itself.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "exo_node_click"
          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantId?: string

            Identifier of the selected entity variant, when available.

          • OptionalvariantIndex?: number

            Index of the selected variant when available.

        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              entityId: string;
              entityKind: "Experience"
              | "ExperienceFragment";
              entityKindId?: string;
              entryIds?: string[];
              hoverDurationMs: number;
              hoverId: string;
              messageId: string;
              optimizationId?: string;
              originalTimestamp: string;
              parameters?: Record<string, JSONType>;
              parentExperienceId?: string;
              parentVariantId?: string;
              sentAt: string;
              timestamp: string;
              type: "exo_node_hover";
              userId?: string;
              variantId?: string;
              variantIndex?: number;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • entityId: string

            Identifier of the rendered ExO entity.

          • entityKind: "Experience" | "ExperienceFragment"

            Kind of ExO entity represented by this event.

          • OptionalentityKindId?: string

            Optional identifier of the entity's concrete content kind.

          • OptionalentryIds?: string[]

            Contentful entry identifiers rendered by the entity.

          • hoverDurationMs: number
          • hoverId: string
          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • OptionaloptimizationId?: string

            Identifier of the optimization that selected the entity variant, when available.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • Optionalparameters?: Record<string, JSONType>

            Parameter values used to render the entity.

          • OptionalparentExperienceId?: string

            Identifier of the containing experience, when the entity is nested.

          • OptionalparentVariantId?: string

            Selected variant of the root experience, or default for its baseline. Omitted on the experience itself.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "exo_node_hover"
          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantId?: string

            Identifier of the selected entity variant, when available.

          • OptionalvariantIndex?: number

            Index of the selected variant when available.

        • {
              anonymousId?: string;
              channel: "server" | "mobile" | "web";
              componentId: string;
              componentType?: "Entry" | "Variable";
              context: {
                  app?: { name: string; version: string };
                  campaign: {
                      content?: string;
                      medium?: string;
                      name?: string;
                      source?: string;
                      term?: string;
                  };
                  gdpr?: { isConsentGiven: boolean };
                  library: { name: string; version: string };
                  locale?: string;
                  location?: {
                      city?: string;
                      continent?: string;
                      coordinates?: { latitude: number; longitude: number };
                      country?: string;
                      countryCode?: string;
                      postalCode?: string;
                      region?: string;
                      regionCode?: string;
                      timezone?: string;
                  };
                  page?: {
                      path: string;
                      query: Record<string, string | string[]>;
                      referrer: string;
                      search: string;
                      title?: string;
                      url: string;
                      [key: string]: JSONType;
                  };
                  screen?: { name: string; [key: string]: JSONType };
                  userAgent?: string;
              };
              experienceId?: string;
              hoverDurationMs: number;
              hoverId: string;
              messageId: string;
              originalTimestamp: string;
              sentAt: string;
              timestamp: string;
              type: "component_hover";
              userId?: string;
              variantIndex?: number;
          }
          • OptionalanonymousId?: string

            Anonymous identifier of the visitor, if the caller supplies one.

            Optional. The Experience API profile endpoints derive it from the request route, and batch ingestion requires it (see BatchExperienceEvent).

          • channel: "server" | "mobile" | "web"

            Channel from which the event originated.

          • componentId: string

            Contentful entry ID or flag key corresponding to the interaction.

          • OptionalcomponentType?: "Entry" | "Variable"

            Type of tracked optimization target for the interaction event.

            • 'Entry' — A content entry.
            • 'Variable' — A Custom Flag or other variable-backed optimization target.

            Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

          • context: {
                app?: { name: string; version: string };
                campaign: {
                    content?: string;
                    medium?: string;
                    name?: string;
                    source?: string;
                    term?: string;
                };
                gdpr?: { isConsentGiven: boolean };
                library: { name: string; version: string };
                locale?: string;
                location?: {
                    city?: string;
                    continent?: string;
                    coordinates?: { latitude: number; longitude: number };
                    country?: string;
                    countryCode?: string;
                    postalCode?: string;
                    region?: string;
                    regionCode?: string;
                    timezone?: string;
                };
                page?: {
                    path: string;
                    query: Record<string, string | string[]>;
                    referrer: string;
                    search: string;
                    title?: string;
                    url: string;
                    [key: string]: JSONType;
                };
                screen?: { name: string; [key: string]: JSONType };
                userAgent?: string;
            }

            Context object carrying environment and client metadata.

            • Optionalapp?: { name: string; version: string }

              Application-level metadata.

              • name: string

                Name of the application.

              • version: string

                Version of the application.

            • campaign: {
                  content?: string;
                  medium?: string;
                  name?: string;
                  source?: string;
                  term?: string;
              }

              Campaign attribution metadata.

              • Optionalcontent?: string

                Campaign content (e.g., utm_content).

              • Optionalmedium?: string

                Campaign medium (e.g., utm_medium).

              • Optionalname?: string

                Name of the campaign (e.g., utm_campaign).

              • Optionalsource?: string

                Campaign source (e.g., utm_source).

              • Optionalterm?: string

                Campaign term (e.g., utm_term).

            • Optionalgdpr?: { isConsentGiven: boolean }

              GDPR-related consent information.

              Optional and informational: the Experience and Insights APIs do not read it. Consent is enforced by the SDK before events are sent.

              • isConsentGiven: boolean

                Indicates whether the user has given consent.

            • library: { name: string; version: string }

              Analytics library metadata.

              • name: string

                Name of the SDK/library (e.g., "@contentful/optimization-web").

              • version: string

                Version of the analytics library.

            • Optionallocale?: string

              Locale identifier of the event (e.g., "en-US").

              "en-US"

            • Optionallocation?: {
                  city?: string;
                  continent?: string;
                  coordinates?: { latitude: number; longitude: number };
                  country?: string;
                  countryCode?: string;
                  postalCode?: string;
                  region?: string;
                  regionCode?: string;
                  timezone?: string;
              }

              Optional geo-location information associated with the event.

              • Optionalcity?: string

                City name associated with the location.

              • Optionalcontinent?: string

                Continent name associated with the location.

              • Optionalcoordinates?: { latitude: number; longitude: number }

                Geographical coordinates for the location.

                • latitude: number

                  Latitude component of the coordinates.

                • longitude: number

                  Longitude component of the coordinates.

              • Optionalcountry?: string

                Country name associated with the location.

              • OptionalcountryCode?: string

                Country code associated with the location.

                Validated to exactly COUNTRY_CODE_LENGTH characters, typically an ISO 3166-1 alpha-2 code.

              • OptionalpostalCode?: string

                Postal or ZIP code associated with the location.

              • Optionalregion?: string

                Region or state name associated with the location.

              • OptionalregionCode?: string

                Region or state code associated with the location.

              • Optionaltimezone?: string

                Time zone identifier associated with the location.

                Typically an IANA time zone string (e.g., "Europe/Berlin").

            • Optionalpage?: {
                  path: string;
                  query: Record<string, string | string[]>;
                  referrer: string;
                  search: string;
                  title?: string;
                  url: string;
                  [key: string]: JSONType;
              }
              • path: string

                Path component of the page URL (e.g., /products/123).

              • query: Record<string, string | string[]>

                Parsed query parameters for the page.

                Query

              • referrer: string

                Referrer URL that led to the current page.

              • search: string

                Raw search string including the leading ? (e.g., "?q=test").

              • Optionaltitle?: string

                Title of the page as seen by the user.

              • url: string

                Full URL of the page.

            • Optionalscreen?: { name: string; [key: string]: JSONType }
              • name: string

                Name or label for the screen.

            • OptionaluserAgent?: string

              User agent string of the client, if available.

          • OptionalexperienceId?: string

            Identifier of the experience that rendered this entry or flag.

            Optional; interactions can occur outside of a specific experiment/personalization.

          • hoverDurationMs: number

            Monotonically increasing hover duration for the active hover.

            This value is updated and re-emitted while the same hover remains active.

          • hoverId: string

            UUID identifying a single active hover session.

            Multiple events emitted for the same active hover share this identifier.

          • messageId: string

            Unique identifier for this message.

            Used to deduplicate events across retries and transports.

          • originalTimestamp: string

            Timestamp when the event originally occurred.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • sentAt: string

            Timestamp when the event payload was sent.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • timestamp: string

            Timestamp when the event was recorded or processed.

            Any date string the Experience API can parse; the SDK sends ISO 8601.

          • type: "component_hover"

            Discriminator indicating that this is an entry hover event.

          • OptionaluserId?: string

            Identifier of the authenticated user, if known.

          • OptionalvariantIndex?: number

            Index of the variant associated with this interaction.

            Typically corresponds to the index of the selected optimization entry. Optional in the schema, as the Experience and Insights APIs accept events without it. The SDK always sends it.

      • OptionaloptimizationContext: EventOptimizationContext

      Returns Promise<void>