header

Torsten Curdt’s weblog

Tracking Users

Whenever you release a product it is important to measure how you are doing in terms of adoption. Unfortunately the number of downloads is a very bad metric. Just because someone downloaded the application does not mean that he is actually using it. And someone could download the application multiple times and so on. All my Cocoa applications are using Sparkle for software updates. It’s the one time where all of your users check back on your server. So the idea was simple: just let’s include a unique identifier with the software update check and we are golden.

The new Sparkle 1.5 is still beta but already more than usable. In fact it now provides the proper delegate methods to send information along with the appcast update check. Somewhere in your code you will have to set the delegate

[[SUUpdater sharedUpdater] setDelegate:self];

and when Sparkle checks for a new release it will send a long the UUID we generate for the installation.

- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater
                  sendingSystemProfile:(BOOL)sendingProfile {

  NSArray *keys = [NSArray arrayWithObjects:@"key", @"value", nil];

  NSArray *parameters = [NSArray arrayWithObject:
             [NSDictionary dictionaryWithObjects:
                       [NSArray arrayWithObjects:
                               @"installationId",
                           [self installationId],
                                             nil]
                                   forKeys:keys]];

  return parameters;
}

The installation id gets generated once and then stored inside the user defaults.

- (NSString*)installationId {
  NSString *uuid = [[NSUserDefaults standardUserDefaults]
                            valueForKey:INSTALLATIONID];

  if (uuid == nil) {
    uuid_t buffer;
    char str[37];

    uuid_generate(buffer);
    uuid_unparse_upper(buffer, str);        

    uuid = [NSString stringWithFormat:@"%s", str];

    NSLog(@"Generated UUID %@", uuid);        

    [[NSUserDefaults standardUserDefaults] setValue: uuid
                                             forKey: INSTALLATIONID];
  }

  return uuid;
}

When you now grep and analyze your server http log files you can easily figure out how many individual installations are out there. The id is entirely random and therefor should not be a problem in terms of privacy. Keep in mind thought that Sparkle will check for releases only every few days. And your application must have been started. So there can be quite a delay. Still you have a much better metric and know much more precise how many users you are dealing with.

While you can implement this yourself in all of your applications I thought this might be worth being part of Sparkle itself. The changes are available in my Sparkle branch on launchpad. Unfortunately it will probably not make it into the 1.5 release. But poke Andy if you think this would be a useful addition :)

  • I never register if I don't have to. Even if I really like the software. So I guess such a metric is probably as useful as the downloads stats. With an anonymous ping on the appcast check it really is far from monitoring the user. Plus you can turn if off by disabling Sparkle updates - if you are really concerned.
  • theGuru
    You should also include a user invoked registration screen in your software (not implemented as one of those annoying ones). Many, many ears ago I released software on compuserve with a "print the registration form" option - you would be surprised how well that now archaic facility was patronised via snail mail. Personally I'm not a fan of passive monitoring, you can thank the RealAudio people for that.

    People that genuinely like your software will go out of their way to register an interest with it, and this is the real count that matters.
blog comments powered by Disqus