How to protect user privacy with the Property Filter app

Dec 09, 2024

When collecting data with PostHog, you may want to avoid collecting certain properties for privacy reasons. For example, you may want to ensure you never collect IP addresses or exact locations.

That's where the property filter app, which was created by the team at Witty Works, comes in. It gives you fine-grained control over which properties are kept or discarded from your events, helping you balance data collection needs with privacy requirements. Here's how to use it.

Note: If you prefer not to use the property filter app, you can also filter properties by using the sanitize configuration option when initializing the PostHog client. See the sanitize docs for more details.

How to set up the property filter app

The property filter app works by setting the selected properties to null when events are ingested. Here's how to set it up:

  1. Navigate to the data pipelines tab in PostHog.
  2. Click the + New button in the top right.
  3. Select Transformation from the dropdown.
  4. Next to the Property Filter app, click + Create.
  5. Click Enabled to turn on the app.
  6. Type the properties you want to filter out in the text field. Separate properties with commas, without using spaces, like so: foo,bar,baz.

List of default PostHog properties

Below is a list of some of the properties that PostHog captures by default. You can see the full list of properties that PostHog captures by default in GitHub.

Note that PostHog's default properties begin with $, so you'll need to include this when adding them to the property filter app. For example, $ip,$os.

NameKeyExample value
Timestamp$timestamp2024-05-29T17:32:07.202Z
OS$osMac OS X
OS Version$os_version10.15.7
Browser$browserChrome
Browser Version$browser_version125
Device Type$device_typeDesktop
Current URL$current_urlhttps://example.com/page
Host$hostexample.com
Path Name$pathname/page
Screen Height$screen_height1080
Screen Width$screen_width1920
Viewport Height$viewport_height950
Viewport Width$viewport_width1903
Library$libweb
Library Version$lib_version1.31.0
Search Engine$search_enginegoogle
Referrer URL$referrerhttps://google.com
Referring Domain$referring_domainwww.google.com
Active Feature Flags$active_feature_flags['beta_feature']
Event Type$event_typeclick
UTM Source$utm_sourcenewsletter
UTM Medium$utm_mediumemail
UTM Campaign$utm_campaignproduct_launch
UTM Term$utm_termnew+product
UTM Content$utm_contentlogolink
Google Click ID$gclidTeSter-123
Google Ads Source$gad_sourcegoogle_ads
Google Search Ads 360 Click$gclsrcdsa
Google DoubleClick Click ID$dclidtestDclid123
Google Web-to-app Measure$wbraidtestWbraid123
Google App-to-web Measure$gbraidtestGbraid123
Facebook Click ID$fbclidtestFbclid123
Microsoft Click ID$msclkidtestMsclkid123
Twitter Click ID$twclidtestTwclid123
LinkedIn Ad Tracking ID$la_fat_idtestLaFatId123
Mailchimp Campaign ID$mc_cidtestMcCid123
Instagram Share Id$igshidtestIgshid123
TikTok Click ID$ttclidtestTtclid123
Plugins Succeeded$plugins_succeeded['GeoIP (56578)']
Plugins Failed$plugins_failed['plugin3']
Plugins Deferred$plugins_deferred['plugin4']
IP Address$ip192.168.1.1

Filtering GeoIP properties

PostHog enriches events with the GeoIP app based on the IP address. You either disable this app completely or filter out specific properties using the property filter app.

The current list of GeoIP properties is shown below. For the most up-to-date list, see the source code.

  • $geoip_city_name
  • $geoip_country_name
  • $geoip_country_code
  • $geoip_continent_name
  • $geoip_continent_code
  • $geoip_latitude
  • $geoip_longitude
  • $geoip_time_zone
  • $geoip_subdivision_1_code
  • $geoip_subdivision_1_name
  • $geoip_subdivision_2_code
  • $geoip_subdivision_2_name
  • $geoip_subdivision_3_code
  • $geoip_subdivision_3_name

(Optional) Configure the order of transformations

Transformations in PostHog run in sequential order, so you should carefully consider where you place the property filter app. For example, you may want to place it after other apps that might need the data.

Here's how to reorder transformations:

  1. Go to the transformations tab.
  2. Click Change order just above the table.
  3. Drag and drop apps to change their order.

Further reading

Comments