Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group Analytics #9

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Group Analytics #9

wants to merge 16 commits into from

Conversation

taj-p
Copy link

@taj-p taj-p commented Dec 23, 2023

Groups

Group analytics support.

Identifying Groups

Groups can be created with group_identify.

let client = crate::client(env!("POSTHOG_API_KEY"));

let mut event = GroupIdentify::new("organisation", "some_id");
event.insert_prop("status", "active").unwrap();

client.group_identify(event).unwrap();

Associating Events with a Group

let client = crate::client(env!("POSTHOG_API_KEY"));

let mut event = Event::new("test", "1234");

// Optionally associate this event with a group (in this case,
// a "company" group type with key "company_id_123").
event.insert_group("company", "company_id_123");

client.capture(event).unwrap();

Depends On

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants