Skip to content

Commit bdc16df

Browse files
authored
Add context!!! (#1044)
1 parent 5cde664 commit bdc16df

File tree

24 files changed

+260
-76
lines changed

24 files changed

+260
-76
lines changed

src/connections/sources/catalog/libraries/mobile/android/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ Ensure that the necessary permissions are declared in your application's `Androi
106106

107107
## Identify
108108

109+
> note ""
110+
> **Good to know**: For any of the different methods described in this doc, you can replace the properties and traits in the code samples with variables that represent the data collected.
111+
109112
`identify` lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.
110113

111114
We recommend calling `identify` a single time when the user's account is first created, and only identifying again later when their traits change.

src/connections/sources/catalog/libraries/mobile/android/quickstart.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,31 @@ title: 'Quickstart: Android'
33
hidden: true
44
---
55

6-
<!-- LR 4/21/2020: TODO: none of the quickstarts actually walk you through creating the source in the workspace -->
7-
8-
96
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.android/analytics/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.android/analytics)
107

118
This tutorial will help you start sending analytics data from your Android app to Segment and any of our destinations, using our Android library. As soon as you're set up you'll be able to turn on any new destinations with the flip of a switch!
129

1310
If you want to dive deeper at any point, check out the [Android Source Reference](/docs/connections/sources/catalog/libraries/mobile/android).
1411

15-
## Step 1: Install the Library
12+
## Step 1: Create a Source in the Segment app
13+
14+
Before you begin, you need a Workspace (which is a container that holds all of the sources and destinations which are billed together for an organization). If you already created one, great! If not, you can sign up for a free Segment account and create one.
15+
16+
Next, create an Android source from your Workspace:
17+
18+
1. Click **Add Source**.
19+
2. From the source catalog page, click **Android**.
20+
3. Click **Add Source** again from the informational panel that appears to the right.
21+
4. Give the source a display name, and enter the URL the source will collect data from.
22+
23+
When you create a Source in the Segment web app, it tells the Segment servers that you'll be sending data from a specific source type. When you create (or change!) a Source in the Segment app, Segment generates a new Write Key for that source. You use the write key in your code to tell the Segment servers where the data is coming from, so Segment can route it to your destinations and other tools.
24+
25+
26+
## Step 2: Install the Library
1627

1728
The recommended way to install the library for Android is with a build system like Gradle. This makes it simple to upgrade versions and add destinations. The library is distributed using [Maven Central](http://maven.org/). Simply add the `analytics` SDK to your module's `build.gradle` file:
1829

19-
```
30+
```java
2031
dependencies {
2132
implementation 'com.segment.analytics.android:analytics:4.+'
2233
}
@@ -32,7 +43,7 @@ In those cases, you'll need to take some additional steps as shown in the [libra
3243

3344
Now that the SDK is installed and setup, you're ready to...
3445

35-
## Step 2. Initialize the Client
46+
## Step 3. Initialize the Client
3647

3748
We recommend initializing the client in your `Application` subclass.
3849
```java
@@ -47,11 +58,11 @@ Analytics.setSingletonInstance(analytics);
4758
```
4859

4960
**Notes**:
50-
- Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) and is optional, but highly recommended to hit the ground running with core events! See [below](/docs/connections/sources/catalog/libraries/mobile/android/quickstart/#step-5-track-actions) for more info!
61+
- Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) and is optional, but highly recommended to hit the ground running with core events! See [below](/docs/connections/sources/catalog/libraries/mobile/android/quickstart/#step-6-track-actions) for more info!
5162
- This only installs the Segment destination. This means that all your data will be sent server side to tools.
5263
If you need to bundle additional destinations client side, you'll need to take some additional steps as [shown here](/docs/connections/sources/catalog/libraries/mobile/android/#about-mobile-connection-modes).
5364

54-
## Step 3. Add Permissions
65+
## Step 4. Add Permissions
5566

5667
Ensure that the necessary permissions are declared in your application's `AndroidManifest.xml`.
5768

@@ -63,7 +74,10 @@ Ensure that the necessary permissions are declared in your application's `Androi
6374
</manifest>
6475
```
6576

66-
## Step 4. Identify Users
77+
## Step 5. Identify Users
78+
79+
> note ""
80+
> **Good to know**: For any of the different methods described in this quickstart, you can replace the properties and traits in the code samples with variables that represent the data collected.
6781
6882
The `identify` method is one of our core API methods. It's how you tie one of your users and their actions to a recognizable userId. It also lets you record traits about the user, like their email, name, account type, etc. You can read more about it in the [identify reference](/docs/connections/sources/catalog/libraries/mobile/android#identify).
6983

@@ -81,7 +95,7 @@ That's identifying Michael by his unique User ID (the one you know him by in you
8195

8296
Once you've added an `identify` call, you're ready to move on to...
8397

84-
## Step 5. Track Actions
98+
## Step 6. Track Actions
8599

86100
The track method is how you record any actions your users perform. Each action is known by a name, like "Purchased a T-Shirt". You can also record properties specific to those actions. You can read more about `track` in the [track reference](/docs/connections/sources/catalog/libraries/mobile/android#track).
87101

src/connections/sources/catalog/libraries/mobile/ios/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configuration.recordScreenViews = YES; // Enable this to record screen views aut
4141
[SEGAnalytics setupWithConfiguration:configuration];
4242
```
4343
44-
**Note:** Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) and screen views is optional using initialization config parameters, but highly recommended to hit the ground running with core events! See [below](/docs/connections/sources/catalog/libraries/mobile/ios/quickstart/#step-3-track-actions) for more info!
44+
**Note:** Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) and screen views is optional using initialization config parameters, but highly recommended to hit the ground running with core events! See [below](/docs/connections/sources/catalog/libraries/mobile/ios/quickstart/#step-4-track-actions) for more info!
4545
4646
And of course, import the SDK in the files that you use it with:
4747
@@ -131,6 +131,9 @@ You can also manually `flush` the queue:
131131
132132
Now that the Segment SDK and any accompanying packaged SDKs are installed, you're ready to collect some data!
133133
134+
> note ""
135+
> **Good to know**: For any of the different methods described in this doc, you can replace the properties and traits in the code samples with variables that represent the data collected.
136+
134137
### Identify
135138
136139
`identify` lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.

src/connections/sources/catalog/libraries/mobile/ios/quickstart.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ If you want to dive deeper at any point, check out the [iOS Library Reference](/
1010
_Note: At the moment Segment does not support tracking watchkit extensions for the Apple watch. [Contact us](https://segment.com/help/contact) if you're interested in a watchkit SDK. For now we recommend tracking watch interactions using the native iPhone app code._
1111

1212

13-
## Step 1: Install the SDK
13+
## Step 1: Create a Source in the Segment app
14+
15+
Before you begin, you need a Workspace (which is a container that holds all of the sources and destinations which are billed together for an organization). If you already created one, great! If not, you can sign up for a free Segment account and create one.
16+
17+
Next, create an iOS source from your Workspace:
18+
19+
1. Click **Add Source**.
20+
2. From the source catalog page, click **iOS**.
21+
3. Click **Add Source** again from the informational panel that appears to the right.
22+
4. Give the source a display name, and enter the URL the source will collect data from.
23+
24+
When you create a Source in the Segment web app, it tells the Segment servers that you'll be sending data from a specific source type. When you create (or change!) a Source in the Segment app, Segment generates a new Write Key for that source. You use the write key in your code to tell the Segment servers where the data is coming from, so Segment can route it to your destinations and other tools.
25+
26+
## Step 2: Install the SDK
1427

1528
The recommended way to install Analytics for iOS is using [Cocoapods](http://cocoapods.org), since it means you can create a build with specific bundled destinations, and because it makes it simple to install and upgrade.
1629

@@ -50,7 +63,10 @@ In those cases, follow the additional steps to [bundle the destination tools](/d
5063

5164
Now that the SDK is installed and set up, you're ready to start making calls!
5265

53-
## Step 2: Identify Users
66+
## Step 3: Identify Users
67+
68+
> note ""
69+
> **Good to know**: For any of the different methods described in this quickstart, you can replace the properties and traits in the code samples with variables that represent the data collected.
5470
5571
The `identify` method is how you tell Segment who the current user is. It takes a unique User ID, and any optional traits you know about them. You can read more about it in the [identify reference](/docs/connections/sources/catalog/libraries/mobile/ios#identify).
5672

@@ -68,7 +84,7 @@ That call identifies Michael by his unique User ID (`f4ca124298`, which is the o
6884
6985
Once you've added an `identify` call, you're ready to move on to tracking!
7086
71-
## Step 3: Track Actions
87+
## Step 4: Track Actions
7288
7389
The `track` method is how you tell Segment about the actions your users are performing in your app. Every action triggers what we call an "event", which can also have associated properties. You can read more about `track` in the [track method reference](/docs/connections/sources/catalog/libraries/mobile/ios#track).
7490
@@ -101,7 +117,7 @@ That tells us that your user triggered the **Signed Up** event, and chose your h
101117

102118
Once you've added a few `track` calls, **you're set up!** You successfully instrumented your app, and can turn on any destination you like from your Segment workspace. However, there are a few important things to know about for mobile app instrumentation, so read on!
103119

104-
## Step 4: Flushing
120+
## Step 5: Flushing
105121

106122
By default, Segment sends ("flushes") events from the iOS library in batches of `20`, however this is configurable. You can set the `flushAt` value to change the batch size, or you can set it to `1` to disable batching completely.
107123

@@ -121,7 +137,7 @@ You can also manually call `flush` in your code to send all the messages in the
121137
[[SEGAnalytics sharedAnalytics] flush]
122138
```
123139

124-
## Step 5: Submitting to the App Store
140+
## Step 6: Submitting to the App Store
125141

126142
Segment collects the IDFA of the user's device to use in mobile install attribution with destinations like Mobile App Tracking.
127143

src/connections/sources/catalog/libraries/server/go/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ The default initialization settings are production-ready and queue 20 messages b
4242

4343
## Identify
4444

45+
> note ""
46+
> **Good to know**: For any of the different methods described on this page, you can replace the properties and traits in the code samples with variables that represent the data collected.
47+
4548
`identify` lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.
4649

4750
We recommend calling `identify` a single time when the user's account is first created, and only identifying again later when their traits change.
@@ -434,7 +437,7 @@ client.Enqueue(analytics.Track{
434437
SetCategory("Enterprise").
435438
Set("application", "Segment Desktop"),
436439
})
437-
```
440+
```
438441

439442
```go
440443
client.Enqueue(analytics.Track{
@@ -445,7 +448,7 @@ client.Enqueue(analytics.Track{
445448
"application": "Segment Desktop",
446449
},
447450
})
448-
```
451+
```
449452

450453
Lastly, you'll notice that configuration is provided during initialization and cannot be changed after initialization. The various configuration options are documented in the [GoDocs](https://godoc.org/gopkg.in/segmentio/analytics-go.v3#Config).
451454

src/connections/sources/catalog/libraries/server/go/quickstart.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,21 @@ This tutorial will help you start sending data from your Go servers to Segment a
88

99
If you want to dive deeper at any point, check out the [Go library reference](/docs/connections/sources/catalog/libraries/server/go/).
1010

11+
## Step 1: Create a Source in the Segment app
1112

12-
## Step 1: Install the Package
13+
Before you begin, you need a Workspace (which is a container that holds all of the sources and destinations which are billed together for an organization). If you already created one, great! If not, you can sign up for a free Segment account and create one.
14+
15+
Next, create a Go source from your Workspace:
16+
17+
1. Click **Add Source**.
18+
2. From the source catalog page, click **Go**.
19+
3. Click **Add Source** again from the informational panel that appears to the right.
20+
4. Give the source a display name, and enter the URL the source will collect data from.
21+
22+
When you create a Source in the Segment web app, it tells the Segment servers that you'll be sending data from a specific source type. When you create (or change!) a Source in the Segment app, Segment generates a new Write Key for that source. You use the write key in your code to tell the Segment servers where the data is coming from, so Segment can route it to your destinations and other tools.
23+
24+
25+
## Step 2: Install the Package
1326

1427
Installing our Go library is easy, just run the following:
1528

@@ -32,7 +45,10 @@ func main() {
3245
That will create a `client` that you can use to send data to Segment for your source. Once you've got that, you're ready to...
3346

3447

35-
## Step 2: Identify Users
48+
## Step 3: Identify Users
49+
50+
> note ""
51+
> **Good to know**: For any of the different methods described in this quickstart, you can replace the properties and traits in the code samples with variables that represent the data collected.
3652
3753
The `identify` method is how you tell Segment who the current user is. It includes a unique User ID and any optional traits you know about them. You can read more about it in the [identify reference](/docs/connections/sources/catalog/libraries/server/go#identify).
3854

@@ -56,7 +72,7 @@ When you're using our Go library, you don't need to identify a user on every req
5672
Once you've added an identify call, you can move on to...
5773

5874

59-
## Step 3: Track Actions
75+
## Step 4: Track Actions
6076

6177
The `track` method is how you tell Segment about which actions your users are performing. Every action triggers what we call an "event", which can also have associated properties. You can read more about `track` in the [track reference](/docs/connections/sources/catalog/libraries/server/go#track).
6278

src/connections/sources/catalog/libraries/server/go/v2/quickstart.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@ This tutorial will help you start sending data from your Go servers to Segment a
77

88
If you want to dive deeper at any point, check out the [Go library reference](/docs/connections/sources/catalog/libraries/server/go/).
99

10+
## Step 1: Create a Source in the Segment app
1011

11-
## Step 1: Install the Package
12+
Before you begin, you need a Workspace (which is a container that holds all of the sources and destinations which are billed together for an organization). If you already created one, great! If not, you can sign up for a free Segment account and create one.
13+
14+
Next, create a Go source from your Workspace:
15+
16+
1. Click **Add Source**.
17+
2. From the source catalog page, click **Go**.
18+
3. Click **Add Source** again from the informational panel that appears to the right.
19+
4. Give the source a display name, and enter the URL the source will collect data from.
20+
21+
When you create a Source in the Segment web app, it tells the Segment servers that you'll be sending data from a specific source type. When you create (or change!) a Source in the Segment app, Segment generates a new Write Key for that source. You use the write key in your code to tell the Segment servers where the data is coming from, so Segment can route it to your destinations and other tools.
22+
23+
## Step 2: Install the Package
1224

1325
Installing our Go library is easy, just run the following:
1426

@@ -31,7 +43,10 @@ func main() {
3143
That will create a `client` that you can use to send data to Segment for your source. Once you've got that, you're ready to...
3244

3345

34-
## Step 2: Identify Users
46+
## Step 3: Identify Users
47+
48+
> note ""
49+
> **Good to know**: For any of the different methods described in this quickstart, you can replace the properties and traits in the code samples with variables that represent the data collected.
3550
3651
The `identify` method is how you tell Segment who the current user is. It includes a unique User ID and any optional traits you know about them. You can read more about it in the [identify reference](/docs/connections/sources/catalog/libraries/server/go#identify).
3752

@@ -56,7 +71,7 @@ When you're using our Go library, you don't need to identify a user on every req
5671
Once you've added an identify call, you can move on to...
5772

5873

59-
## Step 3: Track Actions
74+
## Step 4: Track Actions
6075

6176
The `track` method is how you tell Segment about which actions your users are performing. Every action triggers what we call an "event", which can also have associated properties. You can read more about `track` in the [track reference](/docs/connections/sources/catalog/libraries/server/go#track).
6277

src/connections/sources/catalog/libraries/server/java/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ The following examples use [Guava's](https://github.com/google/guava) immutable
6262

6363
## Identify
6464

65+
> note ""
66+
> **Good to know**: For any of the different methods described on this page, you can replace the properties and traits in the code samples with variables that represent the data collected.
67+
6568
`identify` lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.
6669

6770
We recommend calling `identify` a single time when the user's account is first created, and only identifying again later when their traits change.

0 commit comments

Comments
 (0)