Skip to content

Commit c4a298b

Browse files
authored
Update alias docs
1 parent ae8817b commit c4a298b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

posthog/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def group_identify(
199199

200200

201201
def alias(
202-
previous_id, # type: str,
203202
distinct_id, # type: str,
203+
alias_id, # type: str,
204204
context=None, # type: Optional[Dict]
205205
timestamp=None, # type: Optional[datetime.datetime]
206206
uuid=None, # type: Optional[str]
@@ -214,18 +214,25 @@ def alias(
214214
The same concept applies for when a user logs in.
215215
216216
An `alias` call requires
217-
- `previous distinct id` the unique ID of the user before
218-
- `distinct id` the current unique id
217+
- `distinct id` the current unique id of the user (normally the id in your database)
218+
- `alias distinct id` the alias id you want to attach to the user, such as the anonymous session id or another ID like their email
219+
219220
220221
For example:
221222
```python
222-
posthog.alias('anonymous session id', 'distinct id')
223+
posthog.alias('distinct id', 'anonymous session id')
224+
```
225+
226+
or
227+
228+
```python
229+
posthog.alias('distinct id', '[email protected]')
223230
```
224231
"""
225232
_proxy(
226233
"alias",
227-
previous_id=previous_id,
228234
distinct_id=distinct_id,
235+
previous_id=previous_id,
229236
context=context,
230237
timestamp=timestamp,
231238
uuid=uuid,

0 commit comments

Comments
 (0)