Learn R Programming

RMixpanel (version 0.7-1)

mixpanelGetData: General Method For Mixpanel API Requests

Description

This method handles the authentication and download of data from the Mixpanel API as well as data persistance. The method is used by many of the more specialized methods of this package.

Usage

mixpanelGetData(account, method="export/", args, validitySeconds=60, verbose=TRUE, 
  fileName="", data=FALSE, retryCount=0, encoding="UTF-8")

Arguments

account

A mixpanel account, as defined in mixpanelCreateAccount.

method

API method (route).

validitySeconds

Expiration of API request.

verbose

If FALSE, less information is shown on the console.

fileName

File name to persist data (defaults to './temp.txt'). If supplied, account$dataPath is used as path.

data

If FALSE, data is downloaded, but not returned as function argument.

retryCount

How many times a failed request should be retried?

encoding

JSON Encoding. Default is UTF8.

Value

If data==TRUE, the method returns the response of the API request (raw character vector). Otherwise nothing is returned.

References

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

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...")
                                
mixpanelGetData(account, method="funnels/list/", args=list(), data=TRUE)
# }

Run the code above in your browser using DataLab