Commit 91a64d28 authored by noamsml@chromium.org's avatar noamsml@chromium.org

UMA Histograms for Register Promos

Add UMA histograms for register promos.

BUG=350228

Review URL: https://codereview.chromium.org/189623004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255827 0039d316-1c4b-4281-b951-d872f2087c98
parent 0cc39c06
......@@ -46,7 +46,11 @@ cr.define('print_preview', function() {
PRIVET_DUPLICATE_SELECTED: 5,
// Used when a user selects the cloud printer in a pair of duplicate
// privet and cloud printers.
CLOUD_DUPLICATE_SELECTED: 6
CLOUD_DUPLICATE_SELECTED: 6,
// Used when a user sees a register promo for a cloud print printer.
REGISTER_PROMO_SHOWN: 7,
// Used when a user selects a register promo for a cloud print printer.
REGISTER_PROMO_SELECTED: 8
};
/**
......
......@@ -722,6 +722,8 @@ cr.define('print_preview', function() {
* @private
*/
onCloudPrintRegisterPromoClick_: function(e) {
this.metrics_.incrementDestinationSearchBucket(
print_preview.Metrics.DestinationSearchBucket.REGISTER_PROMO_SELECTED);
var devicesUrl = 'chrome://devices/register?id=' + e.destination.id;
this.nativeLayer_.startForceOpenNewTab(devicesUrl);
this.destinationStore_.waitForRegister(e.destination.id);
......
......@@ -42,6 +42,14 @@ cr.define('print_preview', function() {
*/
this.metrics_ = metrics;
/**
* Whether or not a UMA histogram for the register promo being shown was
* already recorded.
* @type {bool}
* @private
*/
this.registerPromoShownMetricRecorded_ = false;
/**
* Search box used to search through the destination lists.
* @type {!print_preview.SearchBox}
......@@ -322,6 +330,13 @@ cr.define('print_preview', function() {
}
});
if (unregisteredCloudDestinations.length != 0 &&
!this.registerPromoShownMetricRecorded_) {
this.metrics_.incrementDestinationSearchBucket(
print_preview.Metrics.DestinationSearchBucket.REGISTER_PROMO_SHOWN);
this.registerPromoShownMetricRecorded_ = true;
}
var finalCloudDestinations = unregisteredCloudDestinations.slice(
0, DestinationSearch.MAX_PROMOTED_UNREGISTERED_PRINTERS_).concat(
cloudDestinations,
......
......@@ -127,6 +127,8 @@ enum PrintDestinationBuckets {
SIGNIN_TRIGGERED,
PRIVET_DUPLICATE_SELECTED,
CLOUD_DUPLICATE_SELECTED,
REGISTER_PROMO_SHOWN,
REGISTER_PROMO_SELECTED,
PRINT_DESTINATION_BUCKET_BOUNDARY
};
......
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