Track app actions track-app-actions

Actions are the events that occur in your app that you want to measure.

Each action has one or more corresponding metrics that are incremented each time the event occurs. For example, you might send a trackAction call for each new subscription, or each time content is rated, or each time a level is completed.

Actions are not tracked automatically, so call trackAction when an event that you want to track occurs, and map the action to a custom event.

  1. When an event that you want to track occurs, call trackAction.

    • Roku:

      code language-js
      ADBMobile().trackAction("myapp.ActionName", {})
      
    • Chromecast:

      code language-js
      ADBMobile.analytics.trackAction("myapp.ActionName", {});
      
  2. Map the action to a custom event.

    • Roku:

      code language-js
      dictionary = {}
      dictionary["myapp.social.SocialSource"] = "Twitter"
      ADBMobile().trackAction("myapp.SocialShare", dictionary)
      
    • Chromecast:

      code language-js
      var dictionary = {};
      dictionary["myapp.social.SocialSource"] = "Twitter";
      ADBMobile.analytics.trackAction("myapp.SocialShare", dictionary);
      

You can also send additional context data with each track action call.

recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb