Unity | Getting started with Firebase Analytics with Unity | Game development (2023)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone today we will discuss about Firebase in Unity gaming Firebase is a very helpful tool this works as a game back-end services like you can imagine uh you want to have some kind of analytics you want to have some kind of database uh you have to have authentication like Google authentication iOS authentications Facebook and other third party authentication if you want to have also if you want to have some real-time database okay and you want to have some kind of backend functionalities as well like uh some kind of some kind of formulas some kind of restriction if you want to add in your game I think Firebase is one of the easiest and one of the quickest solution which you can implement so Firebase is not a complete back-end service but it's quite good you can say like in a normal game development studio for especially for Indie Studios 99 work should be done within Firebase so you can imagine like Firebase is your helper tool which will which will save you a lot of times and a lot of money as well so let's Deep dive into fibrous so you can see this is the Firebase website first what we will do is we will download the unity Firebase SDK so let's type first we will download the Firebase SDK so if I look here uh here's you can download Firebase Unity hdk so I click on it and it will start downloading so the file size is almost 1.1 GB it has actually all the all the tools inside the Firebase in today's video we will not cover all the tools we will just cover the initial Firebase integration into Unity project and we will check how it is working so let it complete the download let's come into our Unity project here is our Unity project it's in Android so that I will make an Android build and I'll show to you uh first uh do some basic steps in our project like yeah here is our player settings or you'll return a custom case store just for an extra security in the Firebase so I'll show you why and how so last first make it a custom package name so I'm overriding it SIM for for my demo I am keeping it as com Dot palash Dot Firebase demo project okay um I'm keeping it as for I'm keeping it for Android only because I'll be making an Android build and in the publishing settings I will create a question I can create new uh in a dedicated location definitely inside the project let's create the key here named as Firebase demo key just give it a password let's confirm the password give it an alias Firebase password again that's enough you don't need to put anything more add key Stone Key created okay now let's go back to Google Chrome our file is downloaded let's go to our Firebase and create a project so go to Firebase console didn't have any project here let's create a new project give the file name Firebase demo Unity I accept the terms and conditions continue I'm enabling Google analytics for this project this is the recommended and a good thing to do if you don't want to do it right now you can do it later as well but I also recommend to do it while you create the project because when you have your Google analytics it will help you in more insights into your data for example you can have your bigquery you can have your I mean a lot more interesting metrics you can create in your data while you have your Google Analytics okay so the analytics location I'm keeping it is as default all of this right now create project so it is creating my project till then let's check what is inside our zip folder which we downloaded so here it is our zip folder unzipped you can see it has analytics abject authentication crashlytics database Dynamic links first store functions installations messaging message means um push notification in a message remote configuration and Firebase storage today we will do the basic thing which is analytics Firebase Analytics so our project is ready let's go into the project yeah so here you can create your application for Android iOS web and separately for web sorry Unity or flutter I'll create an Unity application now and inside the unity application I'll create for n Apple and Android both so my bundle ID will be same for both the case please so my bundle ID will be com.fivesh demo project and app nickname I can say is Firebase Android uh I'm sorry that is IOS 5S iOS this is Android create both the app once this is done we have our configuration file for Android and iOS both let's download this okay so we have both now inside our project let's create a data folder and let's skip both the files inside the data folder you can keep it literally anywhere inside your project I'm keeping it inside a data folder go next so download Firebase Unity SDK we already downloaded it next and continue to console so here it is our project Firebase demo unity and let me show you regarding the key store or what I was telling you earlier so here you can see that in the Android project there is a shs certificate fingerprints which is required if you have an extra layer of security I will definitely recommend you provide your sha fingerprint have the fingerprint what you can do is you can do is like you can create your application let me show you how you can do it so add the open sense make a build and give it our name first created folder like build folder and give it a name build one to create the Sha you can do few things like you can use your key store and then run this command or you can do it through Gradle there is another one which is using the APK which I'll be showing you right now so how you can do using the APK so here is your command tool what you need to do is the right Ketone print set jar file and then part of this application I will share this command in the description in the description box below so once you do it you will see something like this sha1 and sha-256 what we require is sha1 here so we'll copy it and we'll paste it here and we'll paste it here save yeah so here we have our shs saved we will import the analytics file so here is our analytics file let's import it yeah it's imported make it enable yeah it's done now we will initialize Firebase into a project let's create a scripts folder let's create a script called Firebase init yeah here it is Firebase in it let's let's delete update as we will not record this [Music] yeah firebase.5 asap.check and fix dependencies and a sync and Country check and finish dependencies async dot continue with so here we'll get a task status equal to task dot present if status equal to available we can print and if it's not then we can throw an error that Firebase Unity hdk is not good to use so now let's make a build and check I'm naming it as builtro this is so easy right till the time the build is making let me show you that Firebase helped a lot in my personal projects the reason is that I required a lot of analytics and I required a database I required systems okay I required a lot of communications between two players so in all these scenarios generally I would have required a back-end back-end engineer for me but Firebase helped me a lot Firebase helped me to connect with these services and I I believe I believe if if you if you look carefully to Firebase I mean Firebase can help you a lot in your in your in any kind of gaming project now let me install the build in my device okay so now my APK is downloaded in my device let me install let's come into here in Firebase real-time Analytics I opened my device device and you can see here there is one user and the first event which is triggered by default is first open so I launched the app first time and my analytics is showing first open screen view session start and user engagement so I started getting all the default all the default events so you can see even it is showing where I am from it's pretty cool now so we did almost very few simple things so if I summarize what we did we created the app we we got a two Firebase config files we kept it inside unit project and then we changed our package name we created a key store and we created the shr file and we created couple of lines of code just to initialize Firebase so this this is the magic line you can think of Firebase app dot check and fix dependencies are sync dot continue it and we're ready we're ready to start the Firebase now if I want to implement the the other Firebase projects like Firebase crashlight X Firebase database Firebase faster faster is another kind of a database Firebase database is real real-time database which is called as rtdb and firestore is actually more advanced and there is five as functions so through functions you can actually uh have some kind of you can imagine real back-end code you can add fire storage Firebase messaging so in my in my game development let me show you which are which ones I use like explicitly too much one is definitely Firebase analytics another is Firebase authentication and that is crashlight X then database then faster then push notification then storage so these are the things I use extensively in my game I hope you have enjoyed today's video uh see you in next part of Firebase video and probably I'll try to cover the Firebase um database serial database I think that's an important thing in the next video see you till then bye
Info
Channel: Palash's Notebook
Views: 1,794
Rating: undefined out of 5
Keywords: unity, firebase, google, analytics, game development, programming
Id: KxrgFHXDhfg
Channel Id: undefined
Length: 17min 21sec (1041 seconds)
Published: Thu Jul 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.