Content-Level Analytics

Objective: understand how the content in yours app is performing. This helps you make better decisions about creating future content and to optimize your advertising strategy.

This functionality is not available in App Cloud Core. It is available only in App Cloud Pro and Enterprise.

App Cloud can now collect and display analytics on individual pieces of content within an application. Support for this is built into the out-of-the-box views, and developers can use the App Cloud API to instrument any custom views they create to record this information.

Results are displayed on each view detail screen in analytics in graph and tabular data form. Clicking on a title will display a graph of the activity for that piece of content.

Implementing Content Level Analytics

The bc.metrics.startContentSession and bc.metrics.endContentSession APIs allow an app developer to track how long a user interacts with a given piece of content. You will generally want to do this when the content comes into focus. For example if you would like to track how long a user spends on each photo in a slideshow the code might look something like this:

photoGalleryView.handleViewFocus = function( evt ) {
  if( this.indexOfCurrentImage !== undefined && bc.metrics !== undefined ) {
    bc.metrics.startContentSession( this.data[this.indexOfCurrentImage].media_content_url, this.data[this.indexOfCurrentImage].media_title );
  }
};

The first argument is a unique identifier, ideally a URI. The second argument is a human readable name used for display purposes.

If your content does not have an associated URI, then any unique identifier will work, but it must match the unique identifier that was passed into the bc.metrics.startContentSession function. Once the user has stopped interacting with that content, in this example lets say they swiped to the next photo, then we need to call bc.metrics.endContentSession. Code for this might look like:

photoGalleryView.handleViewBlur = function( evt ) {
  //If we have a article viewing event then we need to kill it.
  if( this.indexOfCurrentImage !== undefined && bc.metrics !== undefined ) {
    bc.metrics.endContentSession( this.data[this.indexOfCurrentImage].media_content_url );
  }
};

Limitations

 

  • Content-level analytics work only in production mode, meaning you won't see data appear in App Cloud Studio until you publish and deploy an app.
  • It is the template author's responsibility to pause and unpause content sessions when the user exits and reenters a view. You can do this by listening for "viewblur" and "viewfocus" events.

 

Post new comment

The content of this field is kept private and will not be shown publicly.
0

Comments