Listening to Social Events on your site

In most cases you will need to add some additional JavaScript code to your current social implementation to allow BlueConic to listen to events like 'Facebook like' or 'Twitter tweet' on your website. Once you do that though you will be able to use these Social Events in BlueConic listeners.

All four listener types allow you to create 'Social Event' rules, which will add, set, or merge the value of a profile property or update scoring models if an event in the specified social media is detected.  Standard supported events are

  • Facebook Like / Unlike
  • Google Plus One
  • Linkedin SHare
  • Twitter Follow / Tweet

Each of these social events require a specific social implementation. See below for the preferred implementation per social channel.

If you are using a social container like Gigya or AddThis then you can find details on how to integrate in separate articles. How to integrate with the AddThis social container is described here. Integrating with Gigya's social container is described here.

Additionally, BlueConic offers a JavaScript Event API, which you can use to publish any (custom) event to BlueConic.


Facebook Like / Unlike

Listening to Likes and Unlikes will, in most cases, work without additional code if the buttons have been implementated on your site using the 'HTML5' or 'XFBML' variant of the like button plugin.

If this is not the case, then see the example below for the preferred implementation.

window.fbAsyncInit =function(){
    FB.init({
        appId  :'sensored-app-id',
        status :true,// check login status
        cookie :true,// enable cookies to allow the server to access the session
        xfbml  :true// parse XFBML
});

// Subscribe to the Like event FB.Event.subscribe('edge.create',function(response){
window.blueConicClient.event.publish('facebook like',[response]);
});

// Subscribe to the UnLike event FB
.Event.subscribe('edge.remove',function(response){
window.blueConicClient.event.publish('facebook unlike',[response]);
});
};

(function(){
var e = document.createElement('script');
e
.src = document.location.protocol +'//connect.facebook.net/fi_FI/all.js';
e
.async =true;
document
.getElementById('fb-root').appendChild(e);
}());

 

Twitter Follow / Tweet

If your implementation is based on 'Twitter for Websites' JavaScript, then in most cases you will not have to add additional code to be able to listen to Follow and Tweet events in BlueConic.

 

Google +1

Will always require additional code.

gapi.plusone.render(id, {
lang : "en-US",
         parsetags : "explicit",
         "callback" : function(response) {
window.blueConicClient
.event.publish('google plus one',[response.href])
}

});

 

LinkedIn Share

Will always require additional code.

<script type="text/javascript">
window.bcLinkedInCallBack = function(response) {
window.blueConicClient
.event.publish('linkedin share',[response.href])
}

</script>
<script type="IN/Share" data-url="..." data-counter="right" data-onSuccess="bcLinkedInCallBack"></script>