Firebase Analytics Android

by BasilYes

23

Firebase Analytics Godot Android Plugin

Firebase Analytics implementation for Godot 4.2+. Created from Godot Android Plugin template.

Installing the plugin

For use plugin you must configure gradle build as covered in godot docs

  • Download addon from releases to addons folder of your project
  • Navigate to Project -> Project Settings... -> Plugins, and ensure the plugin is enabled
  • Install the Godot Android build template by clicking on Project -> Install Android Build Template...
  • Add your google-services.json to android/build folder in your project
  • Connect an Android device to your machine and run your project

Usage

Download latest release and enable plugin in godot project settings. For log event use function in singleton FirebaseAnalytics:

func logEvent(event: String, params: Dictionary) -> void:

In params dictionary keys mast be String type, values can be int, float or String. Usage example:

func _on_Button_pressed():
    FirebaseAnalytics.logEvent("test",
        {
            "value1": 1,
            "value2": "2",
            "value3": 0.3
	})

Plugin store google recomended events names as constatns that you can use:

image

And google recomended parameters

image

Building the plugin

  • In a terminal window, navigate to the project's root directory and run the following command: ./gradlew assemble
  • On successful completion of the build, the output files can be found in plugin/demo/addons

Warning

I use some workaround to connect android plugins to the project, so if you know how to do it properly be free to contribute or send me some guides on how to do it properly.

Version

1.0

Engine

4.2

Category

Scripts

Download

Version1.0
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author