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/sources/catalog/libraries/website/javascript/quickstart.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ Want to learn more? Check out the [Analytics.js reference](/docs/connections/sou
10
10
11
11
## Step 1: Create a source in the Segment app
12
12
13
-
Before you begin, you need a Workspace (which is a container that holds all of the Sources and Destinations that are billed together for an organization). You can sign up for a free Segment account and create a workspace.
13
+
Before you begin, you need a workspace (which is a container that holds all of the Sources and Destinations that are billed together for an organization). You can sign up for a free Segment account and create a workspace.
14
14
15
-
To create an Analytics.js source source in the Segment app:
15
+
To create an Analytics.js source in the Segment app:
16
16
1. Click **Add Source**.
17
17
2. From the source catalog page, click **JavaScript**.
18
18
3. Click **Add Source** again from the informational panel that appears to the right.
19
19
4. Give the source a display name, and enter the URL the source will collect data from.
20
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 website code to tell Segment servers where the data is coming from, so Segment can route it to your Destinations and other tools.
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 website code to tell Segment servers where the data is coming from, so Segment can route it to your destinations and other tools.
22
22
23
23
24
24
## Step 2: Install Segment to your site
@@ -28,12 +28,12 @@ You can choose to install Segment to your site in 1 of 2 ways:
28
28
[a. Add the Segment snippet to your app](#step-2a-add-the-segment-snippet)
29
29
30
30
31
-
[b. Install Segment as a NPM package](#step-2b-install-segment-as-a-npm-package)
31
+
[b. Install Segment as an NPM package](#step-2b-install-segment-as-a-npm-package)
32
32
33
33
### Step 2a: Add the Segment Snippet
34
34
35
35
> info ""
36
-
> You can find the latest version of the Segment snippet in the **Overview** tab of your Javascript source.
36
+
> You can find the latest version of the Segment snippet in the **Overview** tab of your JavaScript source.
37
37
38
38
To add the Segment snippet to your app:
39
39
@@ -53,11 +53,11 @@ Note that you should remove other native third-party destination code that you m
53
53
> info ""
54
54
> If you only want the most basic Google Analytics setup, there's no need to continue with the setup. Just toggle on Google Analytics in the Segment interface.
55
55
56
-
A lot of analytics and marketing tools need to record who each user is on your site. If you want to use any tool that deals with the identity of your users, read on about the Identify method.
56
+
Many analytics and marketing tools need to record who each user is on your site. If you want to use any tool that deals with the identity of your users, read on about the Identify method.
57
57
58
-
### Step 2b: Install Segment as a npm package
58
+
### Step 2b: Install Segment as an npm package
59
59
60
-
To install Segment as a npm package:
60
+
To install Segment as an npm package:
61
61
62
62
1. Install the analytics package.
63
63
@@ -92,11 +92,11 @@ For more initialization patterns and general information on `@segment/analytics-
92
92
> info ""
93
93
> 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.
94
94
95
-
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 method reference](/docs/connections/sources/catalog/libraries/website/javascript#identify).
95
+
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 method reference](/docs/connections/sources/catalog/libraries/website/javascript#identify).
96
96
97
97
You don't need to call Identify for anonymous visitors to your site. Segment automatically assigns them an `anonymousId`, so just calling `page` and `track` works just fine without Identify.
98
98
99
-
Here's what a basic call to Identify might look like:
99
+
Here's what a basic Identify call might look like:
100
100
101
101
```js
102
102
analytics.identify('f4ca124298', {
@@ -125,12 +125,12 @@ With that call in your page footer, you successfully identify every user that vi
125
125
126
126
If you only want to use a basic CRM setup, you can stop here. Just enable Salesforce, Intercom, or any other CRM system from your Segment workspace, and Segment starts sending all of your user data to it.
127
127
128
-
A lot of analytics tools record more than just _identities_ as they record the actions each user performs too. If you're looking for a complete event tracking analytics setup, keep reading...
128
+
A lot of analytics tools record more than just _identities_ as they record the actions each user performs too. If you're looking for a complete event tracking analytics setup, keep reading.
129
129
130
130
131
131
## Step 4: Track actions
132
132
133
-
The Track method is how you tell Segment about the actions your users are performing on your site. Every action triggers what's called an "event", which can also have associated properties. You can read more about Track in the [track method reference](/docs/connections/sources/catalog/libraries/website/javascript#track).
133
+
The Track method is how you tell Segment about the actions your users are performing on your site. Every action triggers what's called an "event", which can also have associated properties. You can read more about Track in the [Track method reference](/docs/connections/sources/catalog/libraries/website/javascript#track).
134
134
135
135
Here's what a call to a Track call might look like when a user signs up:
If you're just getting started, some of the events you should track are events that indicate the success of your site, like **Signed Up**, **Item Purchased** or **Article Bookmarked**.
153
+
If you're just getting started, some of the events you should track are events that indicate the success of your site, like **Signed Up**, **Item Purchased**, or **Article Bookmarked**.
154
154
155
155
To get started, Segment recommends that you track just a few important events. You can always add more later.
0 commit comments