You are here

function facebook_tracking_pixel_user_insert in Facebook Tracking Pixel 8

Same name and namespace in other branches
  1. 7 facebook_tracking_pixel.module \facebook_tracking_pixel_user_insert()

Implements hook_user_insert().

File

./facebook_tracking_pixel.module, line 589
facebook_tracking_pixel.module Facebook Tracking Module.

Code

function facebook_tracking_pixel_user_insert(&$edit, $account, $category) {
  $registration = variable_get('facebook_tracking_pixel_user_registration_enable', FALSE);
  if ($registration) {

    // We add the FBID to a session variable.
    $basecodeid = variable_get('facebook_tracking_pixel_user_registration_basecode');
    $base_code_fbid = db_select('facebook_tracking_pixel_base_codes', 'c')
      ->fields('c', [
      'base_code_fbid',
    ])
      ->condition('base_code_id', $basecodeid, '=')
      ->execute()
      ->fetchField();
    facebook_tracking_pixel_add_session_event('registration');
    facebook_tracking_pixel_add_session_event('registration_fbid', $base_code_fbid);
  }
}