Skip to content

Commit f5799c5

Browse files
committed
Fix step indentation
1 parent 9985bfd commit f5799c5

File tree

1 file changed

+64
-55
lines changed
  • src/connections/auto-instrumentation

1 file changed

+64
-55
lines changed

src/connections/auto-instrumentation/setup.md

Lines changed: 64 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,32 @@ Follow these steps to integrate the Signals SDK into your Swift application:
2626

2727
1. Use Swift Package Manager to add the Signals SDK from the following repository:
2828

29-
```https://github.com/segmentio/Signals-swift.git```
29+
```zsh
30+
https://github.com/segmentio/Signals-swift.git
31+
```
3032

3133
2. Add the initialization code:
3234

33-
```swift
34-
// Configure Analytics with your settings
35-
{... <analytics config>....}
35+
```swift
36+
// Configure Analytics with your settings
37+
{... <analytics config>....}
3638
37-
// Set up the Signals SDK configuration
38-
let config = Signals.Configuration(
39-
writeKey: "<WRITE_KEY>", // Replace <WRITE_KEY> with your actual write key
40-
maximumBufferSize: 100,
41-
useSwiftUIAutoSignal: true,
42-
useNetworkAutoSignal: true
43-
)
39+
// Set up the Signals SDK configuration
40+
let config = Signals.Configuration(
41+
writeKey: "<WRITE_KEY>", // Replace <WRITE_KEY> with your actual write key
42+
maximumBufferSize: 100,
43+
useSwiftUIAutoSignal: true,
44+
useNetworkAutoSignal: true
45+
)
4446
45-
// Locate and set the fallback JavaScript file for edge functions
46-
let fallbackURL = Bundle.main.url(forResource: "MyEdgeFunctions", withExtension: "js")
47+
// Locate and set the fallback JavaScript file for edge functions
48+
let fallbackURL = Bundle.main.url(forResource: "MyEdgeFunctions", withExtension: "js")
4749
48-
// Apply the configuration and add the Signals plugin
49-
Signals.shared.useConfiguration(config)
50-
Analytics.main.add(plugin: LivePlugins(fallbackFileURL: fallbackURL))
51-
Analytics.main.add(plugin: Signals.shared)
52-
```
50+
// Apply the configuration and add the Signals plugin
51+
Signals.shared.useConfiguration(config)
52+
Analytics.main.add(plugin: LivePlugins(fallbackFileURL: fallbackURL))
53+
Analytics.main.add(plugin: Signals.shared)
54+
```
5355

5456
Verify that you replaced `<WRITE_KEY>` with the actual write key you copied in Step 1.
5557

@@ -59,59 +61,66 @@ Follow these steps to integrate the Signals SDK into your Kotlin application:
5961

6062
1. Update your module’s Gradle build file to add the right dependencies:
6163

62-
```kotlin
63-
dependencies {
64-
// Add the Analytics Kotlin library
65-
implementation("com.segment.analytics.kotlin:android:1.15.0")
66-
// Add a live plugin for real-time data handling
67-
implementation("com.segment.analytics.kotlin:analytics-kotlin-live:1.0.0")
68-
// Add the core Signals library
69-
implementation("com.segment.analytics.kotlin.signals:core:0.0.1")
70-
// Compose plugin for Jetpack Compose UI tracking
71-
implementation("com.segment.analytics.kotlin.signals:compose:0.0.1")
72-
// OkHttp3 plugin for network activity tracking
73-
implementation("com.segment.analytics.kotlin.signals:okhttp3:0.0.1")
74-
}
75-
```
64+
```kotlin
65+
dependencies {
66+
// Add the Analytics Kotlin library
67+
implementation("com.segment.analytics.kotlin:android:1.15.0")
68+
// Add a live plugin for real-time data handling
69+
implementation("com.segment.analytics.kotlin:analytics-kotlin-live:1.0.0")
70+
// Add the core Signals library
71+
implementation("com.segment.analytics.kotlin.signals:core:0.0.1")
72+
// Compose plugin for Jetpack Compose UI tracking
73+
implementation("com.segment.analytics.kotlin.signals:compose:0.0.1")
74+
// OkHttp3 plugin for network activity tracking
75+
implementation("com.segment.analytics.kotlin.signals:okhttp3:0.0.1")
76+
}
77+
```
7678

7779
2. Add the following code to your application to initialize the Signals SDK:
7880

79-
```kotlin
80-
// Configure Analytics with your settings
81-
{... <analytics config>....}
81+
```kotlin
82+
// Configure Analytics with your settings
83+
{... <analytics config>....}
8284
83-
// Add live plugins for real-time analytics
84-
analytics.add(LivePlugins())
85+
// Add live plugins for real-time analytics
86+
analytics.add(LivePlugins())
8587
86-
// Configure and add the Signals plugin
87-
Signals.configuration = Configuration(
88-
maximumBufferSize = 1000,
89-
broadcasters = listOf(SegmentBroadcaster(analytics))
90-
)
88+
// Configure and add the Signals plugin
89+
Signals.configuration = Configuration(
90+
maximumBufferSize = 1000,
91+
broadcasters = listOf(SegmentBroadcaster(analytics))
92+
)
9193
92-
// Add the Compose plugin for UI events and screen tracking
93-
analytics.add(SignalsComposeTrackingPlugin())
94-
```
94+
// Add the Compose plugin for UI events and screen tracking
95+
analytics.add(SignalsComposeTrackingPlugin())
96+
```
9597

9698
3. (Optional:) If you want to track network activity, configure your OkHttpClient to use the Signals OkHttp3 plugin:
9799

98-
```kotlin
99-
private val okHttpClient = OkHttpClient.Builder()
100-
.addInterceptor(SignalsOkHttp3TrackingPlugin())
101-
.build()
102-
```
100+
```kotlin
101+
private val okHttpClient = OkHttpClient.Builder()
102+
.addInterceptor(SignalsOkHttp3TrackingPlugin())
103+
.build()
104+
```
103105

104106
4. Build and run your app.
105107

106108

107109
## Step 3: Verify and deploy events
108110

109-
Next, you'll need to verify signal emission and create rules to convert those signals into events.
111+
Next, you'll need to verify signal emission and create rules to convert those signals into events:
110112
111-
### Verify signal emission
112-
113-
1. Return to **Connections > Auto-Instrumentation** and click on the new source you created.
113+
1. In your Segment workspace, return to **Connections > Auto-Instrumentation** and click on the new source you created.
114114
2. Verify that signals appear as expected on the dashboard.
115115
116-
![Signals successfully appearing in the Segment UI](images/autoinstrumentation_signals.png "Signals successfully appearing in the Segment UI")
116+
![Signals successfully appearing in the Segment UI](images/autoinstrumentation_signals.png "Signals successfully appearing in the Segment UI")
117+
118+
3. Click **Create Rules**.
119+
4. In the Rules Editor, add a rule that converts signal data into an event.
120+
5. Click **Preview**, then click **Save & Deploy**.
121+
122+
Segment displays `Rule updated successfully` to verify that it saved your rule.
123+
124+
## Step 4: Redeploy your application
117125
126+
After you've finiseh

0 commit comments

Comments
 (0)