Closed ericmeadows closed 1 year ago
Workaround: you can use groups through providing $groups { 'company': 'id5'}
like so in properties
So something akin to the following, or does it need to be a string?
HashMap<String, String> groups = new HashMap<String, String>() {
{
put("groupId", groupId);
}
};
HashMap<String, Object> eventData = new HashMap<String, Object>() {
{
put("dataKey1", dataValue1);
put("dataKey2", dataValue2);
put("$groups", groups);
}
};
Another quick item in the documentation is that id:5
does not let me know ahead of time if it will be 5
, or id:5
in the stored data type.
Yes that looks right. Let me know if it didn't work. With "company" and "id:5" I was referring to the examples we use in the docs in other libraries (e.g. https://posthog.com/docs/integrate/server/python#group-analytics) - which is just a random name we picked to use, you could use names like "google", "meta" etc instead or whatever makes sense for your groups
Thank you!! That worked. It might be good to add that in the documentation for Java because I thought groups was completely not supported.
Is there a workaround to send group properties in Java?
This is now documented so closing 😄
We are trying to use the product, and groups are not yet supported. Please create parity with the other languages in terms of features.