# Subject methods
> Configure subject properties in Scala tracker 0.5.0 including platform, user ID, screen resolution, viewport, timezone, and domain user ID.
> Source: https://docs.snowplow.io/docs/sources/scala-tracker/previous-versions/0-5-0/subject-methods/
> Documentation index: https://docs.snowplow.io/llms.txt
> Status: Previous version
> Current version: https://docs.snowplow.io/docs/sources/scala-tracker/

A list of the methods used to add data to the Subject class.

### Set the platform with `setPlatform`

The default platform is `Server`. These are the available alternatives, all available in the package `com.snowplowanalytics.snowplow.scalatracker`:

- Server
- Web
- Mobile
- Desktop
- Tv
- Console
- InternetOfThings
- General

Example usage

```java
subject.setPlatform(Tv)
```

### Set the user ID with `setUserId`

You can make the user ID a string of your choice:

```java
subject.setUserId("user-000563456")
```

### Set the screen resolution with `setScreenResolution`

If your Scala code has access to the device's screen resolution, you can pass it in to Snowplow. Both numbers should be positive integers; note the order is width followed by height. Example:

```java
subject.setScreenResolution(1366, 768)
```

### Set the viewport dimensions with `setViewport`

Similarly, you can pass the viewport dimensions in to Snowplow. Again, both numbers should be positive integers and the order is width followed by height. Example:

```java
subject.setViewport(300, 200)
```

### Set the color depth with `setColorDepth`

If your Scala code has access to the bit depth of the device's color palette for displaying images, you can pass it in to Snowplow. The number should be a positive integer, in bits per pixel.

```java
subject.setColorDepth(24)
```

### Setting the timezone with `setTimezone`

If your Scala code has access to the timezone of the device, you can pass it in to Snowplow:

```java
subject.setTimezone("Europe London")
```

### Setting the language with `setLang`

You can set the language field like this:

```java
subject.setLang("en")
```

### Setting the IP address with `setIpAddress`

If you have access to the user's IP address, you can set it like this:

```java
subject.setIpAddresss("34.634.11.139")
```

### Setting the useragent with `setUseragent`

If you have access to the user's useragent (sometimes called "browser string"), you can set it like this:

```java
subject.setUseragent("Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0")
```

### Setting the domain user ID with `setDomainUserId`

The `domain_userid` field of the Snowplow event model corresponds to the ID stored in the first party cookie set by the Snowplow JavaScript Tracker. If you want to match up server-side events with client-side events, you can set the domain user ID for server-side events like this:

```java
subject.setDomainUserId("c7aadf5c60a5dff9")
```

### Setting the network user ID with `setNetworkUserId`

The `network_user_id` field of the Snowplow event model corresponds to the ID stored in the third party cookie set by the Snowplow Clojure Collector and Scala Stream Collector. You can set the network user ID for server-side events like this:

```java
subject.setNetworkUserId("ecdff4d0-9175-40ac-a8bb-325c49733607")
```
