可可 UI 分析

发布于 2024-10-08 17:33:04 字数 419 浏览 5 评论 0 原文

我想跟踪 OS X 应用程序内的用户交互。开始的目标非常简单:

  1. 跟踪特定项目被点击的次数

我使用 sparkle 来启用应用程序更新并能够通过委托方法发送附加信息。阅读:发送(客户端)和存储(服务器端)数据不是问题。

我的问题:

  1. 如何干净地将“钩子”附加到我的系统中来存储事件(例如“单击”)
  2. 我在本地计算机上的哪里存储统计信息? (增加plist属性?)
  3. 这样的系统是否已经存在?

非常感谢您的帮助。我对 Cocoa 相当陌生,所以请询问您是否需要对上述任何一点进行进一步说明。

再次感谢

达斯汀

I’d like to track user interaction inside of my OS X application. The goal is incredibly simple to start:

  1. Track how many times a specific item is clicked on

I’m using sparkle to enable application updates and am able to send additional information through a delegate method. Read: Sending (client side) and storing (server side) the data isn’t an issue.

My Questions:

  1. How can I cleanly attach a “hook” into my system to store an event (like “clicked”)
  2. Where do I store the stats on the local machine? (incrementing plist property?)
  3. Does such system already exist?

Really appreciate the help. I’m rather new to Cocoa so please ask if you need further clarification on any of the above points.

Thanks again,

Dustin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

辞旧 2024-10-15 17:33:04

如果将视图设置为第一响应者方法,例如 -(void)mouseDown:(NSEvent *)theEvent 将在所需的点击时触发。

确实如此,但它需要您对每个 UI 元素进行子类化,这可能会在一段时间后变得非常烦人,具体取决于有多少 UI 元素需要自定义分析跟踪。也就是说,我想不出另一种方法来做到这一点 - 我只是想我会提到这样做的警告。

If you set a view as the first responder methods such as -(void)mouseDown:(NSEvent *)theEvent will be fired on the required clicks.

That's true, however it would require you to subclass every single UI element which could get pretty annoying after a while depending upon how many UI elements will require custom analytics tracking. That said, I can't think of another way to do it - I just thought I would mention the caveat to doing it this way.

把时间冻结 2024-10-15 17:33:04

1-如何将“钩子”干净地附加到我的系统中来存储事件(例如“单击”)

正如已经提到的,您几乎只需添加一个小片段即可您正在寻找的事件的响应者/回调中的仪器。您还需要注意您所使用的工具 - 您的目标是收集通用操作,而不是个人身份信息或内容。例如,如果您正在构建文字处理应用程序,您正在寻找:

用户按下了“粗体”按钮。

NOT

用户发了这样的文字:“我是杰克的冷汗。”大胆的。

2- 我在本地计算机上的哪里存储统计信息? (增加 plist 属性?)

在磁盘上的任何位置,我个人不会使用 plist - 而是使用专用的自定义文件。应用程序特定文件的 OSX 约定为: /Users/*用户名*/Library/Application Support/*应用程序名称*

此空间是应用程序和用户特定的,并且是一个很好的空间。存储配置文件和仅特定于您的应用程序的所有其他内容的位置。

但这只是来自一个用户的信息,如何在许多不同的用户之间整理这些信息?在许多不同的计算机上?

3- 这样的系统是否已经存在?

是的。我一直在构建 UserMetrix ,以便通过 C 或目标轻松连接到新的和现有的 Cocoa 应用程序 - C 客户端。 UserMetrix 收集每个用户的使用情况和错误统计信息,将其汇总并以简单的基于 Web 的报告形式呈现。

1- How can I cleanly attach a “hook” into my system to store an event (like “clicked”)

As already mentioned, you pretty much just add a little snippet of instrumentation in the responder / call back for the events you are looking for. You also need to be mindful of what you instrument - your goal here is to collect generalised actions, not personally identifiable information or content. For example, if you are building a word processing application, you are looking for:

The user pressed the 'bold' button.

NOT

The user made the text "I am Jack's cold sweat." bold.

2- Where do I store the stats on the local machine? (incrementing plist property?)

Anywhere on disk, personally I wouldn't use a plist - but rather a dedicated custom file. The OSX convention for application specific files is: /Users/*username*/Library/Application Support/*application name*

This space is application and user specific, and a great place to store configuration files and all manner of other things that is specific to only your application.

But that is only information from one user, how do you collate this information across many different users? On many different computers?

3- Does such system already exist?

Yes. I have been building UserMetrix to make it easy to hook into new and existing Cocoa applications via a C or objective-C client. UserMetrix collects usage and error statistics from every user, aggregating them and presenting them as simple web-based reports.

傲性难收 2024-10-15 17:33:04

您可能需要考虑使用 Flurry 等分析服务。

You might want to consider using an analytics service like Flurry.

明月夜 2024-10-15 17:33:04

如果将视图设置为第一响应者方法,例如 -(void)mouseDown:(NSEvent *)theEvent 将在所需的点击时触发。您所做的就是在该方法中增加您的变量/plist/任何内容。看看
这个

If you set a view as the first responder methods such as -(void)mouseDown:(NSEvent *)theEvent will be fired on the required clicks. All you do, is increment your variable/plist/whatever in that method. Have a look at
this.

守护在此方 2024-10-15 17:33:04

您可以查看我们的 DeskAppTrack 分析。它是一个免费且优秀的 MAC OS X 应用程序平台。这一切都适合您,您可以在他们的网站上获得您想要的东西。

you can check our DeskAppTrack Analytics. It's a free and good platform for MAC OS X applications.It is all for you and you can get what you want on their web site.

大海や 2024-10-15 17:33:04

如何干净利落地将“钩子”附加到我的系统中来存储事件

如果事件是消息发送,这正是我在编写BCTrackingClass :

[...] 一个允许应用程序内省其自身行为的框架,
通过消息发送的日志记录。

它仍然处于测试版本(我已经有一段时间没有碰它了,尽管你让我想回到它),但是你认为这就是你正在寻找的解决方案吗?

我的解决方案的主要优点是跟踪代码完全位于被跟踪代码的外部(您不必向您想要使用的每个类手动添加跟踪方法)。

How can I cleanly attach a “hook” into my system to store an event

If an event is a message sending, that's exactly what I had in mind when I wrote BCTrackingClass :

[...] a framework allowing an Application to instrospect its own behaviour,
via the logging of its message sending.

It's still fairly in beta version (and I haven't touched it in a while now, although you make me want to get back to it), but do you think that is the kind of solution you are looking for ?

The main advantage of my solution is that the tracking code is fully external to the tracked code (you don't have to manually add a tracking method to every class you would like to use).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文