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

fix(groups): actually add groups support for capture #41

Merged
merged 3 commits into from
Mar 21, 2023
Merged

Conversation

macobo
Copy link
Contributor

@macobo macobo commented Jan 13, 2023

I added groups feature in #26 but didn't add all the functionality I advertised.

Tested via:

<?php

require_once __DIR__ . '/vendor/autoload.php';

use PostHog\PostHog;

PostHog::init("phc_DZgJcBXRIkZvPpwiwrKSyUqTVtz8qhiFzaED6ldjcT9", array('host' => 'http://localhost:8000', 'ssl' => false));

PostHog::capture(array(
  'distinctId' => 'user:123',
  'event' => 'movie played',
  '$groups' => array("organization" => "id:5")
));

PostHog::groupIdentify(array(
  'groupType' => 'organization',
  'groupKey' => 'id:5',
));

PostHog::flush();

?>

In posthog:

image

Copy link
Contributor

@neilkakkar neilkakkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh, makes sense!

@tiina303
Copy link

any reason this isn't merged?

@EDsCODE EDsCODE merged commit 97d1c4c into master Mar 21, 2023
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.

4 participants