// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.ads.googleads.v3.common;

import "google/ads/googleads/v3/enums/interaction_event_type.proto";
import "google/ads/googleads/v3/enums/quality_score_bucket.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V3.Common";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v3/common;common";
option java_multiple_files = true;
option java_outer_classname = "MetricsProto";
option java_package = "com.google.ads.googleads.v3.common";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V3\\Common";
option ruby_package = "Google::Ads::GoogleAds::V3::Common";

// Proto file describing metrics.

// Metrics data.
message Metrics {
  // The percent of your ad impressions that are shown as the very first ad
  // above the organic search results.
  google.protobuf.DoubleValue absolute_top_impression_percentage = 95;

  // Average cost of viewable impressions (`active_view_impressions`).
  google.protobuf.DoubleValue active_view_cpm = 1;

  // Active view measurable clicks divided by active view viewable impressions.
  // This metric is reported only for display network.
  google.protobuf.DoubleValue active_view_ctr = 79;

  // A measurement of how often your ad has become viewable on a Display
  // Network site.
  google.protobuf.Int64Value active_view_impressions = 2;

  // The ratio of impressions that could be measured by Active View over the
  // number of served impressions.
  google.protobuf.DoubleValue active_view_measurability = 96;

  // The cost of the impressions you received that were measurable by Active
  // View.
  google.protobuf.Int64Value active_view_measurable_cost_micros = 3;

  // The number of times your ads are appearing on placements in positions
  // where they can be seen.
  google.protobuf.Int64Value active_view_measurable_impressions = 4;

  // The percentage of time when your ad appeared on an Active View enabled site
  // (measurable impressions) and was viewable (viewable impressions).
  google.protobuf.DoubleValue active_view_viewability = 97;

  // All conversions from interactions (as oppose to view through conversions)
  // divided by the number of ad interactions.
  google.protobuf.DoubleValue all_conversions_from_interactions_rate = 65;

  // The value of all conversions.
  google.protobuf.DoubleValue all_conversions_value = 66;

  // The total number of conversions. This includes all conversions regardless
  // of the value of include_in_conversions_metric.
  google.protobuf.DoubleValue all_conversions = 7;

  // The value of all conversions divided by the total cost of ad interactions
  // (such as clicks for text ads or views for video ads).
  google.protobuf.DoubleValue all_conversions_value_per_cost = 62;

  // The number of times people clicked the "Call" button to call a store during
  // or after clicking an ad. This number doesn't include whether or not calls
  // were connected, or the duration of any calls.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_click_to_call = 118;

  // The number of times people clicked a "Get directions" button to navigate to
  // a store after clicking an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_directions = 119;

  // The value of all conversions from interactions divided by the total number
  // of interactions.
  google.protobuf.DoubleValue all_conversions_from_interactions_value_per_interaction = 67;

  // The number of times people clicked a link to view a store's menu after
  // clicking an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_menu = 120;

  // The number of times people placed an order at a store after clicking an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_order = 121;

  // The number of other conversions (for example, posting a review or saving a
  // location for a store) that occurred after people clicked an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_other_engagement = 122;

  // Estimated number of times people visited a store after clicking an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_store_visit = 123;

  // The number of times that people were taken to a store's URL after clicking
  // an ad.
  // This metric applies to feed items only.
  google.protobuf.DoubleValue all_conversions_from_store_website = 124;

  // The average amount you pay per interaction. This amount is the total cost
  // of your ads divided by the total number of interactions.
  google.protobuf.DoubleValue average_cost = 8;

  // The total cost of all clicks divided by the total number of clicks
  // received.
  google.protobuf.DoubleValue average_cpc = 9;

  // The average amount that you've been charged for an ad engagement. This
  // amount is the total cost of all ad engagements divided by the total number
  // of ad engagements.
  google.protobuf.DoubleValue average_cpe = 98;

  // Average cost-per-thousand impressions (CPM).
  google.protobuf.DoubleValue average_cpm = 10;

  // The average amount you pay each time someone views your ad.
  // The average CPV is defined by the total cost of all ad views divided by
  // the number of views.
  google.protobuf.DoubleValue average_cpv = 11;

  // Average number of pages viewed per session.
  google.protobuf.DoubleValue average_page_views = 99;

  // Total duration of all sessions (in seconds) / number of sessions. Imported
  // from Google Analytics.
  google.protobuf.DoubleValue average_time_on_site = 84;

  // An indication of how other advertisers are bidding on similar products.
  google.protobuf.DoubleValue benchmark_average_max_cpc = 14;

  // An indication on how other advertisers' Shopping ads for similar products
  // are performing based on how often people who see their ad click on it.
  google.protobuf.DoubleValue benchmark_ctr = 77;

  // Percentage of clicks where the user only visited a single page on your
  // site. Imported from Google Analytics.
  google.protobuf.DoubleValue bounce_rate = 15;

  // The number of clicks.
  google.protobuf.Int64Value clicks = 19;

  // The number of times your ad or your site's listing in the unpaid
  // results was clicked. See the help page at
  // https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.Int64Value combined_clicks = 115;

  // The number of times your ad or your site's listing in the unpaid
  // results was clicked (combined_clicks) divided by combined_queries. See the
  // help page at https://support.google.com/google-ads/answer/3097241 for
  // details.
  google.protobuf.DoubleValue combined_clicks_per_query = 116;

  // The number of searches that returned pages from your site in the unpaid
  // results or showed one of your text ads. See the help page at
  // https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.Int64Value combined_queries = 117;

  // The estimated percent of times that your ad was eligible to show
  // on the Display Network but didn't because your budget was too low.
  // Note: Content budget lost impression share is reported in the range of 0
  // to 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue content_budget_lost_impression_share = 20;

  // The impressions you've received on the Display Network divided
  // by the estimated number of impressions you were eligible to receive.
  // Note: Content impression share is reported in the range of 0.1 to 1. Any
  // value below 0.1 is reported as 0.0999.
  google.protobuf.DoubleValue content_impression_share = 21;

  // The last date/time a conversion tag for this conversion action successfully
  // fired and was seen by Google Ads. This firing event may not have been the
  // result of an attributable conversion (e.g. because the tag was fired from a
  // browser that did not previously click an ad from an appropriate
  // advertiser). The date/time is in the customer's time zone.
  google.protobuf.StringValue conversion_last_received_request_date_time = 73;

  // The date of the most recent conversion for this conversion action. The date
  // is in the customer's time zone.
  google.protobuf.StringValue conversion_last_conversion_date = 74;

  // The estimated percentage of impressions on the Display Network
  // that your ads didn't receive due to poor Ad Rank.
  // Note: Content rank lost impression share is reported in the range of 0
  // to 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue content_rank_lost_impression_share = 22;

  // Conversions from interactions divided by the number of ad interactions
  // (such as clicks for text ads or views for video ads). This only includes
  // conversion actions which include_in_conversions_metric attribute is set to
  // true. If you use conversion-based bidding, your bid strategies will
  // optimize for these conversions.
  google.protobuf.DoubleValue conversions_from_interactions_rate = 69;

  // The value of conversions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue conversions_value = 70;

  // The value of conversions divided by the cost of ad interactions. This only
  // includes conversion actions which include_in_conversions_metric attribute
  // is set to true. If you use conversion-based bidding, your bid strategies
  // will optimize for these conversions.
  google.protobuf.DoubleValue conversions_value_per_cost = 71;

  // The value of conversions from interactions divided by the number of ad
  // interactions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue conversions_from_interactions_value_per_interaction = 72;

  // The number of conversions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue conversions = 25;

  // The sum of your cost-per-click (CPC) and cost-per-thousand impressions
  // (CPM) costs during this period.
  google.protobuf.Int64Value cost_micros = 26;

  // The cost of ad interactions divided by all conversions.
  google.protobuf.DoubleValue cost_per_all_conversions = 68;

  // The cost of ad interactions divided by conversions. This only includes
  // conversion actions which include_in_conversions_metric attribute is set to
  // true. If you use conversion-based bidding, your bid strategies will
  // optimize for these conversions.
  google.protobuf.DoubleValue cost_per_conversion = 28;

  // The cost of ad interactions divided by current model attributed
  // conversions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue cost_per_current_model_attributed_conversion = 106;

  // Conversions from when a customer clicks on a Google Ads ad on one device,
  // then converts on a different device or browser.
  // Cross-device conversions are already included in all_conversions.
  google.protobuf.DoubleValue cross_device_conversions = 29;

  // The number of clicks your ad receives (Clicks) divided by the number
  // of times your ad is shown (Impressions).
  google.protobuf.DoubleValue ctr = 30;

  // Shows how your historic conversions data would look under the attribution
  // model you've currently selected. This only includes conversion actions
  // which include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue current_model_attributed_conversions = 101;

  // Current model attributed conversions from interactions divided by the
  // number of ad interactions (such as clicks for text ads or views for video
  // ads). This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue current_model_attributed_conversions_from_interactions_rate = 102;

  // The value of current model attributed conversions from interactions divided
  // by the number of ad interactions. This only includes conversion actions
  // which include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue current_model_attributed_conversions_from_interactions_value_per_interaction = 103;

  // The value of current model attributed conversions. This only includes
  // conversion actions which include_in_conversions_metric attribute is set to
  // true. If you use conversion-based bidding, your bid strategies will
  // optimize for these conversions.
  google.protobuf.DoubleValue current_model_attributed_conversions_value = 104;

  // The value of current model attributed conversions divided by the cost of ad
  // interactions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue current_model_attributed_conversions_value_per_cost = 105;

  // How often people engage with your ad after it's shown to them. This is the
  // number of ad expansions divided by the number of times your ad is shown.
  google.protobuf.DoubleValue engagement_rate = 31;

  // The number of engagements.
  // An engagement occurs when a viewer expands your Lightbox ad. Also, in the
  // future, other ad types may support engagement metrics.
  google.protobuf.Int64Value engagements = 32;

  // Average lead value based on clicks.
  google.protobuf.DoubleValue hotel_average_lead_value_micros = 75;

  // The average price difference between the price offered by reporting hotel
  // advertiser and the cheapest price offered by the competing advertiser.
  google.protobuf.DoubleValue hotel_price_difference_percentage = 129;

  // The creative historical quality score.
  google.ads.googleads.v3.enums.QualityScoreBucketEnum.QualityScoreBucket historical_creative_quality_score = 80;

  // The quality of historical landing page experience.
  google.ads.googleads.v3.enums.QualityScoreBucketEnum.QualityScoreBucket historical_landing_page_quality_score = 81;

  // The historical quality score.
  google.protobuf.Int64Value historical_quality_score = 82;

  // The historical search predicted click through rate (CTR).
  google.ads.googleads.v3.enums.QualityScoreBucketEnum.QualityScoreBucket historical_search_predicted_ctr = 83;

  // The number of times the ad was forwarded to someone else as a message.
  google.protobuf.Int64Value gmail_forwards = 85;

  // The number of times someone has saved your Gmail ad to their inbox as a
  // message.
  google.protobuf.Int64Value gmail_saves = 86;

  // The number of clicks to the landing page on the expanded state of Gmail
  // ads.
  google.protobuf.Int64Value gmail_secondary_clicks = 87;

  // The number of times a store's location-based ad was shown.
  // This metric applies to feed items only.
  google.protobuf.Int64Value impressions_from_store_reach = 125;

  // Count of how often your ad has appeared on a search results page or
  // website on the Google Network.
  google.protobuf.Int64Value impressions = 37;

  // How often people interact with your ad after it is shown to them.
  // This is the number of interactions divided by the number of times your ad
  // is shown.
  google.protobuf.DoubleValue interaction_rate = 38;

  // The number of interactions.
  // An interaction is the main user action associated with an ad format-clicks
  // for text and shopping ads, views for video ads, and so on.
  google.protobuf.Int64Value interactions = 39;

  // The types of payable and free interactions.
  repeated google.ads.googleads.v3.enums.InteractionEventTypeEnum.InteractionEventType interaction_event_types = 100;

  // The percentage of clicks filtered out of your total number of clicks
  // (filtered + non-filtered clicks) during the reporting period.
  google.protobuf.DoubleValue invalid_click_rate = 40;

  // Number of clicks Google considers illegitimate and doesn't charge you for.
  google.protobuf.Int64Value invalid_clicks = 41;

  // Number of message chats initiated for Click To Message impressions that
  // were message tracking eligible.
  google.protobuf.Int64Value message_chats = 126;

  // Number of Click To Message impressions that were message tracking eligible.
  google.protobuf.Int64Value message_impressions = 127;

  // Number of message chats initiated (message_chats) divided by the number
  // of message impressions (message_impressions).
  // Rate at which a user initiates a message chat from an ad impression with
  // a messaging option and message tracking enabled.
  // Note that this rate can be more than 1.0 for a given message impression.
  google.protobuf.DoubleValue message_chat_rate = 128;

  // The percentage of mobile clicks that go to a mobile-friendly page.
  google.protobuf.DoubleValue mobile_friendly_clicks_percentage = 109;

  // The number of times someone clicked your site's listing in the unpaid
  // results for a particular query. See the help page at
  // https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.Int64Value organic_clicks = 110;

  // The number of times someone clicked your site's listing in the unpaid
  // results (organic_clicks) divided by the total number of searches that
  // returned pages from your site (organic_queries). See the help page at
  // https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.DoubleValue organic_clicks_per_query = 111;

  // The number of listings for your site in the unpaid search results. See the
  // help page at https://support.google.com/google-ads/answer/3097241 for
  // details.
  google.protobuf.Int64Value organic_impressions = 112;

  // The number of times a page from your site was listed in the unpaid search
  // results (organic_impressions) divided by the number of searches returning
  // your site's listing in the unpaid results (organic_queries). See the help
  // page at https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.DoubleValue organic_impressions_per_query = 113;

  // The total number of searches that returned your site's listing in the
  // unpaid results. See the help page at
  // https://support.google.com/google-ads/answer/3097241 for details.
  google.protobuf.Int64Value organic_queries = 114;

  // Percentage of first-time sessions (from people who had never visited your
  // site before). Imported from Google Analytics.
  google.protobuf.DoubleValue percent_new_visitors = 42;

  // Number of offline phone calls.
  google.protobuf.Int64Value phone_calls = 43;

  // Number of offline phone impressions.
  google.protobuf.Int64Value phone_impressions = 44;

  // Number of phone calls received (phone_calls) divided by the number of
  // times your phone number is shown (phone_impressions).
  google.protobuf.DoubleValue phone_through_rate = 45;

  // Your clickthrough rate (Ctr) divided by the average clickthrough rate of
  // all advertisers on the websites that show your ads. Measures how your ads
  // perform on Display Network sites compared to other ads on the same sites.
  google.protobuf.DoubleValue relative_ctr = 46;

  // The percentage of the customer's Shopping or Search ad impressions that are
  // shown in the most prominent Shopping position. See
  // https://support.google.com/google-ads/answer/7501826
  // for details. Any value below 0.1 is reported as 0.0999.
  google.protobuf.DoubleValue search_absolute_top_impression_share = 78;

  // The number estimating how often your ad wasn't the very first ad above the
  // organic search results due to a low budget. Note: Search
  // budget lost absolute top impression share is reported in the range of 0 to
  // 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_budget_lost_absolute_top_impression_share = 88;

  // The estimated percent of times that your ad was eligible to show on the
  // Search Network but didn't because your budget was too low. Note: Search
  // budget lost impression share is reported in the range of 0 to 0.9. Any
  // value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_budget_lost_impression_share = 47;

  // The number estimating how often your ad didn't show anywhere above the
  // organic search results due to a low budget. Note: Search
  // budget lost top impression share is reported in the range of 0 to 0.9. Any
  // value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_budget_lost_top_impression_share = 89;

  // The number of clicks you've received on the Search Network
  // divided by the estimated number of clicks you were eligible to receive.
  // Note: Search click share is reported in the range of 0.1 to 1. Any value
  // below 0.1 is reported as 0.0999.
  google.protobuf.DoubleValue search_click_share = 48;

  // The impressions you've received divided by the estimated number of
  // impressions you were eligible to receive on the Search Network for search
  // terms that matched your keywords exactly (or were close variants of your
  // keyword), regardless of your keyword match types. Note: Search exact match
  // impression share is reported in the range of 0.1 to 1. Any value below 0.1
  // is reported as 0.0999.
  google.protobuf.DoubleValue search_exact_match_impression_share = 49;

  // The impressions you've received on the Search Network divided
  // by the estimated number of impressions you were eligible to receive.
  // Note: Search impression share is reported in the range of 0.1 to 1. Any
  // value below 0.1 is reported as 0.0999.
  google.protobuf.DoubleValue search_impression_share = 50;

  // The number estimating how often your ad wasn't the very first ad above the
  // organic search results due to poor Ad Rank.
  // Note: Search rank lost absolute top impression share is reported in the
  // range of 0 to 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_rank_lost_absolute_top_impression_share = 90;

  // The estimated percentage of impressions on the Search Network
  // that your ads didn't receive due to poor Ad Rank.
  // Note: Search rank lost impression share is reported in the range of 0 to
  // 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_rank_lost_impression_share = 51;

  // The number estimating how often your ad didn't show anywhere above the
  // organic search results due to poor Ad Rank.
  // Note: Search rank lost top impression share is reported in the range of 0
  // to 0.9. Any value above 0.9 is reported as 0.9001.
  google.protobuf.DoubleValue search_rank_lost_top_impression_share = 91;

  // The impressions you've received in the top location (anywhere above the
  // organic search results) compared to the estimated number of impressions you
  // were eligible to receive in the top location.
  // Note: Search top impression share is reported in the range of 0.1 to 1. Any
  // value below 0.1 is reported as 0.0999.
  google.protobuf.DoubleValue search_top_impression_share = 92;

  // A measure of how quickly your page loads after clicks on your mobile ads.
  // The score is a range from 1 to 10, 10 being the fastest.
  google.protobuf.Int64Value speed_score = 107;

  // The percent of your ad impressions that are shown anywhere above the
  // organic search results.
  google.protobuf.DoubleValue top_impression_percentage = 93;

  // The percentage of ad clicks to Accelerated Mobile Pages (AMP) landing pages
  // that reach a valid AMP page.
  google.protobuf.DoubleValue valid_accelerated_mobile_pages_clicks_percentage = 108;

  // The value of all conversions divided by the number of all conversions.
  google.protobuf.DoubleValue value_per_all_conversions = 52;

  // The value of conversions divided by the number of conversions. This only
  // includes conversion actions which include_in_conversions_metric attribute
  // is set to true. If you use conversion-based bidding, your bid strategies
  // will optimize for these conversions.
  google.protobuf.DoubleValue value_per_conversion = 53;

  // The value of current model attributed conversions divided by the number of
  // the conversions. This only includes conversion actions which
  // include_in_conversions_metric attribute is set to true. If you use
  // conversion-based bidding, your bid strategies will optimize for these
  // conversions.
  google.protobuf.DoubleValue value_per_current_model_attributed_conversion = 94;

  // Percentage of impressions where the viewer watched all of your video.
  google.protobuf.DoubleValue video_quartile_100_rate = 54;

  // Percentage of impressions where the viewer watched 25% of your video.
  google.protobuf.DoubleValue video_quartile_25_rate = 55;

  // Percentage of impressions where the viewer watched 50% of your video.
  google.protobuf.DoubleValue video_quartile_50_rate = 56;

  // Percentage of impressions where the viewer watched 75% of your video.
  google.protobuf.DoubleValue video_quartile_75_rate = 57;

  // The number of views your TrueView video ad receives divided by its number
  // of impressions, including thumbnail impressions for TrueView in-display
  // ads.
  google.protobuf.DoubleValue video_view_rate = 58;

  // The number of times your video ads were viewed.
  google.protobuf.Int64Value video_views = 59;

  // The total number of view-through conversions.
  // These happen when a customer sees an image or rich media ad, then later
  // completes a conversion on your site without interacting with (e.g.,
  // clicking on) another ad.
  google.protobuf.Int64Value view_through_conversions = 60;
}
