static function record_user_event($event_type, $data)
 {
     $user = wp_get_current_user();
     $site_url = get_option('siteurl');
     $site_domain = str_replace('http://', '', $site_url);
     $data['_via_ua'] = $_SERVER['HTTP_USER_AGENT'];
     $data['_via_ip'] = $_SERVER['REMOTE_ADDR'];
     $data['_lg'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
     $data['blog_url'] = $site_url;
     $data['jpphp_vendor'] = self::$vendor_code;
     $response = tracks_record_event($user, self::$product_name . '_' . $event_type, $data);
     if (is_wp_error($response)) {
         error_log("There was an error: " . $response->get_error_message());
     }
 }
 static function record_user_event($event_type, $data)
 {
     $user = wp_get_current_user();
     $site_url = get_option('siteurl');
     $data['_via_ua'] = $_SERVER['HTTP_USER_AGENT'];
     $data['_via_ip'] = $_SERVER['REMOTE_ADDR'];
     $data['_lg'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
     $data['blog_url'] = $site_url;
     $data['blog_id'] = Jetpack_Options::get_option('id');
     // Top level events should not be namespaced
     if ('_aliasUser' != $event_type) {
         $event_type = self::$product_name . '_' . $event_type;
     }
     $data['jetpack_version'] = defined('JETPACK__VERSION') ? JETPACK__VERSION : '0';
     tracks_record_event($user, $event_type, $data);
 }
Ejemplo n.º 3
0
 static function record_user_event($event_type, $data)
 {
     error_log($event_type);
     $user = wp_get_current_user();
     $site_url = get_option('siteurl');
     $site_domain = str_replace('http://', '', $site_url);
     $data['_via_ua'] = $_SERVER['HTTP_USER_AGENT'];
     $data['_via_ip'] = $_SERVER['REMOTE_ADDR'];
     $data['_lg'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
     $data['blog_url'] = $site_url;
     $data['jpphp_vendor'] = self::$vendor_code;
     if (false !== ($bh_mm_test_value = get_transient('mm_test'))) {
         $data['bh_mm_test_key'] = $bh_mm_test_value['key'];
         $data['bh_mm_test_name'] = $bh_mm_test_value['name'];
     }
     $data['jps_version'] = defined('Jetpack_Start_EndPoints::VERSION') ? Jetpack_Start_EndPoints::VERSION : 9;
     $response = tracks_record_event($user, self::$product_name . '_' . $event_type, $data);
     if (is_wp_error($response)) {
         error_log("There was an error: " . $response->get_error_message());
     }
 }