<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic EUM Custom Snippet Inconsistency Issues - Custom User Data is collected all the time in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/EUM-Custom-Snippet-Inconsistency-Issues-Custom-User-Data-is/m-p/720423#M2000</link>
    <description>&lt;P&gt;We have added custom snippet to track additional information like User and SAP FIORI application details. Whenever there is a Script error or AJAX error while loading an application, data that captured by custom snippet was not reflecting on to EUM dashboard. Sometimes the data is not collected even if there are no errors.&lt;BR /&gt;&lt;BR /&gt;We are not able to identify any particular reason for this inconsistency.&lt;BR /&gt;Below is the code we have added in the custom snippet.&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;&amp;lt;script charset="UTF-8" type="text/javascript"&amp;gt;

window["adrum-start-time"] = new Date().getTime();

function getCustInfo() {

    if (!!sap) {

        var userId = sap.ushell.Container.getService("UserInfo").getUser().getId();
        var userName = sap.ushell.Container.getService("UserInfo").getUser().getFullName();

        if(sap.ushell.services.AppConfiguration.getCurrentApplication() != undefined) {

            var AppTitle = sap.ushell.services.AppConfiguration.getCurrentApplication().text;
            var CompID = sap.ushell.services.AppConfiguration.getCurrentApplication().applicationDependencies.name;

            if (sap.ushell.services.AppConfiguration.getCurrentApplication().reservedParameters['sap-fiori-id'] == undefined) {
                var AppDevType = 'Custom'
            } else {
                var AppDevType = 'SAP'
                var AppID = sap.ushell.services.AppConfiguration.getCurrentApplication().reservedParameters['sap-fiori-id'][0];
            }
        }
    }
    return {
        "userId": userId,
        "userName": userName,
        "AppTitle": AppTitle,
        "CompID": CompID,
        "AppDevType": AppDevType,
        "SIB_APPID": AppID
    }
}

window['adrum-config'] = {
     userEventInfo: {
        "PageView" : function(context){
           return {
              userData: getCustInfo()
           }
        },
        "Ajax": function(context) {
           return {
              userData: getCustInfo()
           }
        },
        "VPageView" : function(context){
            return {
              userData: getCustInfo()
           }
        }
     }
 };

(function(config){
    config.appKey = "AD-AAB-ACE-TNP";
    config.adrumExtUrlHttp = "http://cdn.appdynamics.com";
    config.adrumExtUrlHttps = "https://cdn.appdynamics.com";
    config.beaconUrlHttp = "http://pdx-col.eum-appdynamics.com";
    config.beaconUrlHttps = "https://pdx-col.eum-appdynamics.com";
    config.useHTTPSAlways = true;
    config.resTiming = {"bufSize":200,"clearResTimingOnBeaconSend":true};
    config.maxUrlLength = 512;
    config.Isabapapp = true;
    config.page = { "title" : function title() { return document.title; } }
})(window["adrum-config"] || (window["adrum-config"] = {}));
&amp;lt;/script&amp;gt;
&amp;lt;script src="//cdn.appdynamics.com/adrum/adrum-23.3.0.4265.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 07:06:57 GMT</pubDate>
    <dc:creator>Arun_Bassa</dc:creator>
    <dc:date>2023-12-01T07:06:57Z</dc:date>
    <item>
      <title>EUM Custom Snippet Inconsistency Issues - Custom User Data is collected all the time</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/EUM-Custom-Snippet-Inconsistency-Issues-Custom-User-Data-is/m-p/720423#M2000</link>
      <description>&lt;P&gt;We have added custom snippet to track additional information like User and SAP FIORI application details. Whenever there is a Script error or AJAX error while loading an application, data that captured by custom snippet was not reflecting on to EUM dashboard. Sometimes the data is not collected even if there are no errors.&lt;BR /&gt;&lt;BR /&gt;We are not able to identify any particular reason for this inconsistency.&lt;BR /&gt;Below is the code we have added in the custom snippet.&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;&amp;lt;script charset="UTF-8" type="text/javascript"&amp;gt;

window["adrum-start-time"] = new Date().getTime();

function getCustInfo() {

    if (!!sap) {

        var userId = sap.ushell.Container.getService("UserInfo").getUser().getId();
        var userName = sap.ushell.Container.getService("UserInfo").getUser().getFullName();

        if(sap.ushell.services.AppConfiguration.getCurrentApplication() != undefined) {

            var AppTitle = sap.ushell.services.AppConfiguration.getCurrentApplication().text;
            var CompID = sap.ushell.services.AppConfiguration.getCurrentApplication().applicationDependencies.name;

            if (sap.ushell.services.AppConfiguration.getCurrentApplication().reservedParameters['sap-fiori-id'] == undefined) {
                var AppDevType = 'Custom'
            } else {
                var AppDevType = 'SAP'
                var AppID = sap.ushell.services.AppConfiguration.getCurrentApplication().reservedParameters['sap-fiori-id'][0];
            }
        }
    }
    return {
        "userId": userId,
        "userName": userName,
        "AppTitle": AppTitle,
        "CompID": CompID,
        "AppDevType": AppDevType,
        "SIB_APPID": AppID
    }
}

window['adrum-config'] = {
     userEventInfo: {
        "PageView" : function(context){
           return {
              userData: getCustInfo()
           }
        },
        "Ajax": function(context) {
           return {
              userData: getCustInfo()
           }
        },
        "VPageView" : function(context){
            return {
              userData: getCustInfo()
           }
        }
     }
 };

(function(config){
    config.appKey = "AD-AAB-ACE-TNP";
    config.adrumExtUrlHttp = "http://cdn.appdynamics.com";
    config.adrumExtUrlHttps = "https://cdn.appdynamics.com";
    config.beaconUrlHttp = "http://pdx-col.eum-appdynamics.com";
    config.beaconUrlHttps = "https://pdx-col.eum-appdynamics.com";
    config.useHTTPSAlways = true;
    config.resTiming = {"bufSize":200,"clearResTimingOnBeaconSend":true};
    config.maxUrlLength = 512;
    config.Isabapapp = true;
    config.page = { "title" : function title() { return document.title; } }
})(window["adrum-config"] || (window["adrum-config"] = {}));
&amp;lt;/script&amp;gt;
&amp;lt;script src="//cdn.appdynamics.com/adrum/adrum-23.3.0.4265.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 07:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/EUM-Custom-Snippet-Inconsistency-Issues-Custom-User-Data-is/m-p/720423#M2000</guid>
      <dc:creator>Arun_Bassa</dc:creator>
      <dc:date>2023-12-01T07:06:57Z</dc:date>
    </item>
  </channel>
</rss>

