Learn how to integrate Firebase with Google Tag Manager in a few simple steps. Set up Firebase, add analytics tags in GTM, and test your integration effectively.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Set Up Firebase in Your Project
Ensure that you have a Firebase project set up. If not, create a new Firebase project in the Firebase console.
Step 2: Add Firebase to Your App
Depending on whether you are working on an Android or an iOS app, the process of adding Firebase will be slightly different.
For Android:
Add the Firebase SDK to your project using the following steps:
Open your build.gradle file (project level) and add the Google Services classpath:
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.8'
}
}
Open your build.gradle file (app level) and apply the Google Services plugin:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
Add Firebase dependencies to your app's build.gradle:
dependencies {
// Add these lines
implementation platform('com.google.firebase:firebase-bom:30.1.0')
implementation 'com.google.firebase:firebase-analytics'
}
For iOS:
Add the Firebase SDK to your app using CocoaPods:
Add the Firebase pod to your Podfile:
platform :ios, '10.0'
target 'YourAppTarget' do
use\_frameworks!
# Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
end
Install the pods by running the following command in your terminal:
pod install
Step 3: Set Up Google Tag Manager Container
Step 4: Add Firebase Analytics Tag in Google Tag Manager
Step 5: Link Firebase Analytics to Google Tag Manager
For the integration between Google Tag Manager and Firebase, you must ensure Firebase Analytics SDK is correctly installed as it acts as the intermediary for sending data.
Ensure your Firebase has Google Analytics enabled:
Navigate to Firebase console.
Go to 'Analytics' from the side menu.
Ensure Google Analytics is enabled.
Validate Event Triggering:
Ensure that required events and triggers are properly set in Google Tag Manager.
Check if the data flows as expected by using the "Preview" mode in Google Tag Manager.
Step 6: Deploy Your Changes
Step 7: Test the Integration
By following these steps, you should be able to successfully integrate Firebase with Google Tag Manager and start managing analytics from within the Tag Manager interface.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.