Cocoa UI Analytics

I'd love to track user interactions inside my OS X app. The goal is incredibly easy to launch:

  • Track how many times a particular item is clicked

Im using sparkle to enable application updates and can send additional information through the delegate method. Read: Sending (client side) and saving (server side) data is not a problem.

My questions:

  • How can I connect a “hook” to my system to save an event (for example, “click”).
  • Where can I store statistics on a local computer? (adding plist property?)
  • Is there such a system?

Really appreciate the help. I am more likely to be new to Cocoa, so please ask if you need to clarify any of the points above.

Thanks again,

Dustin

+4
source share
6 answers

If you set the view as the first response methods, such as - (void) mouseDown: (NSEvent *), the object will be launched on the required clicks.

This is true, however, it will require you to subclass each UI element, which can become quite annoying after a while, depending on how many user interface elements require tracking user analytics. However, I cannot think of another way to do this - I just thought that I would mention a disclaimer to do it this way.

+1
source

1- How can I connect a “hook” to my system to save an event (for example, “click”)

As already mentioned, you pretty much just add a small piece of the toolkit to the responder / callback for the events you are looking for. You also need to remember what you are doing - your goal here is to collect general actions, not personal information or content. For example, if you are creating a word processing application, you are looking for:

The user clicked the bold button.

NOT

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

2- Where to store statistics on the local computer? (adding plist property?)

Anywhere on the disk, personally, I would not use plist, but rather a special file. OSX convention for specific application files: / Users / * username * / Library / Application support / * application name *

This space is application and user-specific and a great place to store configuration files and all other things specific to your application.

But this is only information from one user, how do you collect this information for different users? On many computers?

3- Is there such a system?

Yes. I created UserMetrix to simplify connecting to new and existing Cocoa applications through the C client or objective-C. UserMetrix collects usage and error statistics from each user, aggregates them and presents them as simple web reports.

+1
source

You might want to use analytics services such as Flurry .

0
source

If you install the view, as the first responder methods, such as -(void)mouseDown:(NSEvent *)theEvent , will be launched on the required clicks. Everything you do increases your variable / plist / everything in this method. Take a look at this .

0
source

You can check our DeskAppTrack Analytics. It is a free and convenient platform for MAC OS X applications. It is all for you, and you can get what you want on your website.

0
source

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

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

[...] a structure that allows an application to expose its own behavior, by registering a message to be sent.

This is still true in the beta (and I did not touch it after a while, although you make me want to return to it), but do you think this is the solution you are looking for?

The main advantage of my solution is that the tracking code is completely external to the tracked code (you do not need to manually add a tracking method for each class that you would like to use).

0
source

Source: https://habr.com/ru/post/1332852/


All Articles