Commit a55ef6d7 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

Add UKM for Kaleidoscope navigations

Add a UKM to track navigations when a user clicks
on something in Kaleidoscope.

BUG=1110373

Doc:  https://docs.google.com/document/d/1RRF7XpUss7vr-qD4ckmOPyiQrfjQUTLip2YTDkXjchY/edit

Change-Id: Ib0afa41e997aec8cee9bcdc010030cc086a6fcff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441289
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818143}
parent 52ba50b2
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "chrome/browser/media/kaleidoscope/constants.h" #include "chrome/browser/media/kaleidoscope/constants.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_entry_builder.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/mojom/autoplay/autoplay.mojom.h" #include "third_party/blink/public/mojom/autoplay/autoplay.mojom.h"
...@@ -80,6 +83,15 @@ void KaleidoscopeTabHelper::ReadyToCommitNavigation( ...@@ -80,6 +83,15 @@ void KaleidoscopeTabHelper::ReadyToCommitNavigation(
if (IsOpenedFromKaleidoscope(handle)) { if (IsOpenedFromKaleidoscope(handle)) {
base::UmaHistogramEnumeration(kKaleidoscopeNavigationHistogramName, base::UmaHistogramEnumeration(kKaleidoscopeNavigationHistogramName,
KaleidoscopeNavigation::kNormal); KaleidoscopeNavigation::kNormal);
ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get();
if (!ukm_recorder)
return;
ukm::builders::Media_Kaleidoscope_Navigation(
handle->GetNextPageUkmSourceId())
.SetWasFromKaleidoscope(true)
.Record(ukm_recorder);
} }
} }
......
...@@ -6615,6 +6615,21 @@ be describing additional metrics about the same event. ...@@ -6615,6 +6615,21 @@ be describing additional metrics about the same event.
</metric> </metric>
</event> </event>
<event name="Media.Kaleidoscope.Navigation">
<owner>beccahughes@chromium.org</owner>
<owner>media-dev@chromium.org</owner>
<summary>
Kaleidoscope is a media recommendations feature in Chrome. This event is
recorded when a user selects a media recommendation and there is a
navigation to the new site from Kaleidoscope.
</summary>
<metric name="WasFromKaleidoscope">
<summary>
Whether the navigation was from Kaleiodscope.
</summary>
</metric>
</event>
<event name="Media.Learning.PredictionRecord"> <event name="Media.Learning.PredictionRecord">
<owner>liberato@chromium.org</owner> <owner>liberato@chromium.org</owner>
<summary> <summary>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment