I have segment working and sending events to MixPanel using javascript. Now we want to do it using Java. I tried to follow the example on https://segment.com/docs/sources/server/java/#selecting-integrations Copying from the link above, I added, similarly, to my code, the snippets:
Analytics analytics = Analytics.builder(writeKey).build();
analytics.enqueue(IdentifyMessage.builder()
.userId("f4ca124298")
.traits(ImmutableMap.builder()
.put("name", "Michael Bolton")
.put("email", "mbolton@initech.com")
.build()
)
);
analytics.enqueue(TrackMessage.builder("Item Purchased")
.userId("f4ca124298")
.properties(ImmutableMap.builder()
.put("revenue", 39.95)
.put("shipping", "2-day")
.build()
)
);
analytics.flush()
The program is running correctly, but I cannot see any event on MixPanel. I am wondering what I might be doing wrong.
Is anyone able to assist?
Thank you in advance,
Thais.