# Custom Parameters When Showing an Ad

Custom parameters are user-defined data—such as demographics, ad category, or campaign details—which track ad completions. If your rewarding strategy is [Server Side Rewarding](https://docs.digitalturbine.com/dt-fairbid/advanced-configurations/server-side-rewarding), you can add these parameters with Interstitial or Rewarded ad completions to improve tracking and reporting accuracy in [User Level Reports](https://docs.digitalturbine.com/dt-fairbid/reporting/reporting-api/dt-fairbid-user-level-reporting-api).&#x20;

## Defining Custom Parameters <a href="#h_01jppza3xj47necyavt2qaf4hj" id="h_01jppza3xj47necyavt2qaf4hj"></a>

To define and implement custom parameters, use the following API:

{% tabs %}
{% tab title="Android" %}
{% code title="Java" %}

```java
public class ShowOptions {
    public void setCustomParameters(
        Map<String, String> customParameters) {}
}
public void show(
    @NonNull String placementId,
    final ShowOptions showOptions,
    final Activity activity) {}
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
open class FYBShowOptions : NSObject {
    open var customParameters: [String : String]?
}
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
public ShowOptions(Dictionary<string, string> customParameters)

public static void Show(string placementId, ShowOptions options)
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Interstitial Ads

To set custom parameters in Interstitial ads, use the following API:

{% tabs %}
{% tab title="Android" %}
{% code title="Java" %}

```java
Map<String, String> customParams = customParams();
ShowOptions showOptions = new ShowOptions();
showOptions.setCustomParameters(customParams);
Interstitial.show(placementId, showOptions, activity);
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
let showOptions = FYBShowOptions()
showOptions.customParameters = [\
    "myCustomKey": "myCustomValue",\
    "anotherCustomKey": "anotherCustomValue"]
FYWInterstitial.show(
    "placementID",
    options: showOptions)
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
Dictionary<string, string> customParameters = new Dictionary<string, string>();
customParameters.Add("myCustomKey", "myCustomValue");
customParameters.Add("anotherCustomKey", "anotherCustomValue");
ShowOptions options = new ShowOptions(customParameters);
Interstitial.Show(
    "placementID",
    options);
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Rewarded Ads

To set custom parameters in Rewarded ads, use the following API:

{% tabs %}
{% tab title="Android" %}
{% code title="Java" %}

```java
Map<String, String> customParams = customParams();
ShowOptions showOptions = new ShowOptions();
showOptions.setCustomParameters(customParams);
Rewarded.show(placementId, showOptions, activity);
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
let showOptions = FYBShowOptions()
showOptions.customParameters = [\
    "myCustomKey": "myCustomValue",\
    "anotherCustomKey": "anotherCustomValue"]
FYWRewarded.show(
    "placementID",
    options: showOptions)
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
Dictionary<string, string> customParameters = new Dictionary<string, string>();
customParameters.Add("myCustomKey", "myCustomValue");
customParameters.Add("anotherCustomKey", "anotherCustomValue");
RewardedOptions rewardedOptions = new RewardedOptions(
    customParameters);
Rewarded.Show(
    "placementID",
    rewardedOptions);
```

{% endcode %}
{% endtab %}
{% endtabs %}
