<!--
Copyright 2025 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
This file is used to generate a comprehensive list of
content_extraction histograms along with a detailed description for each
histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<variants name="ContextualCueingCueType">
  <variant name="" summary="All cues"/>
  <variant name=".Dynamic" summary="Cues that are contextual to the page"/>
  <variant name=".Static" summary="Static cues"/>
</variants>

<variants name="ContextualCueingGlicSuggestionsEngagementType">
  <variant name="" summary="All requests"/>
  <variant name=".FRE" summary="When suggestions are fetched for the FRE"/>
  <variant name=".Reengagement"
      summary="When suggestions are fetched for reengagement"/>
</variants>

<!-- LINT.IfChange(OptType) -->

<variants name="ContextualCueingOptimizationType">
  <variant name="GlicContextualCueing" summary="Contextual cueing for Glic"/>
</variants>

<!-- LINT.ThenChange(//chrome/browser/contextual_cueing/contextual_cueing_helper.cc:OptType) -->

<histogram name="ContextualCueing.GlicAutoOpen.Result"
    enum="GlicAutoOpenResult" expires_after="2027-01-17">
  <owner>sanaakbani@google.com</owner>
  <owner>sophiechang@chromium.org</owner>
  <summary>
    Recorded when the glic side panel is triggered to auto-open. Records the
    outcome (success, or specific failure reasons).
  </summary>
</histogram>

<histogram
    name="ContextualCueing.GlicSuggestions.FocusedTabEligibleForSuggestions"
    enum="Boolean" expires_after="2027-01-17">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    Recorded every time a request for suggestions for focused tab is requested.
    Records whether the page type of the focused tab is eligible for contextual
    suggestions.
  </summary>
</histogram>

<histogram name="ContextualCueing.GlicSuggestions.MesFetchLatency" units="ms"
    expires_after="2027-02-07">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    Recorded every time a suggestion response is received from Model Execution
    Service. Records the amount of time it takes to receive the response, from
    when the corresponding suggestion request is sent.
  </summary>
</histogram>

<histogram
    name="ContextualCueing.GlicSuggestions.PageContextFetchlatency.{PageContextType}"
    units="ms" expires_after="2027-02-07">
  <owner>zekunjiang@google.com</owner>
  <owner>rajendrant@google.com</owner>
  <owner>sophiechang@chromium.org</owner>
  <summary>
    Recorded every time a page context extraction is completed. Records the time
    it takes from the beginning of a context fetch to when the results are
    received. The results are split by page context types (e.g. InnerText vs.
    AnnotatedPageContent).
  </summary>
  <token key="PageContextType">
    <variant name="AnnotatedPageContent"
        summary="Page context in the form of annotated page content"/>
    <variant name="InnerText"
        summary="Page context in the form of page inner text."/>
    <variant name="Total"
        summary="All page contexts that are related to one zero state
                 suggestions fetch."/>
  </token>
</histogram>

<histogram
    name="ContextualCueing.GlicSuggestions.PageContextIneligibilityReason{EngagementType}"
    enum="ContextualCueingZeroStateSuggestionsPageContextIneligibilityType"
    expires_after="2026-11-29">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    Recorded every time a request for Glic suggestions is made. Records the
    reason for why the page context for the request may have been ineligible.
    The histogram is split by engagement type (FRE v. reengagement).
  </summary>
  <token key="EngagementType"
      variants="ContextualCueingGlicSuggestionsEngagementType"/>
</histogram>

<histogram
    name="ContextualCueing.GlicSuggestions.PinnedTabsEligibleForSuggestions"
    enum="Boolean" expires_after="2026-12-27">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    Recorded every time a request for suggestions for pinned tabs is requested.
    Records whether the request is eligible for contextual suggestions based on
    the page types of all pinned tabs.
  </summary>
</histogram>

<histogram
    name="ContextualCueing.GlicSuggestions.SuggestionsFetchLatency.{ResultType}{EngagementType}"
    units="ms" expires_after="2027-02-07">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    Recorded every time something is returned as a result of invoking the
    suggestions fetch API. The results are split by the type of results returned
    (e.g. results with no suggestions vs results with valid suggestions) and
    engagement type (FRE v reengagement).
  </summary>
  <token key="ResultType">
    <variant name="EmptySuggestions"
        summary="When no suggestions are returned as a result of a
                 suggestions fetch"/>
    <variant name="ValidSuggestions"
        summary="When valid suggestions are returned as a result of a
                 suggestions fetch"/>
  </token>
  <token key="EngagementType"
      variants="ContextualCueingGlicSuggestionsEngagementType"/>
</histogram>

<histogram
    name="ContextualCueing.NudgeDecision.{ContextualCueingOptimizationType}"
    enum="ContextualCueingNudgeDecision" expires_after="2027-01-31">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    The nudge decision for {ContextualCueingOptimizationType}. Recorded once per
    page load when the document has loaded.
  </summary>
  <token key="ContextualCueingOptimizationType"
      variants="ContextualCueingOptimizationType"/>
</histogram>

<histogram name="ContextualCueing.NudgeInteraction{CueType}"
    enum="ContextualCueingNudgeInteraction" expires_after="2027-01-31">
  <owner>sophiechang@chromium.org</owner>
  <owner>zekunjiang@google.com</owner>
  <summary>
    The user interaction for a Contextual Cueing Nudge. Recorded when a user is
    shown or interacts with a contextual nudge.
  </summary>
  <token key="CueType" variants="ContextualCueingCueType"/>
</histogram>

<histogram name="ContextualCueing.V2.ChipClicked.CollapsedDuration" units="ms"
    expires_after="2027-01-24">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    The duration from when the contextual cueing anchored message collapsed into
    the omnibox chip/icon until the user clicked the chip to expand it. Recorded
    when the user clicks the omnibox chip.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.CueFormFactor.Hidden" enum="CueFormFactor"
    expires_after="2027-02-14">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    The form factor of a contextual cue that was hidden. Recorded when a cue's
    icon, chip, or anchored message is hidden.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.CueFormFactor.Shown" enum="CueFormFactor"
    expires_after="2027-01-17">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    The form factor of a contextual cue that was shown. Recorded when a cue's
    icon, chip, or anchored message is shown.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.CueInteraction"
    enum="ContextualCueingInteraction" expires_after="2027-01-24">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    The user interaction for a Contextual Cueing V2 cue. Recorded when a user
    interacts with a contextual cue.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.CueInteraction.{InteractionType}"
    units="hash" expires_after="2027-02-07">
  <owner>sophiechang@chromium.org</owner>
  <owner>pulkitaga@google.com</owner>
  <summary>
    The hashed string of the CUJ for a contextual cue. Recorded when the
    contextual cue is {InteractionType}.
  </summary>
  <token key="InteractionType">
    <variant name="Clicked" summary="clicked"/>
    <variant name="Dismissed"
        summary="user opened 3 dot menu and clicked dismiss"/>
    <variant name="EditPrompt"
        summary="user opened 3 dot menu and clicked to edit the prompt"/>
    <variant name="Settings"
        summary="user opened 3 dot menu and clicked to go to settings"/>
  </token>
</histogram>

<histogram name="ContextualCueing.V2.CueShown" units="hash"
    expires_after="2027-02-07">
  <owner>sophiechang@chromium.org</owner>
  <owner>pulkitaga@google.com</owner>
  <summary>
    The hashed string of the CUJ for a contextual cue. Recorded when the
    contextual cue is shown to the user.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.CueShownLatency" units="ms"
    expires_after="2026-12-20">
  <owner>sophiechang@chromium.org</owner>
  <owner>pulkitaga@google.com</owner>
  <summary>
    The latency between the navigation committing and when the contextual cue is
    shown. Recorded when the contextual cue is shown to the user.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.Decision" enum="ContextualCueingDecision"
    expires_after="2027-01-17">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    The decision for generating a contextual cue for the page in the V2
    framework. Recorded once per page load.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.MissingFaviconCount" units="count"
    expires_after="2027-02-14">
  <owner>sophiechang@chromium.org</owner>
  <owner>iwells@chromium.org</owner>
  <summary>
    Records the number of tabs for which no favicon could be found and the
    default favicon was used in the tab sharing UI. Recorded when the cue is
    shown with the tab sharing UI.
  </summary>
</histogram>

<histogram name="ContextualCueing.V2.Orchestrator.WinnerTarget"
    enum="CueTargetType" expires_after="2027-06-01">
  <owner>benedictwong@google.com</owner>
  <owner>sophiechang@chromium.org</owner>
  <summary>
    Recorded when the Contextual Cueing Orchestrator selects a winning CueTarget
    to execute. It tracks the target type that won the UCB scoring evaluation
    for the current page load.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
