You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/auto-instrumentation/web-setup.md
+32-28Lines changed: 32 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,14 +27,17 @@ You'll first need to add a source and copy its write key:
27
27
28
28
Next, you'll need to add the Signals SDKs to your web environment.
29
29
30
-
Choose one of the following installation methods based on your setup:
30
+
Choose the installation method that matches your setup:
31
31
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.
33
34
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)
35
36
36
37
> 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:
38
41
39
42
```html
40
43
<head>
@@ -148,41 +151,42 @@ For websites using the Segment snippet, you'll need to replace the regular Segme
148
151
</head>
149
152
```
150
153
151
-
### Option B: NPM Users
154
+
Verify that you only have **one snippet** in your site, then move to
152
155
153
-
1. Add the Signals SDK to your project:
156
+
### Option B: Install with a package manager
154
157
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
+
```
163
167
164
168
2. Add the initialization code and configuration options:
165
169
166
-
> success ""
167
-
> see [configuration options](#configuration-options) for a complete list.
170
+
> success ""
171
+
> see [configuration options](#configuration-options) for a complete list.
0 commit comments