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-pageviews-serverside.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ With this approach, you might use a request "middleware" to log a `pageview` w
10
10
11
11
There are a few things to be mindful of if you want to make sure you can attribute these (anonymous) page views to the appropriate user in your client-side source (eg, for effectively joining these tables together to do down-funnel behavioral attribution). You'll want to ensure they share an `anonymousId` by respecting one if it's already there, and setting it yourself if not. To do that, you can read and modify the `ajs_anonymous_id` cookie value in the request.
12
12
13
-
Be sure to pass through as many fields as you can in our [page](https://segment.com/docs/connections/spec/page/) and [context](https://segment.com/docs/connections/spec/common/) spec, so that you get full functionality in any downstream tools you choose to enable. We recommend specifically ensuring you pass the **url, path, host, title, query, and referrer** in the message `properties` and **ip and user-agent** in the message `context` .
13
+
Be sure to pass through as many fields as you can in our [page](https://segment.com/docs/connections/spec/page/) and [context](https://segment.com/docs/connections/spec/common/) spec, so that you get full functionality in any downstream tools you choose to enable. We recommend specifically ensuring you pass the **url, path, host, title, search, and referrer** in the message `properties` and **ip and user-agent** in the message `context` .
14
14
15
15
Here's an example of an express middleware function that covers all those edge cases!
0 commit comments