Skip to content

Commit 2c93d13

Browse files
authored
Merge pull request #4280 from segmentio/tanjinhong72-patch-2
Added information that sending of null property or trait is not possible.
2 parents 5e97ba9 + 731a5e5 commit 2c93d13

File tree

1 file changed

+16
-9
lines changed
  • src/connections/sources/catalog/libraries/server/java

1 file changed

+16
-9
lines changed

src/connections/sources/catalog/libraries/server/java/index.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ id: V6ynUvQgbc
55
---
66
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.java/analytics/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.java/analytics)
77

8-
Our Java library lets you record analytics data from your Java code. The requests hit our servers, and then we route your data to any analytics service you enable on your destinations page.
8+
Segment's Java library lets you record analytics data from your Java code. The requests hit Segment's servers, and then route your data to any analytics service you enable on your destinations page.
99

1010
This library is open-source, so you can [check it out on GitHub](https://github.com/segmentio/analytics-java).
1111

@@ -60,10 +60,17 @@ The following examples use [Guava's](https://github.com/google/guava) immutable
6060

6161
### Regional configuration
6262
{% include content/regional-config.md %}
63-
## Identify
6463

65-
> note ""
66-
> **Good to know**: For any of the different methods described on this page, you can replace the properties and traits in the code samples with variables that represent the data collected.
64+
65+
## Basic tracking methods
66+
The basic tracking methods below serve as the building blocks of your Segment tracking. They include [Identify](#identify), [Track](#track), [Page](#page), [Group](#group), and [Alias](#alias). These methods correspond with those used in the [Segment Spec](/docs/connections/spec/). The documentation on this page explains how to use these methods in Analytics for Java.
67+
68+
> info ""
69+
> For any of the different methods described on this page, you can replace the properties and traits in the code samples with variables that represent the data collected.
70+
>
71+
> Note that sending a property or trait with a null value won't be possible as Guava's immutable maps will reject the null value and the GSON library used to serialize the Java object will ignore it. As a workaround, you can send an empty string instead of a null value in on your properties or traits.
72+
73+
### Identify
6774

6875
`identify` lets you tie a user to their actions and record traits about them. It includes a unique User ID and any optional traits you know about them.
6976

@@ -101,7 +108,7 @@ Read more in our [transformer reference section](/docs/connections/sources/catal
101108

102109
Find details on the **identify method payload** in our [Spec](/docs/connections/spec/identify/).
103110

104-
## Track
111+
### Track
105112

106113
`track` lets you record the actions your users perform. Every action triggers what we call an "event", which can also have associated properties.
107114

@@ -144,7 +151,7 @@ The `track` call has the following fields:
144151

145152
Find details on **best practices in event naming** as well as the **`track` method payload** in our [Spec](/docs/connections/spec/track/).
146153

147-
## Screen
154+
### Screen
148155

149156
The [`screen`](/docs/connections/spec/screen/) method lets you record whenever a user sees a screen of your mobile app, along with optional extra information about the screen being viewed.
150157

@@ -184,7 +191,7 @@ The `screen` call has the following fields:
184191

185192
Find details on the **`screen` payload** in our [Spec](/docs/connections/spec/screen/).
186193

187-
## Page
194+
### Page
188195

189196
The [`page`](/docs/connections/spec/page/) method lets you record whenever a user sees a page of your website, along with optional extra information about the page being viewed.
190197

@@ -222,7 +229,7 @@ The `page` call has the following fields:
222229

223230
Find details on the **`page` payload** in our [Spec](/docs/connections/spec/page/).
224231

225-
## Group
232+
### Group
226233

227234
`group` lets you associate an [identified user](/docs/connections/sources/catalog/libraries/server/java/#identify) user with a group. A group could be a company, organization, account, project or team! It also lets you record custom traits about the group, like industry or number of employees.
228235

@@ -260,7 +267,7 @@ The `group` call has the following fields:
260267

261268
Find more details about `group`, including the **`group` payload**, in our [Spec](/docs/connections/spec/group/).
262269

263-
## Alias
270+
### Alias
264271

265272
`alias` is how you associate one identity with another. This is an advanced method, but it is required to manage user identities successfully in *some* of our destinations.
266273

0 commit comments

Comments
 (0)