Facebook Pages Managed Source Enhancements

Jason | 2nd May 2014

Taking into account some great customer feedback, on May 1st, 2014 we released a number of minor changes to our Facebook Pages Managed Source.

Potential Breaking Changes

Facebook Page Like and Comment Counts have been Deprecated

The facebook_page.likes_count and facebook_page.comment_count fields have been deprecated from DataSift's output. We found this data became outdated quickly; a better practice for displaying counts of likes and comments in your application is to count like and comment interactions as you receive them.

Format for facebook_page.message_tags has Changed

facebook_page.message_tags fields were previously in two different formats dependant on whether they came from comments, or posts. This change ensures that all message_tags are provided in a consistent format; as a list of objects. An example of the new consistent format can be seen below:

{
  "facebook_page": {
    "message_tags": [
      {
        "type": "page",
        "length": 14,
        "offset": 9,
        "id": "166633653378799",
        "name": "Morgan Maassen"
      },
      {
        "type": "page",
        "length": 12,
        "offset": 44,
        "id": "34778334225",
        "name": "Kelly Slater"
      }
    ]
  }
}

Please ensure that if your application utilizes these fields, it can handle them as a list of objects.

New Output Fields

We have introduced a number of new output fields in interactions from the Facebook Pages Managed Source. You will be able to filter on many of these fields.

New “Page Like” Interactions

By popular request, we have introduced a new interaction with the subtype “page_like” for anonymous page-level likes.

This should now allow you to track the number of likes for a given page over time.

{
  "source": {
    "id": "dd25d4f749dd4d858473d21115dd176d"
  },
  "interaction": {
    "type": "facebook_page",
    "subtype": "page_like",
    "received_at": 1398964317,
    "id": "1e3d153b38b7aa008374ffff93df62e3",
    "created_at": "Thu, 01 May 2014 18:11:57 +0100"
  },
  "facebook_page": {
    "page": {
      "id": "10376464573",
      "name": "Lady Gaga",
      "username": "ladygaga",
      "link": "https://www.facebook.com/ladygaga",
      "category": "Musician/band"
    },
    "likes_delta": 233,
    "current_likes": 65058303
  }
}

This subtype has two fields, current_likes and likes_delta. The first represents the current number of likes for a Facebook Page at the time of retrieval. The second represents the difference with the previously retrieved value. We only generate interactions of this type if likes_delta is not zero. Also note that likes_delta can be negative, when the number of unlikes is greater than the number of likes between two retrievals.

This interaction type should allow visualizing page likes as a time series. In addition, filters on likes_delta could be used to detect trending pages.

‘from' Fields now Include a Username Where Available

Where it is provided to us, .from fields in Facebook Pages interactions now contain a .username field.

{
  "facebook_page": {
    "post": {
      "created_time": "Tue, 04 Mar 2014 02:32:12 +0000",
      "from": {
        "category": "Musician/band",
        "username": "ladygaga",
        "name": "Lady Gaga",
        "id": "10376464573"
      }
    }
  }
}

Please note that in some cases, this field is not returned by Facebook.

New Comment ‘Parent' Field

Objects of type comment include an optional .parent object, which contains a reference to a parent comment. The object structure is self-similar.

This will allow you to tell whether comments are nested or not, and associate them with a parent comment if so.

{
  "facebook_page": {
    "parent": {
      "from": {
        "username": "john.smith.123",
        "name": "JohnSmith",
        "id": "1722345884"
      },
      "id": "101523572207836574_15983707",
      "message": "Happytohaveparentcomments!",
      "created_time": "Tue, 18 Mar 2014 02:38:22 +0000"
    }
  }
}

New ‘From’ Field in Post Objects

Objects of type comment/like include an additional .from field in their .post context object, which contains information about the author of the post they are referring to.

{
  "facebook_page": {
    "post": {
      "from": {
        "username": "ladygaga",
        "name": "Lady Gaga",
        "id": "10376464573"
      }
    }
  }
}

New CSDL Targets

We have introduced 12 new Facebook Pages targets. This includes targets to allow you to filter on the likes count of a page, the parent post being commented on, a Facebook user's username, and more. These new targets can all be found in our Facebook Pages targets documentation.

Other Changes

New Notifications for Access Token Issues

If a case occurs where all tokens for a given source have permanent errors, the source will become “disabled", and you will receive a notification. You should then update the source with new tokens, and restart it.

Note that every error will also be present in the /source/log for that Managed Source.

Summary of Changes

  • facebook_page.likes_count and facebook_page.comment_count fields will be deprecated from DataSift's output
  • The facebook_page.message_tags output field format is changing to become a list of objects
  • We are introducing a new interaction with the subtype “page_like” for anonymous page-level likes
  • .from fields in Facebook Pages interactions now contain a .username field where available
  • Comment interactions will now include a parent object, referencing the parent comment
  • We are introducing a .from field to Facebook Pages .post objects, containing information about the post author
  • We are introducing a number of new CSDL targets for Facebook Pages
  • You will receive better notifications about issues with your Facebook Access Tokens

Previous post: Platform Updates - Content Age Filtering, Larger Compressed Data Deliveries

Next post: How To Update Filters On-The-Fly And Build Dynamic Social Solutions