Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Detect if visitors are logged into social networks

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 dist
Octocat-spinner-32 src
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Rakefile
Octocat-spinner-32 Readme.md
Readme.md

social_detector

Inspired by http://www.tomanthony.co.uk/blog/detect-visitor-social-networks/

Usage

Simplest usage

<script src="social_detector.js"></script>
<script>
    social_detector({
        facebook: 'facebook_app_id',
        vkontakte: 'vkontakte_app_id'
    });
</script>

How to get appId

Described in seomoz blog post, section "Setup a Facebook App"

How to view report in GA

Described in seomoz blog post section "Setting up Google Analytics"

Options

facebook - Facebook appId. Required if you want detect login status for facebook.com
vkontakte - Vkontakte appId. Required if you want detect login status for vk.com (aka vkontakte.ru)
ga - Google analytics site's ID. If you set it, it will load GA script, set `_setAccount` and `_trackPageview`.
callback - Callback function. Set it if you don't want to report to GA, but process it manually

TODO

  • add detection of another social networks
Something went wrong with that request. Please try again.