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/guides/how-to-guides/collect-on-client-or-server.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,24 +2,24 @@
2
2
title: Collecting Data on the Client or Server
3
3
---
4
4
5
-
One of the most common questions we receive is: "Should I use one of your client-side libraries or one of your server-side libraries?"
5
+
One of the most common questions Segment receives is: "Should I use one of your client-side libraries or one of your server-side libraries?"
6
6
7
7
8
-
This is such an important topic that we've written up an in-depth article in our Analytics Academy: [When to Track on the Client vs Server](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/). It's worth a read. Below, you can also read some quick logic around why you may want to choose either option.
8
+
This is such an important topic that you'll find an in-depth article in Segment's Analytics Academy: [When to Track on the Client vs Server](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/). It's worth a read. Below, you can also read some quick logic around why you may want to choose either option.
9
9
10
10
### Client-side
11
11
12
12
#### Not stored in your database
13
13
14
-
Good things to send from the client-side are things that you wouldn't usually store in your database. Things like page views, button clicks, page scroll length, mouse movements, social shares and likes.
14
+
Good things to send from the client-side are things that you wouldn't usually store in your database. Things like page views, button clicks, page scroll length, mouse movements, social shares, and likes.
15
15
16
16
#### Easier to send client-side
17
17
18
18
Things like UTM tags, operating system, device type, or cookied data like returning visitors are all easiest to track client-side. Of course, some things like mouse movements are only available on the client-side so you should definitely track that there.
19
19
20
20
#### Events needed for client-side only destinations
21
21
22
-
Some destinations can only accept data when the event is sent from the browser. They require events on the client since they rely on cookies and most of those tools do not have an API that Segment can send server-side data to. More on this in our Analytics.js docs.
22
+
Some destinations can only accept data when the event is sent from the browser. They require events on the client since they rely on cookies and most of those tools do not have an API that Segment can send server-side data to. More on this in Segment's [Analytics.js docs](/docs/connections/sources/catalog/libraries/website/javascript/cookie-validity-update/#client-side-persistence-in-analytics-js).
23
23
24
24
### Server-side
25
25
@@ -31,7 +31,7 @@ Charging customers often happens when they aren't online, and accuracy for payme
31
31
32
32
In general client-side data is fine for watching general trending, but it's never going to be perfect. Especially if your customers are likely to use things like adblock or old/non-standard browsers.
33
33
34
-
For example, if you're sending triggered emails based on events, it's probably a good idea to make sure your user profiles are sent through our servers so no one gets left out or mis-emailed.
34
+
For example, if you're sending triggered emails based on events, it's probably a good idea to make sure your user profiles are sent through Segment's servers so no one gets left out or mis-emailed.
35
35
36
36
#### Calculated from your database
37
37
@@ -45,7 +45,7 @@ Sensitive information is also best kept out of browsers. Any data you don't want
45
45
46
46
Each Segment library allows an `integrations` object either as a top level object or nested in options object. [Check your library docs](https://segment.com/docs/connections/sources/) for details; look for the section titled ["Selecting Destinations"](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#selecting-destinations-with-the-integrations-object).
47
47
48
-
This flag may be especially useful in Legacy source types, where an event might be triggered on both the client & server for various reasons. The following will cause the payload to be sent to all enabled tools EXCEPT Facebook Pixel:
48
+
This flag may be especially useful in Legacy source types, where an event might be triggered on both the client and server for various reasons. The following will cause the payload to be sent to all enabled tools **except** Facebook Pixel:
0 commit comments