Why Web Analytics for Business Apps?
If you want to gather Usage data for your business apps, Web Analytics Software provides useful insights and answers to questions like
- How many Users are using the App?
- What is the Users Average Visit Duration?
- Where do User come from (geographically)?
- What End-Devices is your App used with?
- What actions were done by Users within your Apps?
- How can individual Event within the App be tracked?
- … and much more
To define performance and success metrics for your business apps gives you the opportunity to track, measure and report Key Performance Indicators (KPI) that fuel the Return on Investment of your App.
- Simplifier Server with a Business App that you want to get Usage Insights on
- Web Analytics Software e.g. Matomo, Google Analytics, SAP Web Analytics or similar
- In this example we will look at Matomo Analytics, which is Open Source and provides lots of Insights for Web / Mobile Application Usage.
For more information on Matomo please have a look at the Matomo Website
Step 1 – Get the tracking Code
Depending on the Web Analytics Software of your choice, login to Matomo backend and acquire the JS Tracking Code. The Tracking code looks like this:
We will copy this code to the Clipboard and create a new Client-Side Business Object on your Simplifier Server. Let’s call it “MatomoAnalytics”. Now we create a new function within the Business Object called “initTracker”. We will need to Input Parameters named “siteId” and “matomoURL” of type “String” that we will use within our function’s code:
Next up we will paste in the Tracking Code that we copied earlier without the script tags which will look like this:
Now we will replace the attributes “setTrackerUrl” and “setSiteId” with our previously created input parameters. Input parameters of Client Side Business Objects can be accessed via “oPayload.nameofParameter” so in our case: oPayload.matomoURL and oPayload.siteId
We can now set the input parameters value to our siteID and the URL of Matomo Installation:
Now that we have our initTracker function ready, we create another function within our Client Side Business Object, let’s call it “trackEvent” and create the following input parameters:
All Events that we want to track will be triggered through the follwing code:
_paq.push([eventType, eventCategory, eventAction,eventName]);
in our case we will use the created input parameters to be able to use them as variables like so:
_paq.push([oPayload.event, oPayload.category, oPayload.action,oPayload.name]);
E.g. to track a search:
_paq.push(['trackEvent', "Search", "input",searchValue]);
Within our App that we want to gather Usage Statistics for we simply call the “initTracker” function of our Business Object “onInit” of our first Screen to initalize the tracker:
Now everytime we want to track a certain event, we just call the “trackEvent” function of our Client Side Business Object and pass in the values we want to track:
When we use the search within our App for example this will be tracked and appear on the Matomo Analytics Dashboard:
That’s it, now you can go ahead and extend this example to track all kinds of Events within your App. Have Fun!
Leave A Comment
You must be logged in to post a comment.