You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aeeb756
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/migration-7.x-to-8.0.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ You need to change code if your app does any of these:
16
16
- sets `$process_person_profile` to turn person processing on for events without a distinct ID
17
17
- passes strings such as `"true"` for `$cookieless_mode`, `$ignore_sent_at` or `$process_person_profile`
18
18
- expects `super_properties` to override properties passed to a single call
19
+
- reads or removes context tags, `super_properties` or `$release_id` in `before_send`
19
20
- tests the AI integrations with a mock client and asserts on `capture`
20
21
- passes its own client object to the AI integrations
21
22
@@ -92,21 +93,23 @@ Capture v1 sends processing options in an `options` object, next to `properties`
92
93
-`super_options` sets options on every event, like `super_properties`.
93
94
-`set_context_option(key, value)` sets an option for the current context, like `tag()`.
94
95
- Options are sent as given. PostHog validates them.
95
-
- The legacy properties `$cookieless_mode`, `$ignore_sent_at`, `$product_tour_id` and `$process_person_profile` still work. They move into options after `before_send`. Their values are no longer converted, so pass `True` or `False`, not `"true"`.
96
+
- The legacy properties `$cookieless_mode`, `$ignore_sent_at`, `$product_tour_id` and `$process_person_profile` still work. They fill the matching option only when it is unset, and the SDK always removes them from `properties`. Their values are no longer converted, so pass `True` or `False`, not `"true"`.
96
97
- An option set at any layer wins over its legacy property set at any layer. For example, `super_options={"cookieless_mode": True}` wins over an event's `$cookieless_mode: False`. When you move a default to options, move the per-event overrides of that key to options too.
97
-
- A `None` option counts as unset.
98
+
- A `None` option counts as unset, so a later step can fill it.
98
99
99
-
Values apply in this order, and each layer overrides the ones before it:
100
+
Values apply in this order. After `before_send`, each step fills only the options and properties that the steps before it left unset:
100
101
101
-
1.options the SDK sets, such as turning off person processing for events without a distinct ID
102
-
2.`super_options` and `super_properties`
102
+
1. the `options` and `properties` of the call
103
+
2.`before_send`
103
104
3. context options and tags
104
-
4. the `options` and `properties` of the call
105
-
5.`before_send`
105
+
4.`super_options` and `super_properties`
106
+
5. values the SDK sets: `options.process_person_profile = false` for events without a distinct ID, and `$release_id` from `POSTHOG_RELEASE_ID`
107
+
6. legacy properties, which fill unset options and are then removed
106
108
107
-
Two changes follow from this order:
109
+
Three changes follow from this order:
108
110
109
111
- Properties passed to a call now override `super_properties`. `super_properties` can no longer change `$lib`, `$lib_version` or `$geoip_disable`.
112
+
-`before_send` no longer sees context tags, context options, `super_properties`, `super_options` or `$release_id`. They fill in after it runs, so it cannot read or remove them, and its own changes win over them. To keep a super property off one event, set that key in the call's `properties` or in `before_send`.
110
113
- An event without a distinct ID gets `options.process_person_profile = false`. A `$process_person_profile: true` property no longer turns person processing back on. Set the option instead.
0 commit comments