SAP for Utilities Blogs
Discover insights and practical tips to optimize operations, reduce costs, and deliver reliable energy with SAP technology. Contribute your own blog post!
Showing results for 
Search instead for 
Did you mean: 


Web application analytics provide means to collecting information about customers’ usage patterns in a web application. Many web analytics providers exist, e.g. Google Analytics, Mixpanel, SAP Web Analytics. In this blog I will review the fundamentals of analyzing the data that can be gathered using any of these providers. This data can prove to be invaluable in understanding what features in an application matter to the consumer and how to optimize the application for a particular audience.

The examples outlined in this blog were all performed on our Mutlichannel Foundation mobile application. This responsive mobile application was built with SAPUI5 and integrates well with SAP Web Analytics.

Tracking Data in a Web Application

In order to track analytical data you will need to make use of one of the many web analytic software providers that exist. The exact process of tracking user behavior in a web application differs by provider, but generally a JavaScript snippet is provided that you will have to insert into the index html file of the application. Typically this will load a JavaScript library to collect and send information to the server where data resides. Using SAP Web Analytics the code snippet belongs before the closing </html> tag in the index.html of the application and will be similar to the following,

     var swa = {
          pubToken: '12345678-9012-3456-7890-123456789012',
          baseUrl: ''
          var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
          g.type='text/javascript'; g.defer=true; g.async=true; g.src=swa.baseUrl+'js/privacy.js';

Many use cases require tracking individual events as well, for example when a user clicks on a particular product. This can be accomplished by inserting JavaScript code throughout the application where appropriate. Typically this will consist of a JavaScript function call with parameters that identify the event you wish to track.

Whichever provider you use, you can import the data to SAP Lumira. This can be done via an excel spreadsheet containing the raw analytic data or via directly importing data from a SAP HANA One server.

Example Use Cases

Channel Analytics:

It’s very easy to identify what channels customers are using with web analytics. Generally you will have this information from whichever provider you use without having to set up custom events.

Once the information is imported to SAP Lumira, we can create a simple graph by choosing the appropriate X and Y axes, as shown in the following figure. This gives us a simple graph that clearly shows the popularity of the application through different channels.

We can expand this graph and add some information about the different operating systems used on each channel by adding the appropriate data dimensions to the X Axis. An example of such a chart is shown below.

Favorite Products:

Another example use case is to find out the favorite products. This can be done by tracking the event when a customer selects a utility product for his new service, it is useful to be aware of which products are the most popular ones and which ones are less popular.

In this use case, custom tracking events must be handled. Whichever web analytics provider you use will provide documentation for the function call to track an event properly. Normally you will provide both the event type and event propertie(s). In this example, we want to track the event “Product Selected” that has a property “ProductName” with the value of the chosen product ID. In a SAPUI5 application, this analytic function call could be placed in the controller for the view, likely in an event handler for a button press or dropdown box select. With SAP Web Analytics the function call might look like this,

swa.trackCustomEvent("ProductSelected", "PROD_ID_1");

Using a line graph with X and Y axes chosen as shown below, we can track which products are most popular over time.

Guided Procedure:

One last example is a situation where you have a guided procedure in your application. For example, a procedure with several steps to complete a task, and you want to find out what is the overall success rate and also what is the dropout rate at each step. This information will help you to identify the problematic step, and improve it to obtain a higher success rate of task completion by the end users. A simple approach is to include custom events for some "GuidedProcudure" event with a "ProcedureStep" property that can be one of Step1, Step2, Step3, or Submit. Additionally, one more property, "Successful," is included in "Submit" events and can be either Success or Failure. More complicated ways to track a procedure like this exist, such as tracking progress through the procedure by individual user, but vary a lot depending on the provider.

If the events for each step of the procedure are sent upon loading the view for that step, and events for submit/success/failure sent upon a callback from submitting the data to the backend, we will have a rough approximation of the users flow through the procedure based on view count. Plotting this data in Lumira with X and Y axes, the results look like the following.

Many more use cases can be covered by analyzing gathered data and adding more custom events to certain areas of the application. You may want to analyze page views on pre-login vs post-login pages, or you might add events that provide information about which application pages are visited most often. All of these possibilities will prove to provide valuable information about a web application.

Further Information

- SAP Web Analytics is currently available as a prototype, the full version has not yet been released. In order to use some SAP Web Analytics features (like custom events) as well as use it in production you will need to wait for the release. Please see SAP Web Analytics for more details and to stay up to date.

- Documentation about SAP Lumira, especially regarding importing data into Lumira is available in the user guide here, SAP Lumira 1.25 – SAP Help Portal Page.