用于分析的基本数据库架构
我正在编写一小段代码来记录用户在 Kiosk 上的操作,并且希望得到有关我预期的 SQLite 架构的反馈。
基本上我想模仿谷歌分析。该信息亭与网页分析非常相似,但我添加了“onScreenInteraction”操作。用户可以在其中与产品或信息进行交互,我们希望记录访问了哪些信息。
用户会话表看起来像这样
* id :int
* kioskId :int
* startTimeStamp :time
* endTimeStamp :time
,用户操作表看起来像
* sessionId :int (FK)
* actionStart :time
* actionEnd :time
* actionType :varchar
* actionDetail :text
这样,希望能够记录绘制图表所需的所有详细信息,如果我偏离轨道,请随意将其撕成碎片。我之前从未实施过自定义分析,因此收到反馈后我会感到放心。
I'm writing a small bit of code to record the users actions on a Kiosk, and would appreciate feed back on my intended SQLite schema.
Basically I'm trying to mimic Google Analytics. The kiosk is very similar to web page analytics, but I'm including an action of "onScreenInteraction". Where users can interact with products or information, and we want to record which information was accessed.
A user session table would look like
* id :int
* kioskId :int
* startTimeStamp :time
* endTimeStamp :time
And the user action table would look like
* sessionId :int (FK)
* actionStart :time
* actionEnd :time
* actionType :varchar
* actionDetail :text
this should hopefully record all the details required to chart graphs, feel free to tear it to shreds if I'm way off track. I haven't implemented custom analytics before so would feel reassured with feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的用户操作表仅允许一项操作。用户操作表上需要有一个 id。
如何识别用户?您不太可能获得 endTimeStamp,因为信息亭用户可以直接走开。
您如何获取 actionEnd 时间戳?
否则,您的表设计看起来您将能够获得用户和操作的计数。我不太确定您的时间戳数据是否足够准确。
Your user action table allows for only one action. There needs to be an id on the user action table.
How do you identify a user? You're not likely to get the endTimeStamp, as a kiosk user can just walk away.
How are you getting the actionEnd time stamp?
Otherwise, your table design looks like you'll be able to get counts of users and actions. I'm not so sure your time stamp data will be accurate enough.