chromium/components/segmentation_platform/public/constants.h

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

#ifndef COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_
#define COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_

#include <string>

#include "components/segmentation_platform/public/proto/output_config.pb.h"
#include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"

namespace segmentation_platform {

// SEGMENTATION_CLIENT_KEYS_BEGIN

// The key to be used for adaptive toolbar feature.
const char kAdaptiveToolbarSegmentationKey[] =;
const char kAdaptiveToolbarUmaName[] =;

// The key is used to decide whether a user has low user engagement with chrome.
// This is a generic model that can be used by multiple features targeting
// low-engaged users. Typically low engaged users are active in chrome below a
// certain threshold number of days over a time period. This is computed using
// Session.TotalDuration histogram.
const char kChromeLowUserEngagementSegmentationKey[] =;
const char kChromeLowUserEngagementUmaName[] =;

// The key is used to decide whether the user likes to use Feed.
const char kFeedUserSegmentationKey[] =;
const char kFeedUserSegmentUmaName[] =;

// The key is used to decide whether the user is interested in shopping or not.
const char kShoppingUserSegmentationKey[] =;
const char kShoppingUserUmaName[] =;

// The key is used to show a contextual page action.
const char kContextualPageActionsKey[] =;
const char kContextualPageActionsUmaName[] =;

// Determine search users of the browser app.
const char kSearchUserKey[] =;
const char kSearchUserUmaName[] =;

// Determine power users of the browser app.
const char kPowerUserKey[] =;
const char kPowerUserUmaName[] =;

// The key is used to decide whether the user is active on multiple synced
// devices.
const char kCrossDeviceUserKey[] =;
const char kCrossDeviceUserUmaName[] =;

// Keys related to users of chrome features.
const char kFrequentFeatureUserKey[] =;
const char kFrequentFeatureUserUmaName[] =;

// This key is used to decide whether the user uses Chrome intentionally.
const char kIntentionalUserKey[] =;
const char kIntentionalUserUmaName[] =;

// Key for user segment that is more likely to use resume features in chrome.
const char kResumeHeavyUserKey[] =;
const char kResumeHeavyUserUmaName[] =;

// Key for user segment that is likely switched from Chrome on other devices.
const char kDeviceSwitcherKey[] =;
const char kDeviceSwitcherUmaName[] =;

// The key is used to decide whether the user is categorised as tablet
// productivity or not.
const char kTabletProductivityUserKey[] =;
const char kTabletProductivityUserUmaName[] =;

// The key is used to decide whether the user should receive a web app
// installation promotion.
const char kWebAppInstallationPromoKey[] =;
const char kWebAppInstallationPromoUmaName[] =;

const char kPasswordManagerUserKey[] =;
const char kPasswordManagerUserUmaName[] =;

// Key for segment that tells in which tier the device used by the user belongs.
const char kDeviceTierKey[] =;
const char kDeviceTierUmaName[] =;

const char kTabResumptionClassifierKey[] =;
const char kTabResumptionClassifierUmaName[] =;

// The key is used to rank `URLVisitAggregate` objects leveraged by UI tab
// resumption features.
const char kURLVisitResumptionRankerKey[] =;
const char kURLVisitResumptionRankerUmaName[] =;

const char kIosModuleRankerKey[] =;
const char kIosModuleRankerUmaName[] =;

const char kAndroidHomeModuleRankerKey[] =;
const char kAndroidHomeModuleRankerUmaName[] =;

// This key is used to decide what modules a user should see on their Desktop
// New Tab Page.
const char kDesktopNtpModuleKey[] =;
const char kDesktopNtpModuleUmaName[] =;

const char kOptimizationTargetSegmentationDummyKey[] =;
const char kOptimizationTargetSegmentationDummyUmaName[] =;

const char kComposePromotionKey[] =;
const char kComposePromotionUmaName[] =;

const char kEphemeralHomeModuleBackendKey[] =;

// SEGMENTATION_CLIENT_KEYS_END

// Please keep the UMA names for keys in sync with SegmentationKey variant in
// //tools/metrics/histograms/metadata/segmentation_platform/histograms.xml.
// Should also update the field trials allowlist in
// go/segmentation-field-trials-map.

// Config parameter name specified in experiment configs. Any experiment config
// or feature can include this param and segmentation will enable the config for
// storing cached results.
const char kSegmentationConfigParamName[] =;

// Parameter names used for defining segmentation config.
// TODO(ssid): These should be deprecated and clients should use
// `kSegmentationConfigParamName` to define config instead.
constexpr char kDefaultModelEnabledParam[] =;
constexpr char kVariationsParamNameSegmentSelectionTTLDays[] =;
constexpr char kVariationsParamNameUnknownSelectionTTLDays[] =;

const char kSubsegmentDiscreteMappingSuffix[] =;

// Returns an UMA histogram variant for the given segment_id.
// TODO(ssid): Move this to stats.cc since, no need to be in public.
std::string SegmentIdToHistogramVariant(proto::SegmentId segment_id);

// Returns Subsegment key for the given `segmentation_key`.
std::string GetSubsegmentKey(const std::string& segmentation_key);

// TODO(shaktisahu): Move these to a nicer location.

// Legacy label used for users not in the segment for binary user segment
// classifier.
const char kLegacyNegativeLabel[] =;

// Labels for adaptive toolbar model.
const char kAdaptiveToolbarModelLabelNewTab[] =;
const char kAdaptiveToolbarModelLabelShare[] =;
const char kAdaptiveToolbarModelLabelVoice[] =;
const char kAdaptiveToolbarModelLabelTranslate[] =;
const char kAdaptiveToolbarModelLabelAddToBookmarks[] =;
const char kAdaptiveToolbarModelLabelReadAloud[] =;

// Labels for contextual page actions model.
const char kContextualPageActionModelLabelPriceTracking[] =;
const char kContextualPageActionModelLabelReaderMode[] =;
const char kContextualPageActionModelLabelPriceInsights[] =;

// Labels for cross device segment.
const char kNoCrossDeviceUsage[] =;
const char kCrossDeviceMobile[] =;
const char kCrossDeviceDesktop[] =;
const char kCrossDeviceTablet[] =;
const char kCrossDeviceMobileAndDesktop[] =;
const char kCrossDeviceMobileAndTablet[] =;
const char kCrossDeviceDesktopAndTablet[] =;
const char kCrossDeviceAllDeviceTypes[] =;
const char kCrossDeviceOther[] =;

// Labels for search user model.
// Any updates to these strings need to also update the field trials allowlist
// in go/segmentation-field-trials-map.
const char kSearchUserModelLabelNone[] =;
const char kSearchUserModelLabelLow[] =;
const char kSearchUserModelLabelMedium[] =;
const char kSearchUserModelLabelHigh[] =;

// Labels for device tier model.
// Any updates to these strings need to also update the field trials allowlist
// in go/segmentation-field-trials-map.
const char kDeviceTierSegmentLabelNone[] =;
const char kDeviceTierSegmentLabelLow[] =;
const char kDeviceTierSegmentLabelMedium[] =;
const char kDeviceTierSegmentLabelHigh[] =;

// Labels for tablet productivity user model.
// Any updates to these strings need to also update the field trials allowlist
// in go/segmentation-field-trials-map.
const char kTabletProductivityUserModelLabelNone[] =;
const char kTabletProductivityUserModelLabelMedium[] =;
const char kTabletProductivityUserModelLabelHigh[] =;

// Labels for Android Home modules for ranking.
const char kSingleTab[] =;
const char kPriceChange[] =;
const char kTabResumptionForAndroidHome[] =;
const char kSafetyHub[] =;

// Input Context keys for freshness for Android Home modules.
const char kSingleTabFreshness[] =;
const char kPriceChangeFreshness[] =;
const char kTabResumptionForAndroidHomeFreshness[] =;
const char kSafetyHubFreshness[] =;

// Labels for IOS modules for ranking.
const char kMostVisitedTiles[] =;
const char kShortcuts[] =;
const char kSafetyCheck[] =;
const char kTabResumption[] =;
const char kParcelTracking[] =;
const char kPriceTrackingPromo[] =;

// Input Context keys for freshness for IOS modules.
const char kMostVisitedTilesFreshness[] =;
const char kShortcutsFreshness[] =;
const char kSafetyCheckFreshness[] =;
const char kTabResumptionFreshness[] =;
const char kParcelTrackingFreshness[] =;
const char kIsShowingStartSurface[] =;

// Labels for desktop new tab page drive module model.
// Any updates to these strings need to also update the field trials allowlist
// in go/segmentation-field-trials-map.
const char kDesktopNtpDriveModuleLabelShow[] =;
const char kDesktopNtpDriveModuleLabelDontShow[] =;

// Custom inputs for contextual page actions model.
const char kContextualPageActionModelInputPriceTracking[] =;
const char kContextualPageActionModelInputReaderMode[] =;
const char kContextualPageActionModelInputPriceInsights[] =;

const char kComposePrmotionLabelShow[] =;
const char kComposePrmotionLabelDontShow[] =;

// Finch parameter key for sampling rate of the model execution results.
constexpr char kModelExecutionSamplingRateKey[] =;

// Finch parameter key for introducing delay(in ms) in model initialization at
// startup.
constexpr char kModelInitializationDelay[] =;

}  // namespace segmentation_platform

#endif  // COMPONENTS_SEGMENTATION_PLATFORM_PUBLIC_CONSTANTS_H_