Last updated
Was this helpful?
Last updated
Was this helpful?
is a popular mobile platform powered by Google. It helps you to quickly develop high-quality, enterprise-grade applications and grow your business.
RudderStack supports Firebase as a to which you can seamlessly send your customer data for analytics.
Firebase device mode support is not available for the and SDKs.
Before configuring Firebase as a destination in RudderStack, verify if the source platform is supported by Firebase by referring to the table below:
Firebase is a device mode-only integration. To know more about the difference between cloud mode and device mode in RudderStack, refer to the guide.
Once you have confirmed that the source platform supports sending events to Firebase, follow these steps:
From your , add a source. Then, from the list of destinations, select Firebase.
Assign a name to the destination and click on Next.
Connect this destination to your Android/iOS/Unity/React Native source. You should then see the following screen:
Client-side Events Filtering: Refer to the guide for more information on this setting.
As this is a device mode-only integration, click on Next to complete the destination setup.
Depending on your platform of integration, follow the steps below to add Firebase to your project:
Once you have successfully created the app in the Firebase console, you will be prompted to download the google-services.json
file.
Copy this file in the app
folder of your project. It contains all the necessary information about the project and the integration.
Add the classpath
under dependencies
to your project level build.gradle
, as shown:
Now, you can add the plugins
and dependencies
to your app/build.gradle
file, as shown:
Then, add the mavenCentral
repository, as shown:
Add the RudderStack-Firebase SDK extension along with the core
SDK under dependencies
, as shown:
Next, add the necessary permissions
under AndroidManifest.xml
, as shown:
Finally, change the SDK initialization in your Application
class, as shown:
Add the file to the root of your XCode project.
Go to your Podfile
and add the Rudder-Firebase
extension along with the core SDK using the following code:
Rudder-Firebase
version 2.0.5
is tested and fully compatible with Firebase/Analytics
version 8.15.0
.
After adding the dependency followed by the pod install
command, you can add the imports to your AppDelegate.m
file, as shown:
Finally, change the SDK initialization, as shown in the following snippet:
Follow these steps to add Firebase to your Unity project:
After adding the project, Firebase will prompt you to download the google-services.json
for Android and GoogleServices-Info.plist
for iOS.
Add those two files to your project's Assets
folder.
Attach the RudderPreferbs.prefab
file from Rudder
to your main GameObject
Finally, change the SDK initialization using the following code snippet:
Follow these steps to add Firebase to your React Native project:
Once you have successfully created the applications in the Firebase console, you will be prompted to download the google-services.json
and GoogleServices-Info.plist
files.
Add the RudderStack-Firebase React Native module to your app using the following command:
Next, import the module you added above and add it to your SDK initialization code as shown:
Navigate to your app's android
folder and follow the steps below:
Copy the google-services.json
file in the app
folder of your Android project. This file contains all the necessary information about the project and the integration.
Add the classpath
under dependencies
to your project level build.gradle
file, as shown:
Once you have completed the steps above, you can add the plugins and dependencies to your app/build.gradle
file, as shown:
Then, add the necessary permissions under AndroidManifest.xml
, as shown:
Finally, navigate to your app's iOS
folder and follow these steps:
Install all the required pods using the pod install
command.
Add the GoogleServices-Info.plist
file to the root of your XCode project.
RudderStack ignores age
, gender
, and interest
, as these properties are reserved by Google.
RudderStack maps the following events to the standard Firebase events:
The following Firebase events are not mapped to any RudderStack event:
number_of_nights
number_of_rooms
number_of_passengers
origin
destination
start_date
end_date
travel_class
item_list_name
creative_slot
location_id
transaction_id
screen_class
RudderStack maps the following event properties to the standard Firebase properties:
Along with mapping the above list of the standard property names, RudderStack exhibits the following behavior:
Converts the event names to the lower case.
Trims the whitespaces at the start and the end.
Replaces a space with an underscore.
A sample track
call sent from the iOS SDK is shown below:
A sample screen
call is as shown:
The reset
method resets the user identification.
A sample reset
call is shown below:
iOS Android
For iOS, specify the following in your command line argument in XCode:
For Android, nest the following setting within the <application>
tag of your AndroidManifest.xml
file:
For iOS, set FirebaseAutomaticScreenReportingEnabled
to NO
(Boolean) in your Info.plist
.
Android iOS Unity React NativeUse the of the Firebase Android device mode to get the latest updates, bug fixes, and performance enhancements.Follow these steps to add Firebase to your Android project:
Register your mobile app in the .
If you're using the Firebase iOS device mode v1.0.2, update to the to get the latest updates, bug fixes, and performance enhancements.Follow these steps to add Firebase to your iOS project:
Register your app in the . It will then prompt you to download the GoogleServices-Info.plist
file.
Register your project in the . Currently, RudderStack supports only Android and iOS platforms for Unity.
Integrate the RudderStack core SDK with your project. For more information, refer to the documentation.
Download and import the Firebase Unity SDK and follow the to add the Firebase SDK (specifically, FirebaseAnalytics.unitypackage
) to your project.
Download the from the GitHub page and import it in your project.
Use the of the Firebase React Native device mode to get the latest updates and performance enhancements.
Register your Android and iOS applications in the .
Add the RudderStack React Native SDK to your app by referring to the documentation.
The call sets the userId
through the setUserId
method from FirebaseAnalytics
. RudderStack sets the other user properties from RudderTraits
to Firebase using the setUserProperty
method.
RudderStack's events are mapped to the standard Firebase events wherever possible.
RudderStack passes all the event-related properties to Firebase. The nested values in the properties are converted to JSON using .
Firebase enforces a of 40 characters. RudderStack takes a substring of 40 characters (from the beginning) if the event names exceed this permitted value.
The method lets you record whenever a user sees their mobile screen along with any optional properties about the viewed screen.
You can check the events and their properties in the . To enable it for Android, run the following command from your terminal:
For more information, refer to the .
For queries on any of the sections covered in this guide, you can or start a conversation in our community.
Payment Info Entered
add_payment_info
Product Added
add_to_cart
Product Added to Wishlist
add_to_wishlist
Application Opened
app_open
Checkout Started
begin_checkout
Order Completed
purchase
Order Refunded
refund
Products Searched
search
Cart Shared
share
Product Shared
share
Product Viewed
view_item
Product List Viewed
view_item_list
Product Removed
remove_from_cart
Product Clicked
select_content
Promotion Viewed
view_promotion
Promotion Clicked
select_promotion
Cart Viewed
view_cart
category
item_category
cart_id
,product_id
item_id
share_via
method
query
search_term
revenue
, value
, total
value
currency
currency
tax
tax
shipping
shipping
coupon
coupon
name
name
, promotion_name
quantity
quantity
price
price
payment_method
payment_type
list_id
item_list_id
promotion_id
promotion_id
creative
creative_name
affiliation
affiliation
Step-by-step guide to send your event data from RudderStack to Firebase
Connection Mode
Web
Mobile
Server
Device mode
-
Supported
-
Cloud mode
-
-
-