[英]Keeping track of custom events in Google Analytics (React app)
I've been running into some difficulty with Google Analytics and keeping track of some custom events that I've made on a React app, using Firebase to handle GA.我在使用 Google Analytics 时遇到了一些困难,并跟踪我在 React 应用程序上创建的一些自定义事件,使用 Firebase 来处理 GA。 The event I'm trying to keep trying to keep track of is a string, that will be an "affiliate code" that customers will type in to be able to use the site.我一直试图跟踪的事件是一个字符串,这将是一个“附属代码”,客户将输入该代码才能使用该网站。 This project is for a client that wants to be able to see the total # of people that have entered in various affiliate codes.该项目适用于希望能够查看输入各种会员代码的总人数的客户。
So far, I've been able to create and log my custom events I've made, but I don't see any way to see the totals of them over time.到目前为止,我已经能够创建和记录我所做的自定义事件,但我看不出有什么方法可以随着时间的推移查看它们的总数。 I can see the recent codes sent in the last 30 min from the "realtime" page, but not over all time.我可以从“实时”页面看到最近 30 分钟内发送的最新代码,但并非一直如此。
To log events, I made a helper function that calls the logEvent()
method from firebase/analytics
.为了记录事件,我制作了一个助手 function,它从 firebase firebase/analytics
调用logEvent()
方法。
addEvent(eventName, parameters = undefined) {
if (process.env.NODE_ENV === "production") {
logEvent(this.analytics, eventName, parameters);
}
}
In the specific instance of this affiliate code, this is how I'm calling it:在此会员代码的特定实例中,我是这样称呼它的:
Firebase.addEvent("affiliate_code_entered", {
affiliate_code: formattedVal,
});
Does anyone know if there's something I can do to make sure I can see the totals of these affiliate codes entered?有谁知道我是否可以做些什么来确保我可以看到输入的这些联盟代码的总数? Any help would be appreciated, thank you!任何帮助将不胜感激,谢谢!
You can view the statistics about your events in the Firebase console under the Events tab.您可以在 Firebase 控制台的“ 事件”选项卡下查看有关您的事件的统计信息。 This dashboard shows the event reports that are created for each distinct type of event logged by your app.此仪表板显示为您的应用程序记录的每种不同类型的事件创建的事件报告。 Though, you might not see it right away due to Analytics data reporting delay .但是,由于Analytics 数据报告延迟,您可能不会立即看到它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.