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

Add a filter API to plugins to decide whether to track an event or not (close #608) #609

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

matus-tomlein
Copy link
Contributor

Issue #608

Adds a new filter callback to plugins which enables deciding whether to track an event or not. This can be useful for filtering auto-tracked events by the tracker.

For instance, this snippet filters screen view events to keep only ones with a specific name property:

plugin.filter(
    schemas = listOf(
        "iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0", // screen view events
    )
) { event ->
    event.payload["name"] == "Home Screen"
}

Documentation

Here is a commit adding the documentation for the filter function.

@matus-tomlein matus-tomlein requested a review from mscwilson May 29, 2023 13:00
Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

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

LGTM

@matus-tomlein matus-tomlein merged commit 0667db8 into release/5.2.0 Jun 2, 2023
@matus-tomlein matus-tomlein deleted the issue/plugins_filter branch June 2, 2023 09:29
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.

2 participants