Skip to content

Commit 2cc2502

Browse files
bsneedBrandon Sneedsanscontext
authored
Improve Readme (#186)
* fix(readme): first pass * fix(readme): incorporate @sanscontext changes * Update README.md Co-authored-by: LRubin <[email protected]> * fix(readme): standardize on “mode” vs “based” Co-authored-by: Brandon Sneed <[email protected]> Co-authored-by: LRubin <[email protected]>
1 parent b9da487 commit 2cc2502

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

README.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Analytics helps you measure your users, product, and business. It unlocks insigh
2020
3. **Explore your data** by creating metrics (for example, new signups, retention cohorts, and revenue generation).
2121
- The best Segment companies use retention cohorts to measure product market fit. Netflix has 70% paid retention after 12 months, 30% after 7 years.
2222

23-
[Segment](https://segment.com) collects analytics data and allows you to send it to more than 250 apps (such as Google Analytics, Mixpanel, Optimizely, Facebook Ads, Slack, Sentry) just by flipping a switch. You only need one Segment code snippet, and you can turn integrations on and off at will, with no additional code. [Sign up with Segment today](https://app.segment.com/signup).
23+
[Segment](https://segment.com) collects analytics data and allows you to send it to more than 250 apps (such as Google Analytics, Mixpanel, Optimizely, Facebook Ads, Slack, Sentry) just by flipping a switch. You only need one Segment code snippet, and you can turn destinations on and off from the Segment web UI, with no additional code. [Sign up with Segment today](https://app.segment.com/signup).
2424

2525
### Why?
2626

@@ -54,6 +54,10 @@ If you are part of a new startup (&lt;$5M raised, &lt;2 years since founding),
5454

5555
## Prerequisite
5656

57+
#### React-Native
58+
59+
- Version 0.62 or greater.
60+
5761
#### iOS
5862

5963
- CocoaPods (**recommended**)
@@ -71,15 +75,17 @@ $ yarn react-native link
7175

7276
See the [API docs](packages/core/docs/classes/analytics.client.md) for more details.
7377

78+
Additional examples of common usage patterns and how-to's can found at [Analytics for React-Native](https://segment.com/docs/connections/sources/catalog/libraries/mobile/react-native/).
79+
7480
<!-- prettier-ignore -->
7581
```js
7682
import analytics from '@segment/analytics-react-native'
77-
import Mixpanel from '@segment/analytics-react-native-mixpanel'
78-
import GoogleAnalytics from '@segment/analytics-react-native-google-analytics'
83+
import mixpanel from '@segment/analytics-react-native-mixpanel'
84+
import firebase from '@segment/analytics-react-native-firebase'
7985

8086
analytics
8187
.setup('writeKey', {
82-
using: [Mixpanel, GoogleAnalytics],
88+
using: [mixpanel, firebase],
8389
recordScreenViews: true,
8490
trackAppLifecycleEvents: true,
8591
trackAttributionData: true,
@@ -111,22 +117,22 @@ analytics.screen('Home')
111117
There are two ways to send data to your analytics services through this library:
112118

113119
1. [Through the Segment servers](#cloud-based-connection-modes)
114-
2. [Directly from the device using bundled SDK’s](#packaging-device-based-destination-sdks)
120+
2. [Directly from the device using bundled SDK’s](#packaging-device-mode-destination-sdks)
115121

116122
**Note**: Refer to the specific destination’s docs to see if your tool must be bundled in the app or sent server-side.
117123

118124
#### Cloud-based Connection Modes
119125

120-
When an destination’s SDK is not packaged, but it is enabled via your dashboard, the request goes through the Segment REST API, and is routed to the service’s server-side API as [described here](https://segment.com/docs/integrations/#connection-modes).
126+
When an destination’s SDK is not packaged, but it is enabled using the Segment web UI, the request goes through the Segment REST API, and is routed to the service’s server-side API as [described here](https://segment.com/docs/connections/destinations/#connection-modes).
121127

122-
#### Packaging Device-based destination SDKs
128+
#### Packaging Device-mode Destination SDKs
123129

124130
By default, our `@segment/analytics-react-native` package does not contain any device-based destinations.
125131

126-
We recommend using device-based destinations on a need-to-use basis to reduce the size of your application, and avoid running into the dreaded 65k method limit on Android.
132+
We recommend only using device-based destinations on a need-to-use basis to reduce the size of your application, and to avoid running into the dreaded 65k method limit on Android.
127133

128-
If you would like to package device-based destinations, first search for the dependency you need using [the list below](#integrations).
129-
You'll need to run `react-native link` and add it in the `.using()` configuration method. Example using Firebase :
134+
If you would like to package device-based destinations, first search for the dependency you need using [the list below](#supported-device-mode-destinations).
135+
Then run `react-native link` and add it in the `.using()` configuration method. Example using Firebase :
130136

131137
```bash
132138
$ yarn add @segment/analytics-react-native-firebase
@@ -143,14 +149,17 @@ await analytics.setup('writeKey', {
143149
using: [firebase]
144150
})
145151
```
146-
For IOS you will need to add the GoogleService-info.plist to your IOS folder. This file can be downloaded from your Firebase instance. Firebase takes up to 24 hours to show events. However, you can utilize the Firebase debug method to confirm your setup is sending data correctly. To do this add ```-FIRDebugEnabled``` in Xcode’s Scheme Settings.
147152

148-
In Xcode:
149-
```Project -> Scheme -> Edit Scheme -> Arguments Passed On Launch```
153+
For IOS you must add the GoogleService-info.plist to your iOS folder. This file can be downloaded from your Firebase instance. Firebase takes up to 24 hours to show events. However, you can utilize the Firebase debug method to confirm your setup is sending data correctly. To do this add `-FIRDebugEnabled` in Xcode’s Scheme Settings.
154+
155+
In Xcode:
156+
`Project -> Scheme -> Edit Scheme -> Arguments Passed On Launch`
157+
158+
#### Supported Device-Mode Destinations
150159

151-
#### Integrations
160+
> All destinations have the same version as `@segment/analytics-react-native`
152161
153-
> All integrations have the same version as `@segment/analytics-react-native`
162+
**Note**: Each device-mode destination has a different native setup procedure due to differences between the underlying SDK vendors. Please refer to the vendor documentation for configuring the native iOS and Android portions of a given destination. More information and links to vendor specific instructions and details can be found at [Connection Mode Comparisons](https://segment.com/docs/connections/destinations/cmodes-compare/).
154163

155164
<!-- AUTOGEN:INTEGRATIONS:BEGIN -->
156165

@@ -187,7 +196,7 @@ In Xcode:
187196

188197
We **highly recommend** using Cocoapods.
189198

190-
However, if you cannot use Cocoapods, you can manually install our dynamic framework allowing you to send data to Segment and on to enabled cloud-mode destinations. We do not support sending data to bundled, device-mode integrations outside of Cocoapods.
199+
However, if you cannot use Cocoapods, you can manually install our dynamic framework allowing you to send data to Segment and on to enabled cloud-mode destinations. We do not support sending data to bundled, device-mode destinations outside of Cocoapods.
191200

192201
Here are the steps for installing manually:
193202

@@ -209,7 +218,7 @@ If you're using Cocoapods, check that your `ios/Podfile` file contains the right
209218
```ruby
210219
pod 'RNAnalytics', :path => '../node_modules/@segment/analytics-react-native'
211220
```
212-
- `Failed to load [...] integration native module`, look for the integration native module, example with Google Analytics:
221+
- `Failed to load [...] integration native module`, look for the destination native module, example with Google Analytics:
213222
```ruby
214223
pod 'RNAnalyticsIntegration-Google-Analytics', :path => '../node_modules/@segment/analytics-react-native-google-analytics'
215224
```
@@ -239,7 +248,7 @@ Check that `android/app/src/main/.../MainApplication.java` contains a reference
239248
}
240249
```
241250

242-
- `Failed to load [...] integration native module`, look for the integration native module, example with Google Analytics:
251+
- `Failed to load [...] integration native module`, look for the destination native module, example with Google Analytics:
243252

244253
```java
245254
import com.segment.analytics.reactnative.integration.google.analytics.RNAnalyticsIntegration_Google_AnalyticsPackage;

0 commit comments

Comments
 (0)