New issue
Advanced search Search tips

Issue 803544 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Task

Blocking:
issue 803501
issue 803540



Sign in to add a comment

EV Study: Add site engagement metrics

Project Member Reported by cthomp@chromium.org, Jan 18 2018

Issue description

For our EV UI removal study (issue 803138) we would like to track site engagement scores via both UMA and UKM.

When a user navigates away from an EV page, we want to track:

- The current Site Engagement score for the site
- The change in Site Engagement score between navigating to the site and navigating away from the site

Likely the simplest way to implement this is to add it to the WebContentsObserver we need to implement for  issue 803540 .

Roughly, to get site engagement:

#include "chrome/browser/engagement/site_engagement_service.h"
double GetSiteEngagement(Profile* profile, GURL& origin) {
  SiteEngagementService* service = SiteEngagementService::Get(profile);
  return service ? service->GetScore(origin) : 0;
}
 

Comment 1 by cthomp@chromium.org, Jan 26 2018

Status: Started (was: Assigned)
Labels: -Restrict-View-Google

Comment 3 by cthomp@chromium.org, Feb 13 2018

Blockedon: -803540

Comment 4 by cthomp@chromium.org, Feb 13 2018

Blocking: 803540
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b49d5340cb51ba1cf5c2914a8df6bd6161045f98

commit b49d5340cb51ba1cf5c2914a8df6bd6161045f98
Author: Christopher Thompson <cthomp@chromium.org>
Date: Wed Feb 21 00:12:00 2018

Track Site Engagement scores by SecurityLevel

Adds a new PageLoadMetricsObserver to track the Site Engagement score
for a visit to a site, separated by SecurityLevel. Adds UMA collection
for the final score and the change in the score between the page
committing and leaving the page, in a separate histogram for each
security level.

Additionally, adds UKM collection for the initial score, the final
score, the initial security level, and the final security level of the
page, collected on leaving the page.

These will be used for a study of reducing the HTTPS indicator UI in
the location bar.

Bug:  803544 
Change-Id: Icf3500e9c0c6d8b546da9e4544cb2d36a1a3fd50
Reviewed-on: https://chromium-review.googlesource.com/902666
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537947}
[modify] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/browser/BUILD.gn
[add] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.cc
[add] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.h
[add] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer_browsertest.cc
[modify] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
[modify] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/chrome/test/BUILD.gn
[modify] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/tools/metrics/histograms/histograms.xml
[modify] https://crrev.com/b49d5340cb51ba1cf5c2914a8df6bd6161045f98/tools/metrics/ukm/ukm.xml

Comment 6 by cthomp@chromium.org, Feb 21 2018

Status: Fixed (was: Started)
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/817c9d221b26d0aae291ba5afac469c0f79413b0

commit 817c9d221b26d0aae291ba5afac469c0f79413b0
Author: Christopher Thompson <cthomp@chromium.org>
Date: Mon Mar 05 18:22:20 2018

Broaden scope of SiteEngagement UKM

This relaxes the UKM collection for SiteEngagement data to include all
security levels rather than just EV_SECURE and SECURE.

Bug:  803544 
Change-Id: I02d63463d3d8cf69ab4267fa7201cdf33473cad9
Reviewed-on: https://chromium-review.googlesource.com/939528
Reviewed-by: Bryan McQuade <bmcquade@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540873}
[modify] https://crrev.com/817c9d221b26d0aae291ba5afac469c0f79413b0/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.cc
[modify] https://crrev.com/817c9d221b26d0aae291ba5afac469c0f79413b0/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer_browsertest.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Mar 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f1b371d803b8a5131cb6822221d686b327382108

commit f1b371d803b8a5131cb6822221d686b327382108
Author: Christopher Thompson <cthomp@chromium.org>
Date: Mon Mar 05 21:23:38 2018

Add coarse score to site engagement UKM

This adds to the SiteEngagement UKM collection to track the final
engagement score, rounded down to the nearest multiple of 10 to reduce
the granularity of the collection.

Additionally adds a new metrics utility function to perform linear
bucketing (similar to the existing exponential bucketing function).

Bug:  803544 
Change-Id: I1c3031e94d4cce28995ab53095c6a4df3e39f65e
Reviewed-on: https://chromium-review.googlesource.com/939876
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Reviewed-by: Bryan McQuade <bmcquade@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540943}
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.cc
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/services/BUILD.gn
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/services/metrics/public/cpp/BUILD.gn
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/services/metrics/public/cpp/metrics_utils.cc
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/services/metrics/public/cpp/metrics_utils.h
[add] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/services/metrics/public/cpp/metrics_utils_unittest.cc
[modify] https://crrev.com/f1b371d803b8a5131cb6822221d686b327382108/tools/metrics/ukm/ukm.xml

After #7 and #8 have been on canary for 24 hrs, we'll need to merge them back to M66, right? (landed after branch point?) Chris, is there any way to roughly verify that the changes are working on Canary (e.g. check the value shows up as expected in chrome://histograms)?
Cc: est...@chromium.org
Yes there will be four CLs in total that need merging (the two here for site engagement collection), one for the downloads UMA (https://crrev.com/c/935369), and one for a small fix to histograms.xml (https://crrev.com/c/949608).

To manually verify the fixes here:
- For #7, visits to HTTP pages should now trigger new entries in the Security.SiteEngagement.NONE or Securitty.SiteEngagement.HTTP_SHOW_WARNING histograms in chrome://histograms/
- For #8, launch canary with the '--force-enable-metrics-reporting' flag (to enable UKM collection) and visit a page (load the tab and then close it). A new entry for the site should appear in chrome://ukm/, and the entry should contain a ScoreFinal field.

I'll add manual verification steps for the other two CLs to their issue comments.
Ok, great, thanks. Can you verify those fixes once they land on Canary and then add the Merge-Request-66 label to this bug?
Labels: Merge-Request-66
Verified on Canary as described in #11. Requesting a merge for the commits in #7 and #8; these are small metrics changes needed for an M66 experiment. They are covered by automated tests and I've verified them on Canary.
Labels: -Merge-Request-66 Merge-Approved-66
Approving merge to M66. Branch:3359
Project Member

Comment 15 by bugdroid1@chromium.org, Mar 14 2018

Labels: -merge-approved-66 merge-merged-3359
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f83a8aacae6cb4f256dda6ab0273cbbb7dfef68d

commit f83a8aacae6cb4f256dda6ab0273cbbb7dfef68d
Author: Christopher Thompson <cthomp@chromium.org>
Date: Wed Mar 14 20:01:00 2018

Broaden scope of SiteEngagement UKM

This relaxes the UKM collection for SiteEngagement data to include all
security levels rather than just EV_SECURE and SECURE.

Bug:  803544 
Change-Id: I02d63463d3d8cf69ab4267fa7201cdf33473cad9
Reviewed-on: https://chromium-review.googlesource.com/939528
Reviewed-by: Bryan McQuade <bmcquade@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#540873}(cherry picked from commit 817c9d221b26d0aae291ba5afac469c0f79413b0)
Reviewed-on: https://chromium-review.googlesource.com/963164
Reviewed-by: Emily Stark <estark@chromium.org>
Cr-Commit-Position: refs/branch-heads/3359@{#241}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/f83a8aacae6cb4f256dda6ab0273cbbb7dfef68d/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.cc
[modify] https://crrev.com/f83a8aacae6cb4f256dda6ab0273cbbb7dfef68d/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer_browsertest.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/500099a66c9d7a2b9a9991372557350c81de00c5

commit 500099a66c9d7a2b9a9991372557350c81de00c5
Author: Christopher Thompson <cthomp@chromium.org>
Date: Wed Mar 14 20:01:56 2018

Add coarse score to site engagement UKM

This adds to the SiteEngagement UKM collection to track the final
engagement score, rounded down to the nearest multiple of 10 to reduce
the granularity of the collection.

Additionally adds a new metrics utility function to perform linear
bucketing (similar to the existing exponential bucketing function).

Bug:  803544 
Change-Id: I1c3031e94d4cce28995ab53095c6a4df3e39f65e
Reviewed-on: https://chromium-review.googlesource.com/939876
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Reviewed-by: Bryan McQuade <bmcquade@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#540943}(cherry picked from commit f1b371d803b8a5131cb6822221d686b327382108)
Reviewed-on: https://chromium-review.googlesource.com/963165
Reviewed-by: Emily Stark <estark@chromium.org>
Cr-Commit-Position: refs/branch-heads/3359@{#242}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/chrome/browser/page_load_metrics/observers/security_state_page_load_metrics_observer.cc
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/services/BUILD.gn
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/services/metrics/public/cpp/BUILD.gn
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/services/metrics/public/cpp/metrics_utils.cc
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/services/metrics/public/cpp/metrics_utils.h
[add] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/services/metrics/public/cpp/metrics_utils_unittest.cc
[modify] https://crrev.com/500099a66c9d7a2b9a9991372557350c81de00c5/tools/metrics/ukm/ukm.xml

Sign in to add a comment