Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#constants) \| [Methods](https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#inhmethods)

# MeasurementManager

*** ** * ** ***

` public class MeasurementManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.adservices.measurement.MeasurementManager |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 37.**   

The Rubidium (Rb) Measurement APIs, including those in android.adservices.measurement, are being deprecated. There are no direct replacement APIs for the Measurement APIs. Developers currently using these APIs should cease integration, as calls to these APIs will be rejected in upcoming Android releases as part of a soft removal process. Please refer to the official Privacy Sandbox developer documentation and announcements for more details on this deprecation and the future roadmap of Privacy Sandbox on Android: https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/

MeasurementManager provides APIs to manage source and trigger registrations.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#MEASUREMENT_API_STATE_DISABLED` This state indicates that Measurement APIs are unavailable. |
| `int` | `https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#MEASUREMENT_API_STATE_ENABLED` This state indicates that Measurement APIs are enabled. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#deleteRegistrations(android.adservices.measurement.DeletionRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/DeletionRequest deletionRequest, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Deletes previous registrations. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#deleteRegistrations(android.adservices.measurement.DeletionRequest,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/DeletionRequest deletionRequest, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Deletes previous registrations. |
| ` static https://developer.android.com/reference/android/adservices/measurement/MeasurementManager` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#get(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Factory method for creating an instance of MeasurementManager. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#getMeasurementApiStatus(java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Integer,java.lang.Exception>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Integer, https://developer.android.com/reference/java/lang/Exception> callback) ` Gets Measurement API status. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#getMeasurementApiStatus(java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Integer,java.lang.Exception>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Integer, https://developer.android.com/reference/java/lang/Exception> callback) ` Gets Measurement API status. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerSource(android.net.Uri,%20android.view.InputEvent,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/net/Uri attributionSource, https://developer.android.com/reference/android/view/InputEvent inputEvent, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution source (click or view). |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerSource(android.adservices.measurement.SourceRegistrationRequest,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/SourceRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers attribution sources(click or view) from an app context. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerSource(android.adservices.measurement.SourceRegistrationRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/SourceRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers attribution sources(click or view) from an app context. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerSource(android.net.Uri,%20android.view.InputEvent,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/net/Uri attributionSource, https://developer.android.com/reference/android/view/InputEvent inputEvent, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution source (click or view). |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerTrigger(android.net.Uri,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/net/Uri trigger, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers a trigger (conversion). |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerTrigger(android.net.Uri,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/net/Uri trigger, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers a trigger (conversion). |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerWebSource(android.adservices.measurement.WebSourceRegistrationRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/WebSourceRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution source(click or view) from web context. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerWebSource(android.adservices.measurement.WebSourceRegistrationRequest,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/WebSourceRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution source(click or view) from web context. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerWebTrigger(android.adservices.measurement.WebTriggerRegistrationRequest,%20java.util.concurrent.Executor,%20android.adservices.common.AdServicesOutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/WebTriggerRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/adservices/common/AdServicesOutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution trigger(click or view) from web context. |
| ` void` | ` https://developer.android.com/reference/android/adservices/measurement/MeasurementManager#registerWebTrigger(android.adservices.measurement.WebTriggerRegistrationRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)(https://developer.android.com/reference/android/adservices/measurement/WebTriggerRegistrationRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/os/OutcomeReceiver<https://developer.android.com/reference/java/lang/Object, https://developer.android.com/reference/java/lang/Exception> callback) ` Registers an attribution trigger(click or view) from web context. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### MEASUREMENT_API_STATE_DISABLED

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

```
public static final int MEASUREMENT_API_STATE_DISABLED
```

This state indicates that Measurement APIs are unavailable. Invoking them will result in an `https://developer.android.com/reference/java/lang/UnsupportedOperationException`.

<br />

Constant Value: 0 (0x00000000)

### MEASUREMENT_API_STATE_ENABLED

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

```
public static final int MEASUREMENT_API_STATE_ENABLED
```

This state indicates that Measurement APIs are enabled.

<br />

Constant Value: 1 (0x00000001)

## Public methods

### deleteRegistrations

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

```
public void deleteRegistrations (DeletionRequest deletionRequest, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Deletes previous registrations.

If the deletion is successful, the callback's `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through the callback's `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.

<br />

| Parameters ||
|---|---|
| `deletionRequest` | `DeletionRequest`: The request for deleting data. This value cannot be `null`. <br /> |
| `executor` | `Executor`: The executor to run callback. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value cannot be `null`. <br /> |

### deleteRegistrations

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

```
public void deleteRegistrations (DeletionRequest deletionRequest, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Deletes previous registrations.

If the deletion is successful, the callback's `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through the callback's `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.

For use on Android R or lower.

<br />

| Parameters ||
|---|---|
| `deletionRequest` | `DeletionRequest`: The request for deleting data. This value cannot be `null`. <br /> |
| `executor` | `Executor`: The executor to run callback. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value cannot be `null`. <br /> |

### get

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

```
public static MeasurementManager get (Context context)
```

Factory method for creating an instance of MeasurementManager.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: The `https://developer.android.com/reference/android/content/Context` to use. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/measurement/MeasurementManager` | A `https://developer.android.com/reference/android/adservices/measurement/MeasurementManager` instance. This value cannot be `null`. <br /> |

### getMeasurementApiStatus

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

```
public void getMeasurementApiStatus (Executor executor, 
                AdServicesOutcomeReceiver<Integer, Exception> callback)
```

Gets Measurement API status.

The callback's `Integer` value is one of `MeasurementApiState`.

For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: used by callback to dispatch results. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value cannot be `null`. <br /> |

### getMeasurementApiStatus

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

```
public void getMeasurementApiStatus (Executor executor, 
                OutcomeReceiver<Integer, Exception> callback)
```

Gets Measurement API status.

The callback's `Integer` value is one of `MeasurementApiState`.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: used by callback to dispatch results. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value cannot be `null`. <br /> |

### registerSource

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

```
public void registerSource (Uri attributionSource, 
                InputEvent inputEvent, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Registers an attribution source (click or view).   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `attributionSource` | `Uri`: the platform issues a request to this URI in order to fetch metadata associated with the attribution source. The source metadata is stored on device, making it eligible to be matched to future triggers. This value cannot be `null`. <br /> |
| `inputEvent` | `InputEvent`: either an `https://developer.android.com/reference/android/view/InputEvent` object (for a click event) or null (for a view event). <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the scheme for `attributionSource` is not HTTPS |

### registerSource

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

```
public void registerSource (SourceRegistrationRequest request, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Registers attribution sources(click or view) from an app context.

This API will not process any redirects, all registration URLs should be supplied with the request. For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `SourceRegistrationRequest`: app source registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerSource

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

```
public void registerSource (SourceRegistrationRequest request, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Registers attribution sources(click or view) from an app context.

This API will not process any redirects, all registration URLs should be supplied with the request.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `SourceRegistrationRequest`: app source registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerSource

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

```
public void registerSource (Uri attributionSource, 
                InputEvent inputEvent, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Registers an attribution source (click or view). For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `attributionSource` | `Uri`: the platform issues a request to this URI in order to fetch metadata associated with the attribution source. The source metadata is stored on device, making it eligible to be matched to future triggers. This value cannot be `null`. <br /> |
| `inputEvent` | `InputEvent`: either an `https://developer.android.com/reference/android/view/InputEvent` object (for a click event) or null (for a view event). <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerTrigger

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

```
public void registerTrigger (Uri trigger, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Registers a trigger (conversion). For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `trigger` | `Uri`: the API issues a request to this URI to fetch metadata associated with the trigger. The trigger metadata is stored on-device, and is eligible to be matched with sources during the attribution process. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerTrigger

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

```
public void registerTrigger (Uri trigger, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Registers a trigger (conversion).   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `trigger` | `Uri`: the API issues a request to this URI to fetch metadata associated with the trigger. The trigger metadata is stored on-device, and is eligible to be matched with sources during the attribution process. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the scheme for `trigger` is not HTTPS |

### registerWebSource

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

```
public void registerWebSource (WebSourceRegistrationRequest request, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Registers an attribution source(click or view) from web context.

This API will not process any redirects, all registration URLs should be supplied with the request. At least one of appDestination or webDestination parameters are required to be provided. If the registration is successful, `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `WebSourceRegistrationRequest`: source registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerWebSource

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

```
public void registerWebSource (WebSourceRegistrationRequest request, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Registers an attribution source(click or view) from web context.

This API will not process any redirects, all registration URLs should be supplied with the request. At least one of appDestination or webDestination parameters are required to be provided. If the registration is successful, `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.

For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `WebSourceRegistrationRequest`: source registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerWebTrigger

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

```
public void registerWebTrigger (WebTriggerRegistrationRequest request, 
                Executor executor, 
                AdServicesOutcomeReceiver<Object, Exception> callback)
```

Registers an attribution trigger(click or view) from web context.

This API will not process any redirects, all registration URLs should be supplied with the request. If the registration is successful, `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.

For use on Android R or lower.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `WebTriggerRegistrationRequest`: trigger registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. <br /> |
| `callback` | `AdServicesOutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |

### registerWebTrigger

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

```
public void registerWebTrigger (WebTriggerRegistrationRequest request, 
                Executor executor, 
                OutcomeReceiver<Object, Exception> callback)
```

Registers an attribution trigger(click or view) from web context.

This API will not process any redirects, all registration URLs should be supplied with the request. If the registration is successful, `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onResult(R)` is invoked with null. In case of failure, a `https://developer.android.com/reference/java/lang/Exception` is sent through `callback`'s `https://developer.android.com/reference/android/os/OutcomeReceiver#onError(E)`. Both success and failure feedback are executed on the provided `https://developer.android.com/reference/java/util/concurrent/Executor`.   

Requires `https://developer.android.com/reference/android/adservices/common/AdServicesPermissions#ACCESS_ADSERVICES_ATTRIBUTION`

<br />

| Parameters ||
|---|---|
| `request` | `WebTriggerRegistrationRequest`: trigger registration request. This value cannot be `null`. <br /> |
| `executor` | `Executor`: used by callback to dispatch results. This value may be `null`. <br /> |
| `callback` | `OutcomeReceiver`: intended to notify asynchronously the API result. This value may be `null`. <br /> |