Skip to content

kdlee/FirebaseAnalyticsGodotAndroidPlugin

 
 

Repository files navigation

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.

About

Firebase Analytics implementation for Godot 4.2+ for android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • GDScript 85.3%
  • Kotlin 14.7%