cancel
Showing results for 
Search instead for 
Did you mean: 

Google Analytics and SAPUI5: click events tracking possible?

danreg
Product and Topic Expert
Product and Topic Expert
0 Kudos

HI folks,

I assume that with Google Analytics a "simpe" user access count is possible for a SAPUI5 app. I'm curious to know whether a profound and granular tracking/reporting is possible here with Google Analytics + SAPUI5. Suppose I have a simple app hosted on HCP. I have several xml views with diverse buttons wherefrom one can access a pdf document or other pages. I'd like to track these clicks, i.e. how many times users accessed this document. Please advise. What would one need to adapt if it would look like below.

Appreciate your support and tips. Thanks and regards

button in xml view:

<Button type="Emphasized" text="Emphasized" press="onPress" />

controller:

onPress: function() {

  window.open("./docu/testdoc.pdf", "_blank");

  },

View Entire Topic
Qualiture
Active Contributor
0 Kudos

Hi Daniel,

It is possible using Google's event tracking mechanism Event Tracking - Web Tracking (ga.js) - Google Analytics &amp;mdash; Google Developers

So your code would be like :

onPress: function(oEvent) {

     _gaq.push(['_trackEvent', 'Documents', 'ButtonPress', 'Show Test Document']);

     window.open("....");

}