Skip to content

Commit c7aa390

Browse files
committed
some minor rewording
1 parent 1b26af5 commit c7aa390

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

src/connections/auto-instrumentation/web-setup.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ You'll first need to add a source and copy its write key:
2727

2828
Next, you'll need to add the Signals SDKs to your web environment.
2929

30-
Choose one of the following installation methods based on your setup:
30+
Choose the installation method that matches your setup:
3131

32-
### Option A: Snippet Users (HTML)
32+
- **Option A:** For websites loading Segment through the HTML snippet.
33+
- **Option B:** For projects using npm, yarn, or pnpm.
3334

34-
For websites using the Segment snippet, you'll need to replace the regular Segment snippet with the following code, which includes the Signals SDK:
35+
### Option A: Websites using the Segment snippet (HTML)
3536

3637
> warning ""
37-
> If you are currently using Segment, replace the existing Segment snippet that loads analytics.js with the modified code below. You should not have two segment snippets that call analytics.load() in your html.
38+
> Include only one Segment snippet per page. Replacing your existing snippet prevents duplicate `analytics.load()` calls.
39+
40+
If your site uses the standard Segment snippet, **replace it** with the following version, which includes the Signals SDK:
3841

3942
```html
4043
<head>
@@ -148,41 +151,42 @@ For websites using the Segment snippet, you'll need to replace the regular Segme
148151
</head>
149152
```
150153

151-
### Option B: NPM Users
154+
Verify that you only have **one snippet** in your site, then move to
152155

153-
1. Add the Signals SDK to your project:
156+
### Option B: Install with a package manager
154157

155-
```bash
156-
# npm
157-
npm install @segment/analytics-signals
158-
# yarn
159-
yarn add @segment/analytics-signals
160-
# pnpm
161-
pnpm install @segment/analytics-signals
162-
```
158+
1. Add the Signals SDK to your project:
159+
```bash
160+
# npm
161+
npm install @segment/analytics-signals
162+
# yarn
163+
yarn add @segment/analytics-signals
164+
# pnpm
165+
pnpm install @segment/analytics-signals
166+
```
163167

164168
2. Add the initialization code and configuration options:
165169

166-
> success ""
167-
> see [configuration options](#configuration-options) for a complete list.
170+
> success ""
171+
> see [configuration options](#configuration-options) for a complete list.
168172
169-
```ts
170-
// analytics.js/ts
171-
import { AnalyticsBrowser } from "@segment/analytics-next";
172-
import { SignalsPlugin } from "@segment/analytics-signals";
173+
```ts
174+
// analytics.js/ts
175+
import { AnalyticsBrowser } from "@segment/analytics-next";
176+
import { SignalsPlugin } from "@segment/analytics-signals";
173177

174-
export const analytics = new AnalyticsBrowser();
178+
export const analytics = new AnalyticsBrowser();
175179

176-
const signalsPlugin = new SignalsPlugin();
180+
const signalsPlugin = new SignalsPlugin();
177181

178-
analytics.register(signalsPlugin);
182+
analytics.register(signalsPlugin);
179183

180-
analytics.load({
181-
writeKey: "<YOUR_WRITE_KEY>",
182-
});
183-
```
184+
analytics.load({
185+
writeKey: "<YOUR_WRITE_KEY>",
186+
});
187+
```
184188

185-
Verify that you replaced `<YOUR_WRITE_KEY>` with the actual write key you copied in Step 1.
189+
Verify that you replaced `<YOUR_WRITE_KEY>` with the actual write key you copied in Step 1.
186190

187191
3. Build and run your app.
188192

0 commit comments

Comments
 (0)