You are here

function fb_social_fb_social_event_subscribe in Facebook social plugins integration 7.2

Implementation of hook_fb_social_event_subscribe

File

./fb_social.module, line 734

Code

function fb_social_fb_social_event_subscribe() {

  // integration with google analytics
  if (module_exists('googleanalytics')) {
    global $user;
    $id = variable_get('googleanalytics_account', '');
    if (!empty($id) && _googleanalytics_visibility_pages() && _googleanalytics_visibility_user($user)) {
      return array(
        'FB.Event.subscribe("edge.create", function(href, widget) {',
        '_gaq.push(["_trackEvent", "Facebook like", "Drupal", href]);',
        '});',
      );
    }
  }
}