RudderStack is a customer data pipeline tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.
RudderStack’s Java SDK allows you to track your customer event data from your Java code. Once enabled, the event requests hit the RudderStack servers. RudderStack then routes the events to the specified destination platforms as configured by you.
For detailed documentation on the Java SDK, click here.
Add to pom.xml
:
<dependency>
<groupId>com.rudderstack.sdk.java.analytics</groupId>
<artifactId>analytics</artifactId>
<version>x.y.z</version>
</dependency>
or if you're using Gradle:
implementation 'com.rudderstack.sdk.java.analytics:analytics:x.y.z'
RudderAnalytics analytics=RudderAnalytics
.builder("<WRITE_KEY>")
.setDataPlaneUrl("<DATA_PLANE_URL>")
.build();
Map<String, Object> map=new HashMap<>();
map.put("name","John Marshal");
map.put("email","john@example.com");
analytics.enqueue(IdentifyMessage.builder()
.userId("6754ds7d9")
.traits(map)
);
For more information on the different types of events supported by the Java SDK, refer to our docs.
If you come across any issues while configuring or using this SDK, feel free to start a conversation on our Slack channel. We will be happy to help you.