Get Traffic report with Google Analytics for Firebase in Unity




Google Analytics for Firebase lets you enable to analyze your application by collects usage and behavior data.

STEP 1: Download the firebase SDK

  • Go here and download the firebase SDK.
  • Unzip and check it will contain FirebaseAnalytics.unitypackage

Google Analytics




STEP 2: Configure Application in Firebase console

You need two things for firebase configuration in your application.

  1. Firebase project
  2. Firebase configuration file

here’s how you can configure your application for Android and iOS.





Configure application for iOS

  • Create a project in the Firebase Console.if you don’t have already.
  • Click Add Firebase to your iOS app and follow the setup steps.
  • Enter your application’s bundle id.
  • Download a GoogleService-Info.plist file.You can re-download at any time.




Configure application for Android

  • Create a project in the Firebase Console.if you don’t have already.
  • Click Add Firebase to your Android app and follow the setup steps.
  • Enter your application’s package name.
  • Download a google-services.json file.You can redownload at any time.




STEP 3: Add SDK in your application

  • Create new unity project, if you don’t have yet.
  • Import FirebaseAnalytics.unitypackage from the Firebase Unity SDK downloaded previously.
  • Add the file GoogleService-Info.plist to the iOS project, otherwise add the file google-services.json in your android project.




STEP 4: Logging in firebase console

Google Analytics for Firebase in unity allows you to log two types of information.

  • Events
  • User properties

Analytics automatically logs some events and user properties, you don’t need to add any code to enable them.Analytics allows you to log additional 25 different user properties and log up to 500 different events types in your app.





Let’s Log some Events

Log an event with no parameters

Log an event with float parameters




Log an event with an int parameters

Log an event with a string parameter

Log an event with Multiple parameters, Passed as a struct

you can also log many more events for your application such as multiplayer, platform and others.

 

5 thoughts on “Get Traffic report with Google Analytics for Firebase in Unity”

  1. Having read this I thought it was really enlightening. I appreciate you finding the time and effort
    to putt this information together. I once again find mmyself spending way too much
    time both reading and commenting. But so what, it was still worthwhile!

  2. I bblog quite often and I seriously thank you forr your information.
    This great aticle has really pewked my interest.I’m going to book
    mark yourr site and keep checking for new detaips about once a week.
    I subscribed to your Feed as well.

  3. I have to thank you for the efforts you’ve put in penning this site.

    I really hope to see the same high-grade content
    by you in the futrure as well. In truth, your creative wrriting abilities has motivated mee to
    get my own, personal blog nnow 😉

Leave a Reply

Your email address will not be published. Required fields are marked *