1. 程式人生 > >Should I instrument data collection on the client or server? Documentation

Should I instrument data collection on the client or server? Documentation

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?”

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. It’s worth a read!

Client-side

Not stored in your database

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.

Easier to send client-side

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.

Events needed for client-side only destinations

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.

Server-side

Payment events

Charging customers often happens when they aren’t online, and accuracy for payments is so important. Server-side tracking tends to be more accurate than user devices since it’s a more controlled environment.

Accuracy

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.

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.

Calculated from your database

Another good type of data to send server-side are things that need to be calculated from a database query. This might be something like “Friend Count” if your site or app is a social network.

Sensitive information

Sensitive information is also best kept out of browsers. Any data you don’t want exposed to users should be sent server-side.

Selecting Destinations

Each Segment library allows an integrations object either as a top level object or nested in options object. Check your library docs for details; look for the section titled “Selecting Destinations”.

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:

If you have any questions, or see anywhere we can improve our documentation, please let us know!

相關推薦

Should I instrument data collection on the client or server? Documentation

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?”This is such an impor

When to Track on the Client vs. Server

Knowing how to consolidate events and effectively use properties can make the implementation easier. However, we are still faced with the choice a

Can I use the Profile API on the client-side? Documentation

For security reasons, we require the Profile API only be used server-side. The Profile API allows you to look up data about any user given an identifier (e

Enable SMB2 on the Client

lse not ould sys pen like isa tar chan HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation edit DependOnService and ad

I am declaring war on the phone zombie apocalypse

It’s biology kid…Disclaimer : Before working as a designer, I studied archaeology and ancient human civilisations — So I’m not making this shit up!It turns

寫入的響應頭的資料超出緩Increase maxHttpHeaderSize on the connector or write less data into the response headers

最近寫了帶有檔案上傳的專案遇到的坑 報錯問題: 嚴重: Servlet.service() for servlet [springServlet] in context with path [] threw exception [Request processing failed; nest

My app status is Ready for Sale but I cannot see my app on the App Store. Why? 為什麽審核通過後 appstore中搜不到我的app

one soci orm event 什麽 live pstore follow following 這是蘋果的官方解答 The following factors could prevent your app from showing up on the App St

No data is deployed on the contract address!

宋體 9.png contract ges .com 3-9 .cn pan image N o data is deployed on the contract address! 在開發以太坊的過程中遇到這樣的錯誤解決方法: 1 . 2 .

A Survey on the Security of Stateful SDN Data Planes

語言 共享 虛擬 fault conf enter 完整性 鏈路 定義 論文摘要: 本文為讀者提供新興的SDN帶狀態數據平面,集中關註SDN數據平面編程性帶來的隱患。 I部分 介紹 A.帶狀態SDN數據平面的 B.帶狀態數據平面帶來的安全隱患   引出帶狀態數據平面的安全隱

Nginx上傳檔案413錯誤Processing of multipart/form-data request failed. Unexpected EOF read on the socket

問題描述: 利用ajax通過nginx上傳檔案到tomcat時,前端url報413http錯誤。 後臺tomcat控制檯也輸出對應的異常資訊,如下。 解決方法: 新增上傳檔案大小的最大值。 修改nginx的配置檔案:nginx.conf。目錄一般在 /usr/local/n

Form is submitted when I click on the button in form. How to avoid this?

原來button 沒加 type 屬性,會變成 submit @[email protected]; 太久沒寫網頁,這個變化真大。 A button element with no type attribute specified represents the same thing as a butto

How Much Should I Spend on a Domain?

How Much Should I Spend on a Domain?At least 1%, but up 80% of your budgetThis might sound absurd, how could some one ever justify spending 80% of their bu

What Should I Do About the Latest Facebook Breach?

What Should I Do About the Latest Facebook Breach?The latest Facebook breach brings reinforcement of various lessons learned in the trenches by information

Ask HN: Why should I believe the Bloomberg reports regarding SuperMicro?

1. because it is technically possible?2. we should not 'believe'. but we should demand an investigation, and if it is true, then we may want to consider i

This is your Captain speaking, I’m turning on the fasten seat belt sign

This is your Captain speaking, I’m turning on the fasten seat belt signThis past weekend, I sent the email below to the 250+ founders I’ve invested in. The

Ask HN: Should I focus on building apps or practicing coding tasks to get a job?

Problem solving is a pretty important skill; very few whiteboard interviews address the day-to-day issues you'll see in a large production environment. Tas

IBM Melds Data Science, Business Intelligence on the Cloud

As enterprises turn to artificial intelligence (AI) to beef up business performance and drive competitive advantage, IBM is working to make analytics, data

Ask HN: I want to charge $50 for some service. Should I set the price to $4X.XX?

lol at $49.99 being evil. You need to recalibrate your good and evil meter.Another phrasing for "playing on the psychology of numbers" would be "Using la

Ask HN: Should I bother with UI Testing or focus on more API testing?

Hi all, LTL, FTP, looking for some advice on testing strategy. Thanks for reading.Some context: I have some time carved out within the next few weeks to de