Home SocialHistory.js: See Which Sites Your Users Visit

SocialHistory.js: See Which Sites Your Users Visit

With so many social media sites in circulation today, badge soup can become a real problem for web sites trying to squeeze the most out of their traffic. Everyone has a different set of core social media sites that they use — from del.icio.us and Ma.gnolia, to Digg, Reddit, and Diigo, we all have our favorites. But appealing to your users’ varied tastes often means an overwhelming sea of site badges that is both unattractive and ineffective. Web developer Aza Raskin has a solution based on a browser history leak introduced due to CSS.

“Not everyone uses Digg. You have to decide on which bookmarking site, if any, to dedicate your precious screen real-estate. It’s a hard choice. If you choose poorly your reader won’t vote,” writes Raskin. “On the other hand, if you take the bird-shot approach, it overloads your reader with branded badge after branded badge. It turns your page into the village bicycle. Not pretty.”

As a solution, Raskin devised SocialHistory.js, a handy bit of JavaScript code that detects which social media sites your users frequent. Armed with that information, you can display only the relevant badges to each user.

SocialHistory.js works by exploiting the feature in modern web browsers that automatically uses a different link color for visited links. The JavaScript loads up a bunch of links from a list of top social media sites in an iFrame and looks at which have been visited based on the change in link color. From there, it can assume which you are most likely to use (or in my case, which I may have visited recently while doing research for a story).

Raskin notes that the same browser leak can be exploited using his bit of JavaScript to check out what other sites your users are visiting. You could ask SocialHistory.js to load up a list of competitor’s web sites, for example, to see how much of your web site audience overlaps.

There are some drawbacks to the approach. For example, your users need to have JavaScript enabled (95% of people according to W3Schools), and the detection only works for sites that the user has visited recently (dependent on his or her history settings). Nonetheless, it is a clever way to clean up the badge overload on your site and find out a little bit about your visitors’ surfing habits.

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.