Collecting Twitter handles from users is straightforward: create a custom field, ask for the handle. But collecting links to Facebook or LinkedIn profiles is more tedious, since most people don't remember their shortlinks offhand, and probably even more people aren't even aware that they can choose a shortlink in the first place. Thus, their profiles have long, immemorable URLs like


We want to be able to link to these pages from membership directories, participant reports, and so on, but the challenge for the membership manager is how to collect them efficiently.

We encouraged with one group for people to add the URL of their LinkedIn or Facebook profile as a "website" field, but there was little or no uptake. Worse, we felt it disrupted the membership application process by sending someone not only offsite, but to a distracting social network where they might forget about their signup.

Is there an extension or other mechanism whereby someone could click, on a profile, click on a button and have their profile ID for either service entered? Or on the flip side, is there any way for a profile to pull Facebook or LinkedIn information, so that data like name, email address, employer, and birthdate could be pre-populated during event or membership registration?

There's some CodeCamp 2007 code and Social CRM ideas from 2011 on the wiki, but doesn't seem to be much that's been built.

To clarify, the ultimate goal is to allow members to provide a link to their Facebook and LinkedIn profiles on a "member profile" page on a Drupal site, though a CMS-agnostic solution would naturally be preferable. It does not have to be the Fb shortcut; the unique user ID number is fine and even preferable; it just needs to be someone we can use to create a URL that a button can link to.

Importing OAuth information from the CMS seems to be the way to go, though this complicates matters when trying to list people who do not want to use delegated authentication on the site.


5 Answers 5


The http://Attentive.ly CiviCRM integration automatically returns the social media accounts that match with over a hundred social media sites including Twitter, LinkedIn, Facebook, Google+, Klout, etc., as well as social listening on relevant recent posts to Twitter and Facebook. It does a lot more to help improve your organization's online engagement with top influencers (meaning those that have a high Klout score). The service is not free, and works best for organizations that have at least 25,000 - 50,000 contacts. See https://civicrm.org/extensions/attentively-integration.

  • Unfortunately this extension is no longer supported or maintained. Commented Jan 8, 2021 at 16:40
  • 1
    Attentive.ly was bought by Blackbaud who shut down the API used by the extension, so we marked extension as no longer maintained.
    – Joe Murray
    Commented Jan 18, 2021 at 0:57

Joomla contains a set of packages for connecting to social sites (Facebook, LinkedIn, Google, Twitter, Github, there may be more). If you are using Joomla you can instantiate one of these to collect the link data as well as other data the user authorizes, just as you see a lot of places you make a button to submit the request to whatever api it is. They all follow the same pattern, once you do it once it should be easy to do additional ones.


For FB, if the user entered the big ugly profile.php URL, you can get the shortlink (and profile pic) very easily using the Graph API, like this: http://graph.facebook.com/4?fields=link,picture. In our example, 4 is the user ID for Zuckerberg. If you have some JavaScript skills you could add a button to your contact template that allows the user to convert this. If not, your membership manager can just paste the URL into a browser location bar with the correct ID, press enter, and then copy-paste the short link and/or profile photo. You don't even need to be logged into FB to do this.

Edit: After some more reading, the Graph API has deprecated the option to get the pretty username link for the logged in user. Every user now gets a unique id for every FB app. So that part kind of stinks and makes my lookup idea unreliable. To make up for it, here is a bit of JS to get you started with your FB button on the profile:

  window.fbAsyncInit = function() {
      appId      : 'your app id here',
      xfbml      : true,
      version    : 'v2.3',
  status     : true

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

CRM.$(function($) {

    FB.api('/me', {fields: 'first_name,last_name,address,birthday,email,picture{url},link'}, function(response) {



  • Thanks. We wouldn't mind retrieving and storing the unique Facebook ID— arguably, it would be better. But simultaneously for people who have chosen a handle/shortlink, it's not easy to find, and whatever it is that we store, the ideal would be a one-click solution.
    – choster
    Commented May 19, 2015 at 14:42

I would definitely agree with @Elin - the cleanest solution is to request the user Oauth/login to the respective service. In drupal there are many modules to do this (e.g. Drupal Oauth, Oauth connector, 3rd party services like Janrain or my favorite: HybridAuth)

Many provide Drupal rules integration or tokens which can even be added to civicrm (with the civicrm_entity module for example.)

The best part about getting the user to authenticate is you can access additional info like their user image, post to their wall, etc.

I've used Facebook Autopost for example, to post new events on behalf of users.


There are two social media integration projects for this summer's Google Summer of Code. See https://civicrm.org/blogs/achia/social-media-integration-civicrm-ii (and posts on the http://forum.civicrm.org/index.php/topic,36315.msg155084.html#msg155084 forum thread) and http://forum.civicrm.org/index.php/topic,36059.0.html. Although both have been accepted, I'm not sure how much activity has occurred on the latter project. Various students are starting their work at various times, but I think s0014 should be posting by now.

I'd encourage working with the students and their mentors to try to ensure their work meets your needs. BTW, what are/were the criteria for awarding the bounty?

  • I'm basically asking if there's a way to collect whichever identifier is necessary to create a link to someone's Facebook or LinkedIn profile. For instance, the fbid number would be fine e.g. 4, or the shortlink would be fine, e.g. zuck, whether it is populating a field by clicking on a link or copying it from OAuth credentials stored in the CMS, or by some other mechanism.
    – choster
    Commented May 25, 2015 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.