-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add group analytics support #26
Conversation
To capture an event with groups: ```php PostHog::capture(array( 'distinctId' => 'user:123', 'event' => 'movie played', '$groups' => array("organization" => "id:5") )); ``` To update group properties: ```php PostHog::groupIdentify(array( 'groupType' => 'organization', 'groupKey' => 'id:5', 'properties' => array("employees" => 11) )); ```
"\n" . | ||
"\n Usage:" . | ||
"\n posthog --type capture --distinctId \"id\" --event \"event name\" --properties \"{ json: 'object' }\"" . | ||
"\n posthog --type identify --distinctId \"id\" --properties \"{ json: 'object' }" . | ||
"\n posthog --type capture --distinctId \"id\" --event \"event name\" --properties '{ \"json\": \"object\" }'" . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually for just getting rid of the CLIs altogether - I think a lot of them are broken too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not relevant here though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the CLI was the only way I could test this though. Fixed what I found broken though
This PR:
To capture an event with groups:
To update group properties:
Tested manually + with unit tests.
@liyiy for group analytics change review
@yakkomajuri since this includes some library-level fixes