[英]Mixpanel data getting wrong from api
I am working on to show analytics of user visits on a page and unique user visits on a page using mixpanel.我正在努力使用 mixpanel 显示页面上的用户访问分析和页面上的唯一用户访问。 We are storing events in mixpanel there is an event named Page Visit from where using currentUrl I am getting the data for the page visits.
我们将事件存储在 mixpanel 中,有一个名为 Page Visit 的事件,我从那里使用 currentUrl 获取页面访问的数据。 when I check the data in mixpanel and from the api, I am getting correct page visits but the data for unique page visits is comming out +20-40, I am using type=unique in the api while making the call I am getting the csv format data and getting the data using the following code in react
当我检查 mixpanel 和 api 中的数据时,我得到了正确的页面访问,但是唯一页面访问的数据出现了 +20-40,我在拨打电话时在 api 中使用 type=unique 我得到了csv 格式数据,并在 react 中使用以下代码获取数据
const helper = await res.text();
const lines = helper.split(/\r?\n/);
const helper2 = await resnotunique.text();
const lines2 = helper2.split(/\r?\n/);
var csvData2 = [];
var csvData = [];
for (let i = 1; i < lines.length - 1; i++) {
csvData[i - 1] = lines[i].split(",");
csvData2[i - 1] = lines2[i].split(",");
}
for (let i = 0; i < csvData.length; i++) {
value = +value + +parseInt(csvData[i][1]);
value2 = +value2 + +parseInt(csvData2[i][1]);
}
Here res is the result of the total page visits api call and renotunique is the api result of the unique page visits.这里 res 是总页面访问 api 调用的结果,renotunique 是唯一页面访问的 api 结果。
I have checked my api calls and tried in postman but the data is adding up to be wrong only for the unique page visits.我已经检查了我的 api 调用并在 postman 中进行了尝试,但数据加起来只有唯一页面访问是错误的。 I am expecting correct data from mixpanel.
我期待来自混合面板的正确数据。 Please help.
请帮忙。
Found the answer!找到答案了! Just put interval query in the api and specify the no of days in query to get a combined data for the days which is infact correct
只需将间隔查询放入 api 并在查询中指定天数即可获得实际上正确的天数组合数据
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.