Skip to content

Surveys: Support event trigger property filters #392

@adboio

Description

@adboio

🚨 IMPORTANT

This issue is likely user-facing in the main PostHog app, see surveyVersionRequirements.ts. If you delete or close this issue, be sure to update the version requirements list there.

Summary

The Android SDK does not support event property filters for survey event triggers. Currently, onEvent(event: String) only matches on event name, ignoring any property filter conditions.

Current State

  • PostHogSurveysIntegration.kt line 827-846: onEvent(event: String) only receives the event name
  • Event-to-survey mapping only checks if the event name matches, not property filters
  • The survey model may parse propertyFilters but they are never evaluated in matching logic

Expected Behavior

When a survey is configured with event triggers that have property filters (e.g., "show survey when button_clicked event has button_name = 'signup'"), the SDK should:

  1. Receive the event properties along with the event name
  2. Evaluate the property filters using the same comparison operators as posthog-js
  3. Only activate the survey if both event name AND property filters match

Reference Implementation

See posthog-js browser: packages/browser/src/utils/event-receiver.ts - the _doesEventMatchFilter method and matchPropertyFilters function in property-utils.ts

Tracking

This is tracked in the survey SDK feature parity issue: PostHog/posthog#45658

This issue was generated by Claude using the /survey-sdk-audit skill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions