MP.getEvents: Get unique, total, or average data for a set of events over N...

Description Usage Arguments Details Value Author(s) Examples

View source: R/MP.getEvents.R

Description

Get unique, total, or average data for a set of events over N days, weeks, or months. For more detail go https://mixpanel.com/help/reference/data-export-api#events

Usage

1
MP.getEvents(api_secret = NULL, event = NULL, type = "general", unit = "day", interva = NULL, from_date = Sys.Date() - 10, to_date = Sys.Date())

Arguments

api_secret

Your API Mixpanel secret, you can find hin in mixpanel web interface: Account (http://img.netpeak.ua/alsey/150600941068_kiss_10kb.png) > Projects (http://img.netpeak.ua/alsey/150600948369_kiss_46kb.png)

event

The event or events that you wish to get data for, example c("play song", "log in", "add playlist")

type

The analysis type you would like to get data for - such as general, unique, or average events. Valid values: "general", "unique", or "average"

unit

This can be "minute", "hour", "day", "week", or "month". It determines the level of granularity of the data you get back. Note that you cannot get hourly uniques.

interva

The number of "units" to return data for - minutes, hours, days, weeks, or months. 1 will return data for the current unit (minute, hour, day, week or month). 2 will return the current and previous units, and so on. Specify either interval or from_date and to_date.

from_date

The first date to return data for, in yyyy-mm-dd format. This date is inclusive. Specify either interval or from_date and to_date.

to_date

The last date to return data for, in yyyy-mm-dd format. This date is inclusive. Specify either interval or from_date and to_date.

Details

For more information go https://mixpanel.com/help/reference/data-export-api#events

Value

Data frame with data from Mixpanel account.

Author(s)

Alexey Seleznev

Examples

1
2
3
4
5
6
7
MP_test <- MP.getEvents(api_secret = "abcdefg123456",
                        event = c("posting_success","emu","session_start","$custom_event:585946"),
                        type = "general",
                        unit = "day",
                        from_date = "2017-07-01",
                        to_date = "2017-07-25")
  

selesnow/rmixpanel documentation built on May 26, 2021, 10:04 a.m.