Important: New users should use the Firebase SDK to track iOS apps.
This document is for mobile developers and describes how to use Google Analytics to measure user interactions and answer questions about app usage.
Google Analytics for mobile apps provides a platform to measure user interactions, allowing you to better understand and optimize user engagement with your app.
This guide will explain how you can implement additional Google Analytics features to better understand your users and their behavior.
The player starts the game on the first level which is named Barren Fields.
The rest of this document illustrates how these questions can be answered by implementing Google Analytics features for the Dragon Catcher game.
If there are important actions that you want to track within your app then events can be used to describe this action in Google Analytics. An event consists of four parameters: category, action, label and value.
For example, in Dragon Catcher, a user rescuing a dragon or visiting a specific area in the level are important actions that we want to measure using events. The code snippet below illustrates how to measure this in Google Analytics.
Important: Events are most useful when the data you send can be used to take some action. To ensure your app doesn’t exceed limits and quotas it is not recommended to measure things like how many times a player presses the jump button.
If you want to measure in-app purchases by users then ecommerce tracking can be used to track the purchase and understand related product performance and user behavior. Ecommerce tracking can be used to measure the purchase of a specific item or a virtual currency.
Note: Enhanced ecommerce data can only be sent with an existing hit, for example a screenview or event. If you set ecommerce values but do not send any hits, or the hit is sent before the ecommerce values are set then the ecommerce data will not be sent.
If you have specific objectives for your app that you want users to complete then you can define and measure these objectives using Goals in Google Analytics. For example, a goal could be for users to reach a certain game level or to purchase an item. To learn more on how goals work see About goals (Help Center).
If you want to track users with specific attributes/traits/metadata then custom dimensions can be used to send this type of data to Google Analytics and in analysis. See the Custom Dimensions & Metrics feature reference to learn more about how custom dimensions work.
Create a custom dimension with a User scope. User scope is used because this value should persist across all of that user's sessions. See Set up or edit custom dimensions (Help Center).
Update the custom dimension value when the user's level has changed.
Applying the custom dimension as a segment will allow you to analyze users who are currently in a specific level within the game.
If you want to measure how long something takes to complete in the app then user timings can be used for time based measurements in Google Analytics. User timings are similar to events, but are time based, and can include a category, value, name (variable), and label. To learn about how user timings work see About Site Speed.
Analytics Academy - Improve your Analytics skills with free online courses including mobile app analytics fundamentals.