Skip to Content
Product Information
Author's profile photo Rashmi Angadi

SAP Web Analytics: Analytics on your Fiori Launchapad with new plugin code

[UPDATE: March 2022] : SAP Web Analytics is scheduled to be retired as of August 31st, 2022. It will be available until the end of the current subscription term. It will not be available for renewal terms that begin after the retirement date.


Every Site Owner is interested in seeing the  website usage, performance, across which regions, browsers, operating systems its being widely used. Web Analytics is one such solution which has integration with S4 On premise systems and site owner can achieve the analytics through fiori launchpad.

SAP Web Analytics is a Software-as-a-service (SaaS) on the Business Technology Platform(BTP). The application lets you collect, report, and analyse your website usage data that helps you to identify meaningful patterns from various digital channels. The application can offer insights on how well your websites perform in key channels. These insights can lead you to implement critical improvements that help you optimize web usage to measure organisational goals, drive strategy, and improve the overall user experience of your web applications.


Purpose and Solution

Many customers already using “Web Analytics” are facing issue with the page title and also some of the FLP apps not being tracked which is because ui5 “routeMatched” is not triggered for some of the FLP apps leading to incorrect page title of apps and thus incorrect report data for some apps.

UI5 supports routeMatched Event from 1.65 version and above. This does a similar thing as hashChange but for some of the application this event is not triggered as its application construction dependent. This is the drawback for SWA as for some of the applications load event is not triggered which somehow differentiates and lead us to data incorrectness.

This has been solved with latest ui5 releases from 1.92.0 version onwards and also by changing the custom plugin code if users are using custom code and not standard ui5 code  with the new one as explained in the below sections.

appOpened is a UI5 event which should be subscribed explicitly and on click of any app this appOpened event is triggered which gives insights like type of application, text of app, url does it rendered on new window and so on.


Custom Plugin Code

init: function () {
var oPluginParameters = this.getComponentData().config; // obtain plugin parameters

var SWA_PUB_TOKEN = "", TRACKING_URL = "", USR = “”;

//Read the variables and pass them

SWA_PUB_TOKEN = oPluginParameters.SWA_PUB_TOKEN;

TRACKING_URL = oPluginParameters.SWA_BASE_URL;

if (oPluginParameters.SWA_USER === 'true')

USR = sap.ushell.Container.getUser().getEmail();

if(SWA_PUB_TOKEN !== "" && TRACKING_URL !== ""){

var snippetVariables = [SWA_PUB_TOKEN,TRACKING_URL,USR];



/*Subscribing to App Opened Event */


if(appMeta.navigationMode == "newWindow") {
window.swa.pageTitle =appMeta.text;

//callback function to set pagetitle

anonymiseCallBack: function(){
var anonymisedObject = {};
if(window.swa.pageTitle != undefined && window.swa.pageTitle !="")
return anonymisedObject;

loadSWAObject: function(snippetVariables) {
window.swa = {
pubToken: snippetVariables[0],
baseUrl: snippetVariables[1],
owner: snippetVariables[2],

var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.defer = true;
g.async = true;
g.src = window.swa.baseUrl+"js/track.js";
s.parentNode.insertBefore(g, s);
window.onhashchange = function () {
var hashVal=window.location.hash;
var sOldShellHashLowerCase = hashVal.toLowerCase();
//All option to verify that we're navigating from the home page
var bNavigateToHomepage = sOldShellHashLowerCase.indexOf("shell-home") >= 0 ||
sOldShellHashLowerCase.indexOf("launchpad-openflppage") >= 0 ||
sOldShellHashLowerCase.indexOf("shell-appfinder") >= 0;
if (bNavigateToHomepage){
if( sOldShellHashLowerCase.indexOf("shell-appfinder") >= 0)
window.swa.pageTitle = "App Finder";
window.swa.pageTitle ="";



After you deploy this code, all the FLP apps would be tracked correctly with right page title.



After going this blog and implementing the code for your application, the FLP apps will be tracked appropriately and analyse different kind of analytics reports for your FLP applications.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vincent Lee
      Vincent Lee

      it's a shame to see the Web Analytics Service retired. So now it's left to third party Google Analytics.

      I heard in Cloud ALM and FRUN they have 'Real Usage Monitoring'; so it would be good to have this from SAP and Customer perspective. Fiori usage metrics has always been a pain to gather (and make human readable). There is a third party plug-in on Fiori Tracker, but I've not used it.