# UpdateAdCounterHistogramRequest.Builder

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder "View this page in Java")  

```
class Builder
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                                   ||
| ↳ | [android.adservices.adselection.UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) |

Builder for[UpdateAdCounterHistogramRequest](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest)objects.

## Summary

|                                                                                                                                                                                                                                                                        Public constructors                                                                                                                                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#Builder(kotlin.Long,%20kotlin.Int,%20android.adservices.common.AdTechIdentifier))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `adEventType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `callerAdTech:` `[AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#)`)` <br /> |

|                                                                                                                                                                                                                                                                                                                            Public methods                                                                                                                                                                                                                                                                                                                            ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UpdateAdCounterHistogramRequest](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#build())`()` Builds the[UpdateAdCounterHistogramRequest](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest)object.                                                                                                                                                                                      |
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | [setAdEventType](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#setAdEventType(kotlin.Int))`(`adEventType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the ad event type which, along with an ad's counter keys, identifies which histogram should be updated.                                                                                                                    |
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | [setAdSelectionId](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#setAdSelectionId(kotlin.Long))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the ad selection ID with which the rendered ad's events are associated.                                                                                                                                           |
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | [setCallerAdTech](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#setCallerAdTech(android.adservices.common.AdTechIdentifier))`(`callerAdTech:` `[AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#)`)` Sets the caller adtech entity's[AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#). |

## Public constructors

### Builder

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)  

```
Builder(
    adSelectionId: Long, 
    adEventType: Int, 
    callerAdTech: AdTechIdentifier)
```

|                                                                           Parameters                                                                            ||
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `callerAdTech` | [AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#):This value cannot be`null`. |

## Public methods

### build

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)  

```
fun build(): UpdateAdCounterHistogramRequest
```

Builds the[UpdateAdCounterHistogramRequest](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest)object.

|                                                                                    Return                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [UpdateAdCounterHistogramRequest](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest) | This value cannot be`null`. |

### setAdEventType

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)  

```
fun setAdEventType(adEventType: Int): UpdateAdCounterHistogramRequest.Builder
```

Sets the ad event type which, along with an ad's counter keys, identifies which histogram should be updated.

See[getAdEventType()](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdEventType())for more information.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `adEventType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_INVALID,[android.adservices.common.FrequencyCapFilters#AD_EVENT_TYPE_WIN](https://developer.android.com/reference/kotlin/android/adservices/common/FrequencyCapFilters.html#AD_EVENT_TYPE_WIN:kotlin.Int),[android.adservices.common.FrequencyCapFilters#AD_EVENT_TYPE_IMPRESSION](https://developer.android.com/reference/kotlin/android/adservices/common/FrequencyCapFilters.html#AD_EVENT_TYPE_IMPRESSION:kotlin.Int),[android.adservices.common.FrequencyCapFilters#AD_EVENT_TYPE_VIEW](https://developer.android.com/reference/kotlin/android/adservices/common/FrequencyCapFilters.html#AD_EVENT_TYPE_VIEW:kotlin.Int),[android.adservices.common.FrequencyCapFilters#AD_EVENT_TYPE_CLICK](https://developer.android.com/reference/kotlin/android/adservices/common/FrequencyCapFilters.html#AD_EVENT_TYPE_CLICK:kotlin.Int), android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MIN, or android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MAX |

|                                                                                             Return                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | This value cannot be`null`. |

### setAdSelectionId

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)  

```
fun setAdSelectionId(adSelectionId: Long): UpdateAdCounterHistogramRequest.Builder
```

Sets the ad selection ID with which the rendered ad's events are associated.

See[getAdSelectionId()](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdSelectionId())for more information.

|                                                                                             Return                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | This value cannot be`null`. |

### setCallerAdTech

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 8](https://developer.android.com/sdkExtensions)  

```
fun setCallerAdTech(callerAdTech: AdTechIdentifier): UpdateAdCounterHistogramRequest.Builder
```

Sets the caller adtech entity's[AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#).

See[getCallerAdTech()](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest#getCallerAdTech())for more information.

|                                                                           Parameters                                                                            ||
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `callerAdTech` | [AdTechIdentifier](https://developer.android.com/reference/kotlin/android/adservices/common/AdTechIdentifier.html#):This value cannot be`null`. |

|                                                                                             Return                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [UpdateAdCounterHistogramRequest.Builder](https://developer.android.com/reference/kotlin/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder#) | This value cannot be`null`. |