Firebase Analytics

The Firebase Analytics implements mobile firebase analytics for both Android and iOS.

It supports all essential Firebase Analytics features. Including automated tracking, automated user properties, current screen, user id, custom app event tracking, custom user properties and consent compliance features.

It also has built-in JavaScript support.

It supports Construct 3 and is designed to be optimal and efficient for games with c3runtime, designed for both Android and iOS.

 

Intstructions

1. The first step is to add the Firebase Analytics addon into the project.

2. This addon doesn't support the C3 Build Service, due to additional configuration that the build service doesn't support.

3. If the Debug Mode property is checked, it will log information and errors in the console. Set this unchecked for your production release.

[This is currently disabled, but reserved for future use.]

4. The Enable At Startup is a useful option for asking user consent before collecting the user's analytics data.
To use this, uncheck this option, this will then disable Firebase's collection of analytics data.
Once you are able to get the user's consent, you can then switch this back on through the Set Enabled action.

 

5. You have now successfully integrated the Firebase Analytics SDK. There are still some additional configuration for the Google Services integration.
The C3 Build Service cannot support this additional configuration automatically, click here to learn how to integrate manually.

Features

The Firebase Analytics is an addon that integrates the native mobile Firebase Analytics SDK into an application made in Construct 3, with support for both android and ios.
It allows you to integrate Firebase Analytics' features, all automated and custom features are included with JavaScript Scripting support.

Features :

  • Full native Android SDK integration.

  • Full native iOS SDK integration.

  • Firebase automated analytics.

  • Firebase custom analytics.

  • Easy to use and no programming required.

  • Well-supported and fully tested.

  • C3 Scripting (JavaScript) support.

  • Firebase App Event tracking.

  • Firebase User Property tracking.

  • Firebase Current Screen

  • Personalized user analytics.

  • Construct 3 editor support.

  • Construct 3 runtime.

  • Worker Mode support.

  • Android Studio & XCode.

  • Cordova CLI

Integration Tutorial

Google Play Services

  • To use Firebase Analytics, it requires the googles-services.json (android).

  • And, GoogleService-Info.plist (iOS).

  • You can get these files from the Firebase Console.

  • Then, paste it into the root folder of your Cordova project.
    This is the same folder when you extract the Project.zip after exporting for Android or iOS in Construct 3.

  • Copy the configuration code below, and paste it inside the config.xml.

<platform name="android">

<resource-file src="google-services.json" target="app/google-services.json" />

...

</platform>

<platform name="ios">

<resource-file src="GoogleService-Info.plist" />

...

</platform>

  • Congratulations, you have now successfully integrated Google Services for Firebase Analytics, in your application.

AdSupport Framework (iOS)

  • In order to collect demographic, age, gender data, etc., you should additionally include the AdSupport.framework into your project.

Actions, Conditions & Expressions

Actions

Tracking :

  • Log Event - Log an app event.

    • Event Name - The event name.

  • Add Log Parameter - Add a parameter to the next Log Event.

    • Name - The parameter name.

    • Value - The parameter value.​

  • Log Event (JS) - Log an app event using JSON params.

    • Event Name - The event name.

    • JSON - The JSON string containing the app event parameters.​

User Properties :

  • Set User Property - Sets a user property to a given value.

    • Name - The property name.

    • Value - The property value.

General :

  • Set User ID - Sets the user id property.

    • ID - The user id.

  • Set Current Screen - Sets the current screen name, which specifies the current visual context in your app. This helps identify the areas in your app where users spend their time and how they interact with your app.

    • Name - The current screen name.

  • Reset Analytics Data - Clears all analytics data for this instance from the device and resets the app instance ID.

  • Set Enabled - Sets whether analytics collection is enabled for this app on this device.

    • Enabled - Check to enable.

 
 
 

Debugging Firebase

Android Studio

  1. Go to your Firebase Console, then select your application.

  2. If you just created a new project, you can confirm successful Firebase Analytics SDK integration by running your app with Firebase for the first time.

  3. Go to Analytics > Debug View.

  4. Open Android Studio, run your project via USB or Emulator.

  5. Select the terminal tab, by default, at the bottom dock.

  6. Input this command: 
    adb shell setprop debug.firebase.analytics.app package_name

  7. Input this command to stop: 
    adb shell setprop debug.firebase.analytics.app .none. 
    It also automatically stops after disconnecting your application from Android Studio.

  8. Go back the Debug View from your Firebase Console.

  9. Now review the events as they happen. (Expect significant delays.)

  10. Congratulations, you have now learned to debug Firebase Analytics integration.
    Click here to review the complete documentation of this tutorial.

Apple XCode

  1. Go to your Firebase Console, then select your application.
  2. If you just created a new project, you can confirm successful Firebase Analytics SDK integration by running your app with Firebase for the first time.

  3. Go to Analytics > Debug View.

  4. Open XCode, run your project via USB or Emulator.

  5. Select the terminal tab, by default, at the bottom dock.

  6. Input this command: 

    -FIRDebugEnabled

  7. Input this command to stop: 

    -FIRDebugDisabled

    It also automatically stops after disconnecting your application from XCode.

  8. Go back the Debug View from your Firebase Console.

  9. Now review the events as they happen. (Expect significant delays.)

  10. Congratulations, you have now learned to debug Firebase Analytics integration.

    Click here to review the complete documentation of this tutorial.

Tutorial Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

 
 

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: