リアルユーザー監視 - カスタムAPI
                        
                        カスタムAPIはユーザーID、Javaスクリプト(JS)エラー、セッションタイムアウトの特定などの動的な値の設定に用いられます。このドキュメントでは、カスタムAPIで使用できる各タイプや構文について紹介します。
                        
                        最新のリアルユーザー監視スクリプトがデプロイされているかを確認してください。
                        利用できるAPI:
                        
                            - カスタムユーザーID
- カスタムブレッドクラム
- コンソールイベントの追跡
- キーワード難読化の無効化
- 最大セッションタイムアウト期間
- 現在のセッションの終了
- JSエラーの取得
1. カスタムユーザーID:
                        デフォルトでは、RUMスクリプトで一意なユーザーIDが作成されます。ユーザーIDをカスタマイズしたい場合は、次の構文を用います。
                        メトリックの追跡やユーザー特有の問題のデバッグに役立てられます。
                        構文:
                        /**
 * @param {String} RUM API to set user name
 * @param {String}
                            Unique user identifier to be sent to site24x7 RUM
 */
                            s247r('userId',"user@example.com")
                        2. カスタムブレッドクラムの追加:
                        カスタムブレッドクラムを設定してJSエラーの特定を容易にします。
                        構文:
                        /**
 * @param {String} RUM API to add breadcrumbs in error
                            reporting
 * @param {String} Breadcrumbs to be sent to site24x7 RUM error reporting
                            */
 s247r('addBreadCrumbs',"setTimeoutFunction");
                        3. コンソールイベント(JSエラー)の追跡:
                        デフォルトで、コンソールイベントは追跡されません。次のAPIを使用して追跡するように設定します。これはJSエラーブレッドクラムのコンソールイベントの追跡に用いられます。
                        構文:
                        /**
 * @param {String} RUM API to track console events
                            {WARNING,LOG,ERROR,INFO} to view in breadcrumbs
 * @param {Boolean} enables tracking
                            console events . Default value is false .
 */
 s247r('trackConsoleEvents',true);
                        4. キーワード難読化の無効化:(一般)
                        デフォルトでは、トランザクション名の英数字のキーワードは難読化されています。例えば、トランザクション名"home/site24x7.html"は"home/site*x*.html"となります。キーワードの難読化を無効化するには、次のスニペットのように文字列をコンマで分けます。
                        
                        構文
                        /**
 * @param {String} RUM API to exempt keywords
 * @param {String}
                            Comma separated strings to be exempted
 */
 /** in the below example, txns containing
                            site24x7 and real-user-monitor will be exempted from obfuscation*/
                            s247r('exemptKeywords','site24x7,real-user-monitor');
                        5. 最大セッションタイムアウト期間:(ユーザーセッション)
                        デフォルトでは、900000 ( 15*60*1000、15分)にセッションタイムアウトは設定されています。次のJSスニペットでこれを変更できます。
                        構文:
                        /**
 * @param {String} RUM API to manually set the maximum session
                            duration
 * @param {Number} Session duration in millis 
 */
 /** in the below
                            example the timeout is set to 1min ( 1*60*1000 )*/
 s247r('maxSessionDuration',60000);
                        
                        6. 現在のセッションの終了:(ユーザーセッション)
                        現在のセッションを終了し、新規セッションとして次のページ移動を開始するには、次の構文を使用します。
                        構文:
                        /**
 * @param {String} RUM API to end the current session 
 */
                            s247r('endCurrentSession');
                        site24x7RumApiEndPoint:(ユーザーセッション)独自のサーバーを介してSite24x7にペイロードをプロキシするためのURLを指定するオプションです。
                        構文
                        /**
 * @param {String} RUM API to set the api endpoint 
 * @param
                            {String} url for the api endpoint 
 */
                            s247r('site24x7RumApiEndPoint','https://localhost:6443');
                        7. JSエラーの取得:(JSエラー)
                        次のスニペットを用いると、JSエラーは手動で取得されSite24x7 RUMサーバーに送信されます。グローバルなエラーハンドラーによるエラー送信の際に一部的に役立てられます。
                        構文:
                        try{
 unKnownFunction();
 }
 catch(err){
 /**
 * @param
                            {String} RUM API to manually capture js errors
 * @param {Error} Error object for
                            site24x7 error reporting
 */
 s247r('captureException',err);
 }
                        各SPAフレームワークのコードスニペット:
                        Angular JS
                        angular.module("app").factory('$exceptionHandler',['$log', function($log)
                            {
 return function myExceptionHandler(exception, cause) {
 $log.warn(exception,cause);
                            
 s247r('addBreadCrumbs',cause);
 s247r('captureException',exception);
 };
 }]);
                        
                        Angular 2
                        import { ErrorHandler, Injectable} from '@angular/core';
                            @Injectable()
 export class GlobalErrorHandler implements ErrorHandler {
                            constructor() { }
 handleError(error) {
 s247r('captureException',error);
 }
 }
                        
                        VueJS
                        Import Vue from 'vue';
 Vue.config.errorHandler = (err, vm, info) =>
                            {
 //component in which error occured
 s247r('addBreadCrumbs',vm);
 //info Vue
                            specific error information such as lifecycle hooks,events etc
                            s247r('addBreadCrumbs',info);
 s247r('captureException',err);
 };
                        カスタムエラーメッセージの取得:
                        var error = new Error("my custom error message");
                            s247r('captureException',error);