Learn R Programming

RMixpanel (version 0.7-1)

mixpanelGetRetention: Retention Report

Description

Get retention data from Mixpanel API. The resulting object can be printed nicely using print.retention.

Usage

mixpanelGetRetention(account, event, from, to, unit, retentionType, 
  intervalCount, verbose=TRUE, ...)

Arguments

account

A mixpanel account, as defined in mixpanelCreateAccount.

event

Event name. If empty, all events are returned.

from

Start date in either format <"yyyy-mm-dd"> or <yyyymmdd>. Inclusive.

to

End date in either format <"yyyy-mm-dd"> or <yyyymmdd>. Inclusive.

unit

Defaults to 'day'.

retentionType

birth (=First time) or compounded (=Recurring). Defaults to 'birth'.

intervalCount

Number of intervals per cohort to return.

verbose

If TRUE more output is generated.

...

Additional arguments to Mixpanel API. E.g. born_event='Event name' (needed for retention type 'birth'), or born_where='properties["Prop name"]=="value"'.

Value

Object of class retention including

dates

Start dates of each cohort.

cohortCount

Size of cohorts (people count).

retainCount

Number of retained people.

retainPerc

Percentage of retained people.

References

https://mixpanel.com/help/reference/data-export-api#retention

See Also

mixpanelGetAddiction

Examples

Run this code
# NOT RUN {
## Fill in here the API token, key and secret as found on 
## www.mixpanel.com - Account -> Projects. 
account = mixpanelCreateAccount("ProjectName",
                                token="c12g3...",
                                secret="168e7e...", 
                                key="543c55...")
mixpanelGetRetention(account, born_event="AppInstall", event="WatchedItem", 
                     from=20150701, to=20151101, unit="week")
# }

Run the code above in your browser using DataLab