Hi FixFox,
Thanks for your question about integrating Firebase into your React Native Expo app to track Google Ads conversions for iOS installs. I know it can be frustrating when these things aren't as straightforward as they should be, but don't worry, we'll try to get it sorted out! Please note, I am not sure if this will fix your problem, but I hope to at least try!
// App.js
import React, { useEffect } from 'react';
import { View, Text } from 'react-native';
import { getAnalytics, logEvent } from 'expo-firebase-analytics';
export default function App() {
useEffect(() => {
// Initialize analytics and log an event when the app is opened
const analytics = getAnalytics();
logEvent(analytics, 'app_open');
}, []); // Empty dependency array ensures this runs only on the first render
return (
<View>
<Text>Your app content goes here</Text>
</View>
);
}
Here's what you'll need to do: First, make sure you have the expo-firebase-analytics package installed in your project. If you haven't already, run expo install expo-firebase-analytics in your project directory.
- In your App.js file, import useEffect from React, and getAnalytics and logEvent from expo-firebase-analytics.
- Inside your App component, use a useEffect hook to initialize the Firebase analytics and log an app_open event. The empty dependency array [] ensures that this code runs only once when the component mounts.
- Set up a conversion event in your Google Ads account that matches the app_open event. This tells Google Ads to count this Firebase event as a conversion.
- Ensure your Firebase project is properly set up and connected to your Google Ads account. You'll need to provide your Firebase project credentials in your Expo app's configuration.
With this setup, Firebase will log the app_open event whenever a user installs your app from a Google Ad and opens it, and Google Ads will count it as a conversion. For better code organization and performance, consider moving the analytics initialization logic into a separate custom hook or a dedicated analytics module. This allows you to easily reuse it across your app and keeps your components clean.
Let me know if I can be of further help,
Jared Parr, (he/him)
Google Cloud Partner
513-270-4050 Office
Google for Developers
Google Cloud Certified, Associate Cloud Engineer
Google Cloud Certified, Professional

