Skip to content

Commit 2ac27f8

Browse files
alanjcharlesNiall Brennanforstisabellamarkzegarelli
authored
feat: redesign react native documentation to match swift/kotlin [netlify-build] (#4690)
* feat: redesign react native documentation to match swift/kotlin * fix: remove .env api * [netlify-build] * fix: add advanced func, mising config options * feat: add fullstory and taplytics * [netlify-build] * Remove section * add mini-toc to Advanced functionality section * Remove alias * remove 2.0 references, link classic docs * Update firbase * Remove certain content * fix: change braze middleware link --------- Co-authored-by: Alan Charles <[email protected]> Co-authored-by: Niall Brennan <[email protected]> Co-authored-by: forstisabella <[email protected]> Co-authored-by: markzegarelli <[email protected]>
1 parent 3c5c889 commit 2ac27f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2627
-156
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ CONTEXT=development
66
PLATFORM_API_TOKEN=generate a token from your Segment workspace
77
PAPI_TOKEN=generate a token from your Segment workspace
88
ALGOLIA_APP_ID=
9-
ALGOLIA_SEARCH_KEY=
9+
ALGOLIA_SEARCH_KEY=

src/_data/sidenav/strat.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,17 @@ sections:
166166
section_title: Analytics-React-Native Documentation
167167
section:
168168
- path: /connections/sources/catalog/libraries/mobile/react-native
169-
title: Analytics-React-Native mobile source
170-
- path: /connections/sources/catalog/libraries/mobile/react-native/migration
171-
title: Upgrade to React-Native 2.0
172-
- path: /connections/sources/catalog/libraries/mobile/react-native/troubleshooting
173-
title: Troubleshooting Analytics-React-Native
174-
- path: /connections/sources/catalog/libraries/mobile/react-native/react-faqs/
175-
title: React-Native FAQs
176-
- path: /connections/sources/catalog/libraries/mobile/react-native/changelog
177-
title: Analytics-React-Native Changelog
169+
title: Overview
170+
- path: /connections/sources/catalog/libraries/mobile/react-native/implementation
171+
title: Implementation / Upgrade
172+
- path: /connections/sources/catalog/libraries/mobile/react-native/destination-plugins
173+
title: Destination Plugins
174+
- path: /connections/sources/catalog/libraries/mobile/react-native/cloud-mode-destinations
175+
title: Cloud-mode Destinations
176+
- path: /connections/sources/catalog/libraries/mobile/react-native/react-native-typewriter
177+
title: Typewriter for React Native
178+
- path: /connections/sources/catalog/libraries/mobile/react-native/react-native-destination-filters
179+
title: Destination Filters for React Native
178180

179181
- slug: kotlin-android
180182
section_title: Analytics-Kotlin Documentation

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ You can add whatever lookup fields you want to help Segment find the object you
210210

211211
### Custom Fields Aren't Updating
212212

213-
Make sure that the traits you're passing through match the Custom Field's API name and data type!
213+
Make sure that the traits you're passing through match the Custom Field's API name and data type.
214214

215215

216216
### Password Expiration

src/connections/sources/catalog/libraries/mobile/apple/destination-plugins/amplitude-swift.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ title: Analytics Swift Amplitude Plugin
33
strat: swift
44
---
55

6-
[Amplitude](https://amplitude.com/){:target="_blank"} is an event tracking and segmentation platform for your web and mobile apps. By analyzing the actions your users
7-
perform, you can gain a better understanding to drive retention, engagement, and conversion.
6+
[Amplitude](https://amplitude.com/){:target="_blank"} is an event tracking and segmentation platform for your web and mobile apps. By analyzing the actions your users perform, you can gain a better understanding to drive retention, engagement, and conversion.
87

98
## Getting started
109

src/connections/sources/catalog/libraries/mobile/apple/destination-plugins/braze-swift.md

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Braze’s destination plugin code is open source and available on GitHub. You ca
88

99
## Getting Started
1010

11-
1211
1. From the Segment web app, click **Catalog**.
1312
2. Search for "Braze" in the Catalog, select it, and choose which of your sources to connect the destination to.
1413
3. In the Destination Settings, add the **API Key**, found in the Braze Dashboard in *App Settings > Manage App Group*.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Cloud Mode Destinations
3+
strat: react-native
4+
---
5+
Below is a list of the available cloud mode destinations for Analytics React Native.
6+
7+
{% include content/cloud-mode-dests.md %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Analytics React Native Adjust Plugin
3+
strat: react-native
4+
---
5+
6+
[Adjust](https://adjust.com){:target="_blank"} is the mobile attribution provider of choice for hundreds of organizations across the globe. They unify all your marketing activities into one powerful platform, giving you the insights you need to scale your business. The Adjust Destination is open-source. You can browse the code on GitHub [here](https://github.com/segmentio/analytics-react-native/tree/master/packages/plugins/plugin-adjust).
7+
8+
## Getting started
9+
10+
{% include content/connection-modes.md %}
11+
12+
1. From the Segment web app, click **Catalog**.
13+
2. Search for "Adjust" in the Catalog, select it, and choose which of your sources to connect the destination to.
14+
3. You don't need to include Adjust's SDK natively, as this prevent you from successfully implementing the Adjust.
15+
4. Depending on the source you've selected, include Adjust's library by adding the following lines to your dependency configuration.
16+
17+
## Adding the dependencies
18+
19+
You need to install the `@segment/analytics-react-native-plugin-adjust` and the `react-native-adjust` dependency.
20+
21+
Using NPM:
22+
```bash
23+
npm install --save @segment/analytics-react-native-plugin-adjust react-native-adjust
24+
```
25+
26+
Using Yarn:
27+
```bash
28+
yarn add @segment/analytics-react-native-plugin-adjust react-native-adjust
29+
```
30+
31+
Run `pod install` after the installation to autolink the Adjust SDK.
32+
33+
See [React Native SDK of Adjust](https://github.com/adjust/react_native_sdk) for more details of this dependency.
34+
35+
36+
## Using the Plugin in your App
37+
38+
Follow the [instructions for adding plugins](https://github.com/segmentio/analytics-react-native#adding-plugins) on the main Analytics client:
39+
40+
In your code where you initialize the analytics client call the `.add(plugin)` method with an `AdjustPlugin` instance:
41+
42+
```ts
43+
import { createClient } from '@segment/analytics-react-native';
44+
45+
import { AdjustPlugin } from '@segment/analytics-react-native-plugin-adjust';
46+
47+
const segmentClient = createClient({
48+
writeKey: 'SEGMENT_KEY'
49+
});
50+
51+
segmentClient.add({ plugin: new AdjustPlugin() });
52+
```
53+
54+
## Identify
55+
56+
If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](/docs/connections/spec/identify/) does. An example call would look like:
57+
58+
```ts
59+
const { identify } = useAnalytics();
60+
61+
identify('user-123', {
62+
username: 'MisterWhiskers',
63+
64+
plan: 'premium',
65+
});
66+
```
67+
68+
When you call `identify`, Segment will call Adjust's [addSessionPartnerParameter](https://github.com/adjust/ios_sdk#session-partner-parameters){:target="_blank"} method and set the `userId` and/or `anonymousId`. This will set these values within Adjust, and allow Adjust to send back attribution data from their servers.
69+
70+
71+
## Track
72+
73+
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example call would look like:
74+
75+
```ts
76+
const { track } = useAnalytics();
77+
78+
track('View Product', {
79+
productId: 123,
80+
productName: 'Striped trousers',
81+
});
82+
```
83+
84+
85+
When you call `track` Segment maps the event to your pre-defined Adjust custom event. You **must** map your `track` events to your custom Adjust Event Token in your Adjust destination settings.
86+
87+
If you don't provide a mapping, Adjust cannot accept the event. Segment includes all the event `properties` as callback parameters on the Adjust event, and automatically translate `revenue` and `currency` to the appropriate Adjust event properties based on Segment's [spec'd properties](/docs/connections/spec/track/#properties).
88+
89+
90+
## Install Attributed
91+
92+
### Client
93+
94+
Segment will trigger an `Install Attributed` event if you have **trackAttributionData** enabled in your settings and the Segment-Adjust integration installed in your app.
95+
96+
Using Adjust's [Attribution callback](https://github.com/adjust/ios_sdk#attribution-callback){:target="_blank"}, Segment listens for an attribution change from Adjust's SDK and triggers the call with the following Adjust attribution parameters:
97+
98+
| Key | Value | Description |
99+
| ------------------- | ------------------------ | -------------------------------------------------- |
100+
| provider | Adjust | hardcoded by Segment |
101+
| trackerToken | attribution.trackerToken | the tracker token of the current install |
102+
| trackerName | attribution.trackerName | the tracker name of the current install |
103+
| campaign.source | attribution.network | the network grouping level of the current install |
104+
| campaign.name | attribution.campaign | the campaign grouping level of the current install |
105+
| campaign.content | attribution.clickLabel | the click label of the current install |
106+
| campaign.adCreative | attribution.creative | the creative grouping level of the current install |
107+
| campaign.adGroup | attribution.adgroup | the ad group grouping level of the current install |
108+
109+
If any value is unavailable, it will default to nil. This call will be sent to all enabled [device and cloud mode](/docs/connections/destinations/#connection-modes) destinations.
110+
111+
## Additional features
112+
113+
### Environments
114+
115+
By default, Segment's destination sends data to the Adjust Sandbox Environment. When you release your app to the App Store, enable the `Production` option in the Adjust destination settings on Segment (or use two separate sources, one for dev and one for prod, with different environment settings for Adjust).
116+
117+
### Callback parameters
118+
119+
The destination sends all event `properties` as callback parameters to Adjust. To set [Partner Parameters](https://github.com/adjust/ios_sdk#partner-parameters){:target="_blank"}, you can [access the Adjust SDK directly](https://docs.adjust.com/en/special-partners/segment/){:target="_blank"}.
120+
121+
### Transaction deduplication
122+
123+
The destination will automatically recognize the spec'd `orderId` property, and send it as the transaction ID to Adjust for revenue de-duplication.
124+
125+
### In-app purchase receipts
126+
127+
The destination does not currently support in-app purchase receipts. If this is important to you, [reach out to support](https://segment.com/help/contact/).
128+
129+
### Push notifications
130+
131+
The destination automatically forwards push notification tokens through to Adjust.
132+
133+
### Event buffering
134+
135+
By default, our destination enables event buffering for Adjust. This saves your customers' battery life. However, you can disable this in the options on the Adjust destination settings on Segment.

0 commit comments

Comments
 (0)