Contentful Personalization & Analytics
    Preparing search index...
    • Collect page-related properties from the current browser context.

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

      A Page object describing the current URL, dimensions and metadata. If an error occurs while reading from window or document, a minimal object with empty strings and no query parameters is returned.

      • [key: string]: JSONType
      • path: string

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

      • query: Record<string, string>

        Parsed query parameters for the page.

      • 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.

      const page = getPageProperties()
      optimization.page({ name: page.title, properties: page })