1

I recently launched a Safari extension (see it here http://allaregreen.us). There is also a version for Chrome, and Firefox should be coming within a day. Because the Chrome version is being hosted in the Chrome Web Store, I can easily see how many people installed my extension on the Developer Dashboard. However, I would like to find this number for Safari too. For the Safari version, the .safariextz file is hosted on my site, and people download through this link: https://extensions.apple.com/details/?id=com.nicholasrubin.greenhouse-377CXMPJ56 in the Safari Extension Gallery. I haven't been able to find the number of installs anywhere, and I'm not even sure if it exists.

What I'm wondering: Is there a way to see how many people are using my Safari Extension? Or, if it's the only option, see how many times the .safariextz file hosted on my site is being accessed? I have Webalizer and Logaholic - could I find it there?

Nicholas Rubin
  • 317
  • 1
  • 4
  • 14

2 Answers2

2

To track downloads, you can probably find details of when the safariextz file is accessed in your server logs.

To track actual installs and usage, you can use Google Analytics. Sign up for an account, then in your global page put something like:

// Google Analytics
var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXX-XX']);
    _gaq.push(['_trackPageview']);
(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = 'https://ssl.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

That will track a pageview every time the global page is loaded, which I think happens each time the user opens Safari.

You can also track specific usage events. Like new installs:

if (!(safari.extension.settings.installed)) {
    _gaq.push(['_trackEvent', 'Install']);
    safari.extension.settings.installed = true;
}

Or version upgrades:

var currVersion = 110,
    prevVersion = safari.extension.settings.version;
_gaq.push(['_trackEvent', 'Upgrade', prevVersion+'->'+currVersion]);
safari.extension.settings.version = currVersion;

Or specific views:

_gaq.push(['_trackEvent', 'viewPerson', 'Nancy Pelosi']);

If including Google Analytics in your extension, it's always a good idea to have full disclosure and tell your users exactly what you are tracking.

Matt Swain
  • 3,827
  • 4
  • 25
  • 36
  • 1
    I'm trying to get the new ga setup to work on the same basis you shown above but can't get it to record anything: created dedicated properties (both for website and for app) none of which managed to record anything—do you have this working with the latest Google Analytics setup? – jrgd Mar 25 '15 at 21:51
1

To see the number of downloads in Logaholic, you can open the Top Pages report and put "safariextz" in the search box if needed.

Michael
  • 1,247
  • 1
  • 8
  • 18