# Identify a user

## Custom Id

You can set a custom id in order to track/target users with id coming from different platforms.

To set a custom id:

```swift
MBAudience.setCustomId("CUSTOM_ID")
```

To remove it:

```swift
MBAudience.removeCustomId()
```

To retrieve the current saved id:

```swift
MBAudience.getCustomId()
```

## Mobile User Id

This is the id of the user currently logged in MBurger using MBAuth. At the moment the mobile user id is not sent automatically when a user log in/log out with MBAuth. It will be implemented in the future but at the moment you have to set and remove it manually when the user completes the login flow and when he logs out.

To set the mobile user id:

```swift
MBAudience.setMobileUserId(MOBILE_USER_ID)
```

To remove it, if the user logs out:

```swift
MBAudience.removeMobileUserId()
```

To get the currently saved mobile user id:

```swift
MBAudience.getMobileUserId()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ep.mburger.cloud/ios-docs/audience/identify-a-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
