0
Files
src/content/browser/renderer_host/navigation_metrics_utils.h
Yao Xiao e0cdf10718 Record UMA for ad click triggered main frame navigation
This makes it easier to analyze it in finch (compared to use counters)
The use counter is still kept, as it's recorded in UKM which could
still be useful.


Bug: 325293264
Change-Id: If1f3381f1a4da156a2f9955ebbfa38378b17ec2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296439
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263649}
2024-02-21 23:12:00 +00:00

28 lines
1.1 KiB
C++

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_
#define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_
#include "third_party/blink/public/mojom/navigation/navigation_initiator_activation_and_ad_status.mojom.h"
namespace content {
class RenderFrameHostImpl;
// Records the AdClickMainFrameNavigation use counter for `initiator_frame`, and
// records the Navigation.MainFrame.FromAdClick UMA, if
// `initiator_activation_and_ad_status` indicates that the navigation is from an
// ad click. Precondition: The navigation is targeting the outermost main frame.
// It's only necessary to call this function for renderer-initiated navigations,
// as browser-initiated navigations can never be initiated from ad.
void MaybeRecordAdClickMainFrameNavigationMetrics(
RenderFrameHostImpl* initiator_frame,
blink::mojom::NavigationInitiatorActivationAndAdStatus
initiator_activation_and_ad_status);
} // namespace content
#endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_METRICS_UTILS_H_