Skip to content

feat: Allow groupIdentify distinct ID override#141

Merged
dustinbyrne merged 1 commit into
mainfrom
feat/groupidentify-distinct-id-override
May 18, 2026
Merged

feat: Allow groupIdentify distinct ID override#141
dustinbyrne merged 1 commit into
mainfrom
feat/groupidentify-distinct-id-override

Conversation

@dustinbyrne
Copy link
Copy Markdown
Contributor

💡 Motivation and Context

groupIdentify() currently always uses a synthetic distinct ID like $team_team_x2, which can create one dummy person per group. Other server-side SDKs allow callers to override the distinct ID used for the $groupidentify event.

This adds a backwards-compatible optional distinctId / distinct_id override while preserving the current synthetic ID default when omitted.

💚 How did you test it?

  • ./vendor/bin/phpcs --standard=phpcs.xml lib/PostHog.php test/RequestContextTest.php bin/posthog
  • ./vendor/bin/phpunit --no-coverage --filter 'RequestContextTest'
  • ./vendor/bin/phpunit --no-coverage (passes with existing warnings/deprecations)

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

@dustinbyrne dustinbyrne changed the title Allow groupIdentify distinct ID override feat: Allow groupIdentify distinct ID override May 18, 2026
@dustinbyrne dustinbyrne merged commit 10e985b into main May 18, 2026
16 checks passed
@dustinbyrne dustinbyrne deleted the feat/groupidentify-distinct-id-override branch May 18, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants