Home

Guides

Editor

Components

Actions

Conditions

How to Add Google Analytics to Your App

Setting Up Google Analytics

Setting up Google Analytics allows you to track user interactions, behaviors and events. This guide will help you integrate Google Analytics into your app.


Prerequisites

  • A Google Account


Step 1: Create a Firebase Project

Google Analytics for mobile apps is now part of Firebase. To start, you'll need to create a Firebase project.

  1. Go to the Firebase Console: https://console.firebase.google.com/

  2. Click Add Project:

    • Enter your project name (this can be your app name).

    • Follow the setup prompts to create your project.

    • Enable Google Analyticswhen prompted.

Once the Firebase project is set up, you'll be directed to the Firebase dashboard.


Step 2: Add Your App to Firebase

For Android:

  1. Register Your Android App:

    • In the Firebase Console, select your project.

    • Click on the Android iconunder "Get started by adding Firebase to your app".

    • Enter your Android package nameand app nickname (optional). You can add the SHA-1 keylater, and it will be available after your first release.

  2. Download the google-services.json File:

    • Firebase will generate a google-services.json file.

    • Download the file.

    • Open the "Firebase" settings within the Project screen of Your App Creator.

    • Click Enable Firebase, then Enable Analytics.

    • Upload the google-services.json file.

For iOS:

  1. Register Your iOS App:

    • In the Firebase Console, select your project.

    • On the Project Overview, click Add App and then the iOS+ icon.

    • Enter your iOS bundle ID and app nickname (optional).

  2. Download the GoogleService-Info.plist File:

    • Firebase will generate a GoogleService-Info.plist file.

    • Download the file.

    • Open the "Firebase" settings within the Project screen of Your App Creator.

    • Upload the GoogleService-Info.plist file.

For Web: (optional)

This step is required if you plan to release your app to the web or if you would like to test or use any Firebase features within the preview.

  1. Register Your Web App:

    • In the Firebase Console, select your project.

    • On the Project Overview, click Add App and then the Web (</>)icon.

    • Enter your app nickname.

  2. Copy details:

    • Firebase will generate a code for you to copy into a web project.

    • Open the "Firebase" settings within the Project screen of Your App Creator.

    • Copy each property from the "firebaseConfig" into the "Web Config" (the hosting site ID is only required if you plan to release to the web and use Firebase Hosting).


Test

Launch the app in the preview mode or create a new app release. Navigate around your app, click some buttons, and then check that events are showing in the "Analytics Dashboard" within the Firebase console.

You are now set up to add any additional Firebase services with a single click.