PostHog / posthog-filter-out-plugin

🦔 Injest only those events satisfying the given filter conditions
MIT License
3 stars 3 forks source link

Filters Out `pageview` and `click` Events When Activated #7

Closed JamesJosephFinn closed 6 months ago

JamesJosephFinn commented 6 months ago

I have a JSON config to accomplish standard IP filtering; the goal being to prevent ingestion of any events originating from a given IP in the array; as follows:

[
  {
    "property": "$ip",
    "type": "string",
    "operator": "is_not",
    "value": "1.1.1.1"
  },
  {
    "property": "$ip",
    "type": "string",
    "operator": "is_not",
    "value": "2.2.2.2"
  }
]

This configuration successfully filters events from being ingested by Posthog, if the events originate from one of the given IPs.

However, with this plugin activated, all pageview and click events have also stopped being logged. The only events I'm seeing left with this plugin activated are pageleave.

I'm new to Posthog, and have not registered any custom events; so my setup is the default configuration; other than this plugin.

Thank you for assisting.

JamesJosephFinn commented 6 months ago

My apologies for the confusion here; I had utilized the "Events to filter out" field in the plugin config settings panel; thinking that whatever events are set in this field will only be filtered out IF the conditions in the main JSON config are first met.

As it turns out, the main JSON config file, and the aforementioned field, each have respective logic that is run completely independent of the other.

Trial and error.

Thanks for the great software; and for bearing with me. Peace.

thepuzzlemaster commented 3 months ago

I find this behavior a bit surprising. It would seem like filtering specific events based on the filter criteria would make way more sense that just a separate "filter all events of this type" field. I'm sure the original author had a specific use-case they were solving for, but it does seem like a weird edge-case one, and not super intuitive given the nature of this plugin.