Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
[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.

Introduction

Almost all of the SAP S4 on Premise customers want to see how is the usage of their applications, which are the regions the applications widely used, what is the performance over time, on which browsers it is mostly used and what is the trend of visitors, from which external links people are using applications and so on.“SAP Web Analytics” is the desired solution to achieve the above scenarios.

SAP Web Analytics is a Software-as-a-service (SaaS) on the Business Technology Platform(BTP). The application lets you collect, report, and analyze 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 organizational goals, drive strategy, and improve the overall user experience of your web applications.

This solution is integrated with Fiori Launchpad which enables the FLP owner to do analytics on their applications.

 

  1. Web Analytics Set up


Follow the below steps to set up “SAP Web Analytics” and the S4 system

  • Go to Subscriptions menu in your desired subaccount on the Business Technology Platform and subscribe to “Web Analytics”. Web Analytics is hosted both on AWS and Microsoft azure in different regions like Europe,Australia,Singapore,US East,US West,Japan.


 


Web Analytics


 

  • Once subscribed Go to Role collections menu under Security and create a Role Collection and then edit the Role collection created and add the role that has _WebAnalyticsAdmin and assign users to the role collection. This step enables the users added to this role to act as Customer Admins who can create “Web Analytics” specific tenants called Spaces.


 


Role


 

  • Now click on “Go to Application” on the “Web Analytics” tile and land to the Space Management page. Click on Add Space and create a new space and add the required users to the space who can add as “Space Admins”.



Space Management


Note: User Id here can be email address or the employee id (if custom IDP) and user name is the Employee Name.

 

  • Go and create site now in “Site Management”. Enter the website as the domain name of your FLP application


Site Management


Once the site is created a pubtoken and baseurl are generated which need to be copied to s4 system entries.

Refer to the below blog for more details on “Site Settings”

Site Configuration

 

 2. On Premise System Set up

 

  • Check the ui5 version of your FLP by typing ui.version on the Console option of your developer tools.



UI5 Version


 

  • Login to your On Premise System and enter the transaction code


/n /UI2/FLP_CONF_DEF and click on “Define LaunchPad Plug Ins”

Create a new Plugin here giving unique plugin id and description. If  ui5 version is greater than or equal to 1.77.0 then give UI5 Component Id as “sap.webanalytics.core.SAPWEBANALYTICSFLPPLUGIN” and save .

 


Plugin Details


 

  • If version is lesser than “1.77.0” then set up your code as below in any of the IDE ie WEB IDE or Business Application Studio whichever is integrated with your onpremise system. Use the code from screen shots and add to component.js of the application and deploy to SAP ABAP repository from webide using UI and Business studio using abap-deploy command.



 




  • Replace SWAFLPPlugin with the UI5 Component Id which you give while creating the launchpad plugin and the url has to /sap/bc/ui5_ui5/sap/Name of the application you deploy to ABAP Repository. Save the Plugin  and verify its status which has to be active.


 


 

  • Add the properties to the plugin by selecting the created plugin in last step and then click on “Define Properties”.


SWA_BASE_URL and SWA_PUB_TOKEN are the mandatory properties to be created.

Other properties are SWA_USER,SWA_CONSENT_STYLE,SWA_CONSENT_LANGUAGE etc and their description is available at our help link

https://help.sap.com/viewer/e342b49c78c74d4e8ebc00700a791aee/Cloud/en-US/ff912905772d4fa5a3f0ddf2a3c...


 

Note: While adding the properties “Property Path” is mandatory which can be a value of string type.

 

Table 1.0 FLP Snippet Properties

 











































Property Description Data type and values


SWA_BASE_URL

 
 This is the tracker url generated from snippet when a site is created. String


SWA_PUB_TOKEN

 
 This is the unique generated if from snippet when a site is created. String
SWA_CONSENT_STYLE Option to display the consent text in the form of banner,pop up or banner at the bottom String(banner,bannerbottom,popup)
SWA_CONSENT_LANGUAGE If default consent banner is selected user can give the language code for this value and then banner text appears in the defined language.

String(ar,bg,cs,ca,fr,hi,en_US,

en_GB,de,el,es,

zh_CN,zh_TW,vi,uk,th,tr,sh,ro,kk,hu,nl)
SWA_PRIVACY_LINK Privacy Statement of the site can be stored in a url which can be passed here so that it gets appended at the end of consent text in banner or pop up. String(It has to be a url)
ANON_TRK_ON_DENY To Provide users an option of anonymous tracking. Boolean(true/false) true for Anonymous Tracking
 SWA_USER  If the information of the user who is being tracked is required this field is necessary. Boolean ie true/false

 

  • Open the transaction /UI2/FLP_CUS_CONF and then assign the values to the created properties by adding new entries.


Copy the pubtoken and base url from site snippet properties(site management of “Web Analytics”) and paste them in SWA_PUB_TOKEN and SWA_BASE_URL respectively.

Alternatively other attributes specified in the above table 1.0 FLP Snippet Properties can be set according to the need.


 

Once everything is set open the FLP and enjoy “Web Analytics”.

 

 

3. Troubleshooting Tracking in FLP

If usage is not being tracked even after setup open the “Developer tools” and try the below things.

  • Check if any console errors are present and try to resolve if syntax errors.

  • Go to Network tab reload the browser and check if “Component.js” is loading or not. If not check the path of plugin in s4 system and check if plugin is active.

  • Verify if preferences api is returning 200 OK response and if response says “Invalid pub token” Kindly make sure you copied the right pub token in the entry SWA_PUB_TOKEN.

  • If track.js is loaded but tracking is not working then need to check the site settings, site domain or is it a gateway system.


 

Conclusion


After going through this blog post you should be able to subscribe "Web Analytics" from SAP Cloud Platform and configure the FLP website (s4 on premise system) and analyse different kind of analytics reports for your FLP applications.

 

 

 

 

 
8 Comments
timjones
Explorer
0 Kudos
Hi,

I have followed this blog but I'm getting a console error.

sap.webanalytics.core.SAPWebAnalyticsFLPPlugin: No descriptor was found



Has anyone else seen this error and know where I've gone wrong?

Cheers,

Tim J.

 
nipun_madan
Advisor
Advisor
0 Kudos
Hi Tim,

Please check if you have set SWA_BASE_URL correctly. The above error indicates that the SWA_BASE_URL is not set.

 

With Regards,

Nipun
timjones
Explorer
0 Kudos
Hi Nipun,

 

The values for SWA_BASE_URL and SWA_PUB_TOKEN match those from the snippet in WebAnalytics.

 

Is there anything else that could be causing the issue?

 

I've raised a ticket directly with SAP about this too.

 

Cheers,

 

Tim J.
amar786
Explorer
0 Kudos

Hi Rashmi, is web analytics still being retired as of August 31, 2022 per the below blog?

Tracking Portal site & App usage via SAP Web Analytics in SAP Cloud Platform | SAP Blogs

0 Kudos
Hi Amar,

 

Yes 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.
0 Kudos
Hi Tim,

Check by debugging your code if values for SWA_BASE_URL and SWA_PUB_TOKEN  are fetched. If the values are empty this error comes.

Is your system a gateway system if so hard code the values for SWA_BASE_URL and SWA_PUB_TOKEN  in your code.

Regards,

Rashmi
timjones
Explorer
For info this ended up being an issue with our on prem version of SAPUI5. 1.90 is broken fixed when we updated to 1.96 or 7.
timjones
Explorer
0 Kudos

Hi Rashmi,

 

Are SAP replacing this with a new service?

It took me 6 months to get SAP to figure out the SAPUI5 version was causing my issue and now we have updated, it will be disappearing?!?

What does the term  "It will be available until the end of the current subscription term" mean?

How long can I get use out of this and to find a suitable replacement?

 

Thanks in anticipation,

 

Tim J.