Skip to content

Support anonymize_ips in posthog_project_settings #146

Description

@HerrNiklasRaab

The project setting "Discard client IP data" (anonymize_ips on /api/projects/:id) can't be managed by the provider today: posthog_project only covers name/timezone, and posthog_project_settings covers the capture opt-ins but not this field. The REST API reads and PATCHes it fine.

Our use case: we send Conversions API events to Meta from a PostHog destination, and client_ip_address comes from event.properties.$ip. With anonymize_ips enabled the IP is discarded at ingestion, which degrades Meta's event matching (Events Manager flags "user agent sent without IP address"). We'd like the toggle under IaC next to the other project settings instead of a manual UI/API edit.

It should slot into the existing pattern in internal/resource/project_settings.go:

  • AnonymizeIps types.Bool + schema attribute (optional, computed)
  • AnonymizeIps *bool `json:"anonymize_ips,omitempty"` on the project structs in internal/httpclient/project.go
  • the usual BoolPtrFromValue / BoolDiverged / PtrToBool wiring in create/read/update

Happy to open a PR if you'd take it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions