---
title: "The DeviceIdentifier method"
slug: "the-deviceidentifier-method"
abstract: "Overview of the DeviceIdentifier method and properties with example."
---
# The DeviceIdentifier method

To add the device identifier property to an event, use the `DeviceIdentifier()` method.

| Property | Details |
| --- | --- |
| UT SDK methods | `DeviceIdentifier(string)` |
| Required/optional | Optional |
| Multiple invocations | Multiple invocations are forbidden and cause an *InvalidOperationException* exception |
| Value validation | Must contain at least one symbol besides whitespace characters<br><br>Field names cannot be null or empty<br><br>Recommended values are `identifierForVendor()` for iOS, and `getSerial()` or similar for Android |

For example:

```csharp
Dictionary<string, string> customParameters = new Dictionary<string, string>();
customParameters.Add("param11", "paramValue11");
customParameters.Add("param22", "paramValue22");
customParameters.Add("param33", "paramValue33");

var eventRequest = UTRequestBuilder.EventWithDefinitionId("01f8ffbf-d662-4a87-beee-413307055c48")
                                   .AddCustomValues("key1", "value1")
                                   .AddCustomValues("key2", "value2")
                                   .AddCustomValues(customParameters)
                                   .ParentEventId("01f8ffbf-d662-4a87-beee-413307055c48")
                                   .Timestamp(DateTime.Now)?
```