Skip to main content

API reference

Applies to AdScope Unity SDK v1.0.0 (beta).

All listed APIs live on AdScopeAPI in the AdScope namespace unless noted otherwise.

Reporting

MethodWhen to use
ReportAdFilled(double revenue, AdFormat format)After an ad fills and you have revenue for that format.
ReportAdNotFilled(AdFormat format)When your logic determines the request did not fill.

Key-value output

MethodWhen to use
GetKeyValue()When you need one targeting string for the current SDK state (see AdScope docs for meaning).
GetKeyValueForFormat(AdFormat format)When you need a targeting string scoped to one format.
GetTargetingKeyValue()Alias of GetKeyValue().
GetTargetingKeyValueForFormat(AdFormat format)Alias of GetKeyValueForFormat(format).

If a method returns an empty string, treat it as “no key-value to attach” unless AdScope documents otherwise.

Configuration

MethodWhen to use
Configure(AdScopeClientConfiguration)Before FetchConfigurationAsync, with credentials from AdScope.
FetchConfigurationAsync(CancellationToken)To download and apply configuration from AdScope (primary path when supported for your account).
SetConfigFromJson(string, string)When AdScope instructs you to apply configuration JSON from your own transport.
SetInitialValues(InitialValuePayload)When AdScope instructs you to set initial values (e.g. from reports).

Context

MethodWhen to use
SetCountry(string)If your integration sets country override per AdScope guidance.
SetConsent(bool?)If your integration sets consent per AdScope / CMP guidance.
SetIdfaOptIn(bool?)If your integration sets advertising ID opt-in per policy.

Types

TypeRole
AdFormatEnumeration of supported ad formats.
InitialValuePayloadInput to SetInitialValues.
AdScopeClientConfigurationCredentials and optional HTTP settings for FetchConfigurationAsync.
AdScopeConfigurationFetchResultResult of FetchConfigurationAsync (success flag, error message, HTTP status where applicable).

Constants and defaults

Symbol names (e.g. on AdScopeConstants) and default URLs are defined in the shipped package for use in code and in custom integrations.