You are here

function fb_social_like_fb_social_event_subscribe in Facebook social plugins integration 6.2

Same name and namespace in other branches
  1. 6 modules/fb_social_like/fb_social_like.module \fb_social_like_fb_social_event_subscribe()

Implementation of hook_fb_social_event_subscribe

File

./fb_social.module, line 693

Code

function fb_social_like_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]);',
        '});',
      );
    }
  }
}