Firebase Analytics

Firebase Analytics is Google’s new analytics offering intended as a replacement for Google Analytics on mobile.

“At the heart of Firebase is Google Analytics for Firebase, a free and unlimited analytics solution. Analytics integrates across Firebase features and provides you with unlimited reporting for up to 500 distinct events that you can define using the Firebase SDK. Analytics reports help you understand clearly how your users behave, which enables you to make informed decisions regarding app marketing and performance optimizations.” (official docs)

ASSET PORTAL: https://www.defold.com/community/projects/145904/
GITHUB: https://github.com/defold/extension-firebase-analytics

A special thanks to @AGulev who took over the work of finishing this extension and making it available to the community!

20 Likes

Amazing, thank you guys!

3 Likes


Are these dependencies still required?

  • https://github.com/defold/android-base-extensions/releases/download/1.0.0/firebase-core-16.0.8.zip
  • https://github.com/defold/android-base-extensions/releases/download/1.0.0/gps-base-16.1.0.zip
  • https://github.com/defold/android-base-extensions/releases/download/1.0.0/support-v4-26.1.0.zip
  • https://github.com/defold/android-base-extensions/releases/download/1.0.0/gps-measurement-16.4.0.zip

I remember, that for other extnestions like facebook, docs were changed to not require setting dependencies for support-*** and gps-*** libs manually. Is this still actual for firebase extension?

1 Like

No. Not needed. The documentation mentions: “If running Defold 1.2.164 or older you also need to add a number of base extensions as dependencies”

2 Likes

Oops, I understood “older” as “bigger number” =) My bad.

Firebase Analytics has been updated to newer versions for both iOS and Android. The new version uses:

  • Firebase C++ SDK 6.16.0
  • iOS SDK 6.34.0

Latest version is available here: https://github.com/defold/extension-firebase-analytics/releases/tag/1.4.1

Manual: https://defold.com/extension-firebase-analytics/

A big thank you to @AGulev for doing the update!

7 Likes

I’m seeing problems this morning to build my project, I didn’t do ANY modification since yesterday. I have the firebase extension and I’m seeing the following error:

Is there any possibility this could be related to the update of the firebase extension?
If not, I’ll happily delete my message so it doesn’t pollute the thread :smiley: Thanks

What do you have as a dependency in your project settings?
(i.e. the full link to the zip file)

dependencies = https://github.com/rgrams/rendercam/archive/v1.0.1.zip,
https://github.com/MaratGilyazov/def_ironsource/archive/master.zip,
https://github.com/subsoap/defsave/archive/master.zip,
https://github.com/defold/extension-iap/archive/master.zip,
https://github.com/britzl/defold-sharing/archive/master.zip,
https://github.com/britzl/defold-png/archive/master.zip,
https://github.com/adamwestman/extension-vibrate/archive/master.zip,
https://github.com/GameAnalytics/GA-SDK-DEFOLD/archive/master.zip,
https://github.com/GameAnalytics/defold-openssl/archive/master.zip,
https://github.com/defold/extension-facebook/archive/2.6.0.zip,
https://github.com/defold/extension-firebase/archive/master.zip,
https://github.com/Insality/druid/archive/master.zip,
https://build.spiralcodestudio.com/a***@gmail.com/c****3/defold/admob.zip

I also tried with replacing
https://github.com/defold/extension-firebase/archive/master.zip, with
https://github.com/defold/extension-firebase-analytics/archive/1.4.1.zip

and got the same error message. So it might come from another extension that got updated?

2 Likes

Replacing with actual version numbers is definitely the way to go, in order to prevent issues like the one you have now.

To “go back” to the version you had, you would have to use the previous release:

https://github.com/defold/extension-firebase-analytics/archive/1.3.2.zip from 2020/02/06

2 Likes

We updated the Firebase extension today so there’s likely some conflict with another extension. My guess would be either Facebook or AdMob.

Oh, I see now, it mentions AndroidX. That won’t work as you probably have a mix of Android libraries using the new AndroidX and the old Android Support lib. We have in our roadmap to add support for the jetifier tool to auto-convert dependencies to AndroidX.

2 Likes

I’ve just checked and this is conflict with facebook extension (maybe with admob as well, but I don’t have access to this extension)

1 Like

OK this is getting a bit weird, I can’t bundle my app anymore (Android). Even after removing all my dependencies from the project (and deleting the .internal folder), I still get the following message when bundling:

Is there any other folder I need to delete to clear my project and be able to compile?

Delete build and .internal folders

Are you using a custom app manifest (to remove things from the engine which you don’t need)?

1 Like

OK thanks the error went away after I deleted the /build folder as well.

2 Likes

The Firebase Analytics extension has been updated to Firebase C++ SDK 7.3.0. The extension has also been restructured to make it easier to add more Firebase integrations in Defold. You will from now on have to add two dependencies to your project:

Documentation here: Defold Firebase Analytics documentation

7 Likes

I’m attempting to call firebase.analytics.get_id() like so:

firebase.analytics.get_id(function(fid)
    print("fid is " .. type(fid))
    print(fid)
end)

and was expecting a string but the output was in fact this:

DEBUG:SCRIPT: fid is userdata
DEBUG:SCRIPT: Script: 0x7b3d78c700

Am I doing something clearly wrong?

I’m not sure, but ppbly it should be

firebase.analytics.get_id(function(self, fid)
    print("fid is " .. type(fid))
    print(fid)
end)
3 Likes

Yes you’re right, thank you.

2 Likes