If you are the creator of a website or web application yourself, you might want to install the rack-preview gem for Ruby, or something similar. We discovered Safari Top Sites was polluting Splitwise’s Google Analytics and Mixpanel data.
A couple of weeks ago, while digging into our site analytics, we noticed something strange with Safari. We’d just launched Fat Rabbit and were really interested in making sure we measured all the useful statistics around user growth and engagement. As we pulled out interesting details about website visits (using a combination of Google Analytics and Mixpanel), we started seeing an odd pattern – the average visit length on Safari was half that of our other browsers and the bounce rate was much higher.
Our first assumption was that we had released Fat Rabbit with some Safari specific rendering issues that were causing people to be, like, “Ew!” and abandon all hope of finding a great way to split expenses with their friends. Thankfully, that wasn’t the case. Our next guess was that it might be Google / Mixpanel lumping mobile Safari and desktop Safari traffic together. Nope, not that either.
So, how’d we fix it? We were happy to find the wonderful rack-preview gem. The gem allows us to ignore the Safari Top Sites requests for analytics purposes, but still serve up great content to be previewed.
If using Ruby gems isn’t your thing, all you have to do is look for the “X-purpose” HTTP header. If its value is “preview,” it’s a Top Sites request and you should treat it appropriately. Of course, you’ll still want to serve up a normal-looking version of your page so Top Sites users get a nice version.
One thought on “Safari ‘Top Sites’ Pollutes Google Analytics and Mixpanel”