gpt4 book ai didi

ruby-on-rails - 导出 Mixpanel 事件提要数据

转载 作者:行者123 更新时间:2023-12-05 07:57:35 25 4
gpt4 key购买 nike

有什么方法可以将 Mixpanel 的 Activity Feed 数据导出为 CSV 格式吗?

我需要为每个用户制作一张表格,显示该用户在我的网站上执行的所有事件。

我见过很多导出一般用户数据和漏斗报告的方法,但关于用户事件提要的方法并不多。我正在运行 Ruby on Rails 应用程序,但很乐意使用第 3 方工具或其他方法来解决此问题。

最佳答案

是的,至少使用 R(参见 https://cran.r-project.org)。包 RMixpanel ( https://github.com/7factory/RMixpanel ) 提供函数 mixpanelGetEventsForProfiles 将事件提要数据导入 R data.frame。将其导出到 CSV 是一个简单的单行。总的来说,它看起来像:

> ## Install package.
> devtools::install_github("7factory/RMixpanel")
> require(RMixpanel)
>
> ## Get people profiles.
> account <- mixpanelCreateAccount(...) ## TBD
> profiles <- mixpanelGetProfiles(account)
>
> ## Load feed for 1st people profile.>
> distinctIDs = profiles[, "distinct_id"]
> feed001 <- mixpanelGetEventsForProfiles(account, distinctIDs[1])
>
> ## Save feed into CSV.
> write.table(feed001, "feed001.csv", quote=TRUE, sep=",", row.names=FALSE)

关于ruby-on-rails - 导出 Mixpanel 事件提要数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26634937/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com