|
| 1 | +// Copyright 2025 The Meridian Authors. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +edition = "2023"; |
| 16 | + |
| 17 | +package mmm.v1.marketing.analysis; |
| 18 | + |
| 19 | +import "mmm/v1/common/estimate.proto"; |
| 20 | +import "mmm/v1/common/kpi_type.proto"; |
| 21 | + |
| 22 | +option features.field_presence = IMPLICIT; |
| 23 | +option java_multiple_files = true; |
| 24 | + |
| 25 | +// A contribution is defined as the value difference caused by adding a new |
| 26 | +// outcome. |
| 27 | +message Contribution { |
| 28 | + // The contribution value. Required. |
| 29 | + common.Estimate value = 1; |
| 30 | + |
| 31 | + // Share of contribution = contribution / total contribution from all |
| 32 | + // outcomes. |
| 33 | + common.Estimate share = 2; |
| 34 | +} |
| 35 | + |
| 36 | +// Effectiveness calculates how much incremental KPI is generated per media unit |
| 37 | +// (e.g. impressions or clicks), i.e. contribution / media unit. |
| 38 | +message Effectiveness { |
| 39 | + // The media unit of the effectiveness. Required. |
| 40 | + string media_unit = 1; |
| 41 | + |
| 42 | + // The value of the effectiveness. Required. |
| 43 | + common.Estimate value = 2; |
| 44 | +} |
| 45 | + |
| 46 | +// An outcome analysis on KPI which can be defined as revenue or other generic |
| 47 | +// non-revenue type. |
| 48 | +message KpiOutcome { |
| 49 | + // The type of this KPI (i.e. REVENUE or NON_REVENUE) |
| 50 | + // Note that a model input with non-revenue (generic KPI) data can still have |
| 51 | + // revenue-based KPI outcomes defined, provided that `revenue_per_kpi` is |
| 52 | + // defined. |
| 53 | + common.KpiType kpi_type = 1; |
| 54 | + |
| 55 | + // The contribution to a KPI. |
| 56 | + // If `kpi_type == REVENUE`, this is the revenue KPI value. |
| 57 | + // If `kpi_type == NON_REVENUE`, AND there is a `revenue_per_kpi` conversion, |
| 58 | + // this is the derived `kpi * revenue_per_kpi` value. |
| 59 | + // Otherwise, this is simply the (non-revenue, user-defined) KPI value. |
| 60 | + Contribution contribution = 2; |
| 61 | + |
| 62 | + // The effectiveness of this outcome. |
| 63 | + Effectiveness effectiveness = 3; |
| 64 | + |
| 65 | + // ROI = contribution / spend. |
| 66 | + // See contribution definition above. |
| 67 | + common.Estimate roi = 4; |
| 68 | + |
| 69 | + // Marginal ROI shows the additional ROI gained from additional spend. |
| 70 | + // See ROI definition above. |
| 71 | + common.Estimate marginal_roi = 5; |
| 72 | + |
| 73 | + // Cost per incremental outcome (which could be revenue or some generic KPI). |
| 74 | + // E.g. when contribution is thousand impression, it is CPM; when contribution |
| 75 | + // is acquisition, this is CPA. |
| 76 | + common.Estimate cost_per_contribution = 6; |
| 77 | +} |
0 commit comments