pub struct Cohort {
pub date_range: Option<DateRange>,
pub name: Option<String>,
pub type_: Option<String>,
}
Expand description
Defines a cohort. A cohort is a group of users who share a common characteristic. For example, all users with the same acquisition date belong to the same cohort.
This type is not used in any activity, and only used as part of another schema.
Fields§
§date_range: Option<DateRange>
This is used for FIRST_VISIT_DATE
cohort, the cohort selects users whose first visit date is between start date and end date defined in the DateRange. The date ranges should be aligned for cohort requests. If the request contains ga:cohortNthDay
it should be exactly one day long, if ga:cohortNthWeek
it should be aligned to the week boundary (starting at Sunday and ending Saturday), and for ga:cohortNthMonth
the date range should be aligned to the month (starting at the first and ending on the last day of the month). For LTV requests there are no such restrictions. You do not need to supply a date range for the reportsRequest.dateRanges
field.
name: Option<String>
A unique name for the cohort. If not defined name will be auto-generated with values cohort_[1234…].
type_: Option<String>
Type of the cohort. The only supported type as of now is FIRST_VISIT_DATE
. If this field is unspecified the cohort is treated as FIRST_VISIT_DATE
type cohort.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cohort
impl<'de> Deserialize<'de> for Cohort
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Part for Cohort
Auto Trait Implementations§
impl Freeze for Cohort
impl RefUnwindSafe for Cohort
impl Send for Cohort
impl Sync for Cohort
impl Unpin for Cohort
impl UnwindSafe for Cohort
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more