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 now supports the C3 Build Service.
Kindly click here for the tutorial.

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. The Auto Screen Report allows you to automatically collect screen view events. Disable this to prevent the collection of mentioned data.

6. The
Android Version input allows you to manually specify the Android Firebase Analytics SDK version.
Kindly
click here to check out the available versions.
Always try and test before publishing with a new version, to check for compatibility.


6.
The iOS Version input allows you to manually specify the iOS Firebase Analytics SDK version. Kindly click here to check out the available versions. 
Always try and test before publishing with a new version, to check for compatibility.

7. You have now successfully integrated the Firebase Analytics SDK. There are still some additional configuration for the Google Services integration, this supports the C3 Build Service.

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.

  • C3 Build Service

  • 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.

  • Android Export:

    • Export your Android project with the Cordova project option.

    • It will download the Project.zip.

    • Extract the Project.zip into a Project folder.

    • Then, paste the googles-services.json (android) inside the folder.

    • Copy the resource-file tag below, and paste it inside the config.xml, beside and after 
      <platform name="android">, <- find the word using Ctrl+F or CMD+F.

      (Paste this code.)

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

       

    • Compress the Project folder to make into a .zip file again, which will be Project.zip.

    • Import the Project.zip into Construct 3, using Menu > View > Export Manager.

    • You can now build for an app.apk or application.aab.

  • iOS Export:

    • Export your iOS project with the Cordova project option.

    • It will download the Project.zip.

    • Extract the Project.zip into a Project folder.

    • Then, paste the GoogleService-Info.plist (ios) inside the folder.

    • Copy the resource-file tag below, and paste it inside the config.xml, beside and after 
      <platform name="ios">, <- find the word using Ctrl+F or CMD+F.

      (Paste this code.)

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

       

    • Compress the Project folder to make into a .zip file again, which will be Project.zip.

    • Import the Project.zip into Construct 3, using Menu > View > Export Manager.

    • You can now build for an XCode Project.

  • 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.

​​

Default Event :

  • Set Default Parameters - Set the Default Event Parameters.

  • Add Default Parameter - Add a parameter to the next Set Default Parameters action.

    • Key - The parameter key.

    • Value - The parameter value.

  • Set Default Parameters (JS) - Set the Default Event Parameters, using a JSON string.

    • JSON - The JSON string containing the default event parameters.

 

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: