Skip to content

Commit f01f6d0

Browse files
committed
1 parent 1c9d163 commit f01f6d0

File tree

1 file changed

+37
-0
lines changed
  • src/connections/destinations/catalog/firebase

1 file changed

+37
-0
lines changed

src/connections/destinations/catalog/firebase/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,43 @@ If you use Segment's React Native source library, you must explicitly bundle the
114114

115115
<!-- LR Mar 2021: We didn't use the react-dest include here because Firebase needs the extra build.gradle step.-->
116116

117+
## Setting up Firebase with Analytics-Kotlin
118+
If you're using the [Analytics Kotlin library](/docs/connections/sources/catalog/libraries/mobile/kotlin-android), follow these steps to set up Firebase with Analytics-Kotlin:
119+
1. In your top-level `build.gradle` file add these lines:
120+
```kotlin
121+
buildscript {
122+
...
123+
repositories {
124+
google()
125+
}
126+
dependencies {
127+
...
128+
classpath 'com.google.gms:google-services:4.3.5'
129+
}
130+
}
131+
```
132+
133+
2. In your app-module `build.gradle` file add these lines:
134+
```kotlin
135+
...
136+
plugins {
137+
id 'com.google.gms.google-services'
138+
}
139+
140+
dependencies {
141+
...
142+
implementation platform('com.google.firebase:firebase-bom:28.2.1')
143+
implementation 'com.google.firebase:firebase-analytics-ktx'
144+
}
145+
```
146+
3. Copy the [FirebaseDestination.kt](https://github.com/segmentio/analytics-kotlin/blob/main/samples/kotlin-android-app-destinations/src/main/java/com/segment/analytics/destinations/plugins/FirebaseDestination.kt) file into your project's codebase.
147+
4. Copy your `google-service.json` file to your app-module.
148+
5. Go to your project's codebase and add these lines where you intialize the analytics client:
149+
```kotlin
150+
val Firebase = FirebaseDestination()
151+
analytics.add(Firebase)
152+
```
153+
117154
## Identify
118155
119156
When you call `identify` Segment will map to the corresponding Firebase Analytics calls:

0 commit comments

Comments
 (0)