Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit doc custom keywords #1224

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions prebid-mobile/pbm-api/android/adunit-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ The `AdUnit` object is an abstract object that cannot be instantiated. Use the [
- `configId`: Prebid Server configuration ID.
- `adType`: `BANNER` or `INTERSITIAL`.
- `periodMillis`: Integer defining the refresh time in milliseconds. Default = 0, meaning no auto refresh.
- `keywords`: ArrayList containing keys and values.

## Methods

Expand All @@ -44,40 +43,6 @@ Trigger a call to Prebid Server to retrieve demand for this Prebid Mobile ad uni
- `adObj`: bid request object
- `onCompleteListener`: listener object

### setUserKeyword

Set a single key-value pair.

**Parameters**

- `key`: String containing the key.
- `value`: String containing the value.

### setUserKeywords

Define multiple values for a single key.

**Parameters**

- `key`: String containing the key.
- `values`: String array containing the list of values for the key.

### removeUserKeyword

Remove a key and all its associated values from a given Prebid Mobile ad unit.

**Parameters**

- `key`: String containing the key you want to remove.

### removeUserKeywords

Clear all key-value combinations from the Prebid Mobile ad unit.

**Parameters**

none

### setAutoRefreshPeriodMillis

If set on a given Prebid Mobile ad unit, the `fetchDemand` function will be called every `periodMillis` until `stopAutoRefresh` is called. Each call to `fetchDemand` will invoke the `onComplete` function. This refresh only pertains to Prebid Mobile and not to any ad server refresh processes. It is suggested that the adServers refresh be turned off.
Expand All @@ -102,7 +67,6 @@ none

```
InterstitialAdUnit interstitialAdUnit = new InterstitialAdUnit("PREBID_SERVER_CONFIGURATION_ID");
interstitialAdUnit.setUserKeyword("my_key", "my_value");
interstitialAdUnit.fetchDemand(publisherAdRequest, new onCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
Expand Down
1 change: 0 additions & 1 deletion prebid-mobile/pbm-api/android/banneradunit-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ final PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
final PublisherAdRequest request = builder.build();

BannerAdUnit bannerAdUnit = new BannerAdUnit("PREBID_SERVER_CONFIGURATION_ID", 300, 250);
bannerAdUnit.setUserKeyword("my_key", "my_value");
bannerAdUnit.fetchDemand(request, new onCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
Expand Down
19 changes: 10 additions & 9 deletions prebid-mobile/pbm-api/android/code-integration-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ Targeting parameters enable you to define the target audience for the bid reques

View the full list of [targeting parameters](/prebid-mobile/pbm-api/android/pbm-targeting-params-android.html)

### Add Custom Keywords

Custom keywords can be added to it to improve its targeting.

```
TargetingParams.addUserKeyword("my_key_user", "my_value_user");
TargetingParams.addInvKeyword("my_key_inv", "my_value_inv");
```
For more details on custom keywords, review the [adUnit class documention](/prebid-mobile/pbm-api/android/pbm-targeting-params-android.html)

### Create Ad Units
Banner and interstitial ad units can be created:

Expand All @@ -58,15 +68,6 @@ For details on creating the specific ad units and additional parameters and meth
[Banner Ad Unit](/prebid-mobile/pbm-api/android/banneradunit-android.html)
[Interstitial Ad Unit](/prebid-mobile/pbm-api/android/interstitialadunit-android.html)

### Add Custom Keywords

Once an ad unit has been instantiated, custom keywords can be added to it to improve its targeting.

```
bannerAdUnit.setUserKeyword("my_key", "my_value");
```
For more details on custom keywords, review the [adUnit class documention](/prebid-mobile/pbm-api/android/adunit-android.html)

## Further Reading

- [Prebid Mobile API - Android]({{site.baseurl}}/prebid-mobile/pbm-api/android/pbm-api-android.html)
Expand Down
2 changes: 1 addition & 1 deletion prebid-mobile/pbm-api/android/pbm-api-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use the Prebid Mobile API 1.0 for Android to implement header bidding in your mo

## Key Features

- The Publisher knows if the keywords are attached to the `adUnit`.
- The Publisher knows if the keywords are attached to the `request`.
- Implements and supports its own auto refresh, no longer supporting `adServer` refresh.
- Clear result codes that details the response of the Prebid demand fetch request.

Expand Down
101 changes: 101 additions & 0 deletions prebid-mobile/pbm-api/android/pbm-targeting-params-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,57 @@ gender = TargetingParams.getGender();
TargetingParams.setGender(FEMALE);
```

## Custom User Keywords

Custom keywords are used to attach arbitrary key/value pairs to the ad call. Use key/value pairs to add Users segments, as shown here:

```
TargetingParams.addUserKeyword(key: "testUserKey", value: "testUserValue")
TargetingParams.addUserKeywords(key: "testUserKeyArray", value: ["testUserValue1, testUserValue2"])
```
This will result in the following request JSON body construct:

```
"user" : {
"keywords": "testUserKey=testUserValue,testUserKeyArray=testUserValue1, testUserValue2"
}
```

### addUserKeyword

Set a single key-value pair.

**Parameters**

- `key`: String containing the key.
- `value`: String containing the value.

### addUserKeywords

Define multiple values for a single key.

**Parameters**

- `key`: String containing the key.
- `values`: String array containing the list of values for the key.

### removeUserKeyword

Remove a key and all its associated values from a given Prebid Mobile ad unit.

**Parameters**

- `key`: String containing the key you want to remove.

### clearUserKeywords

Clear all key-value combinations from the Prebid Mobile ad unit.

**Parameters**

none


## Global Application Targeting

### Bundle ID
Expand Down Expand Up @@ -85,6 +136,56 @@ storeUrl = TargetingParams.getStoreUrl();
TargetingParams.etStoreUrl(storeUrl);
```

## Custom Inventory Keywords

Custom keywords are used to attach arbitrary key/value pairs to the ad call. Use key/value pairs to add Inventory segments, as shown here:

```
TargetingParams.addInvKeyword(key: "testInvKey", value: "testInvValue")
TargetingParams.addInvKeywords(key: "testInvKeyArray", value: ["testInvValue1, testInvValue2"])
```
This will result in the following request JSON body construct:

```
"user" : {
"keywords": "testInvKey=testInvValue,testInvKeyArray=testInvValue1, testInvValue2"
}
```

### addInvKeyword

Set a single key-value pair.

**Parameters**

- `key`: String containing the key.
- `value`: String containing the value.

### addInvKeywords

Define multiple values for a single key.

**Parameters**

- `key`: String containing the key.
- `values`: String array containing the list of values for the key.

### removeInvKeyword

Remove a key and all its associated values from a given Prebid Mobile ad unit.

**Parameters**

- `key`: String containing the key you want to remove.

### clearInvKeywords

Clear all key-value combinations from the Prebid Mobile ad unit.

**Parameters**

none

## Global GDPR Targeting

Prebid Mobile supports the [IAB GDPR recommendations](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/Mobile%20In-App%20Consent%20APIs%20v1.0%20Draft%20for%20Public%20Comment.md). For a general overview of Prebid Mobile support for GDPR, see [Prebid Mobile Guide to European Ad Inventory and Providing Notice, Transparency and Choice]({{site.github.url}}/prebid-mobile/gdpr.html)
Expand Down
21 changes: 11 additions & 10 deletions prebid-mobile/pbm-api/ios/code-integration-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ Targeting parameters enable you to define the target audience for the bid reques

View the full list of [targeting parameters](/prebid-mobile/pbm-api/ios/pbm-targeting-ios.html)

### Add Custom Keywords

Custom keywords can be added to it to improve its targeting.

```
Targeting.shared.addUserKeyword(key:"Sample_user", value:"Value to add user")
Targeting.shared.addInvKeyword(key:"Sample_inv", value:"Value to add inv")
```

For more details on custom keywords, review the [adUnit class documention](/prebid-mobile/pbm-api/ios/pbm-targeting-ios.html)

### Create Ad Units

Banner and interstitial ad units can be created:
Expand All @@ -94,16 +105,6 @@ For details on creating the specific ad units and additional parameters and meth
[Interstitial Ad Unit](/prebid-mobile/pbm-api/ios/pbm-interstitial-ad-ios.html)


### Add Custom Keywords

Once an ad unit has been instantiated, custom keywords can be added to it to improve its targeting.

```
bannerUnit.addKeyword(key:"Sample", value:"Value to add")
```

For more details on custom keywords, review the [adUnit class documention](/prebid-mobile/pbm-api/ios/pbm-adunit-ios.html)

## Further Reading

- [Prebid Mobile API - iOS]({{site.baseurl}}/prebid-mobile/pbm-api/ios/pbm-api-iOS.html)
Expand Down
37 changes: 0 additions & 37 deletions prebid-mobile/pbm-api/ios/pbm-adunit-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,6 @@ Trigger a call to Prebid Server to retrieve demand for this Prebid Mobile ad uni

`completion`: Closure which receives one argument, the enum `ResultCode`. There is no return value.

### addUserKeyword

Obtains the user keyword and value for targeting of a Prebid Mobile ad unit. If the key already exists the value will be appended to the `customKeywords` property. No duplicates will be added.

**Parameters**

`key`: A String to be used to check if an existing value exists in the `customKeywords` property.

`value`: A String to be appended to the `customKeywords` property.

### removeUserKeyword
Remove a key and all its associated values from `customKeywords` of a given Prebid Mobile ad unit.

**Parameters**

`forKey`: A string containing the key to remove from `customKeywords`.

### clearUserKeywords
Remove all keys and all values from a given Prebid Mobile ad unit.

### setAutoRefreshMillis
If set on a given Prebid Mobile ad unit, the `fetchDemand` function will be called every `periodMillis` until `stopAutoRefresh` is called. Each call to `fetchDemand` will invoke the `onComplete` function. This refresh only pertains to Prebid Mobile and not to any ad server refresh processes. It is suggested that the adServes refresh be turned off.
Expand Down Expand Up @@ -133,24 +114,6 @@ Halts the auto-refresh behavior for a given Prebid Mobile ad unit. If no auto-re
}
```
---
**addKeyword**

```
bannerUnit.addKeyword(key:"Sample", value:"Value to add")
```

**removeUserKeyword**

```
bannerUnit.removeUserKeyword(forKey:"sample")
```

**clearUserKeywords**

```
bannerUnit.clearUserKeywords()
```

**setAutoRefreshMillis**

```
Expand Down
2 changes: 1 addition & 1 deletion prebid-mobile/pbm-api/ios/pbm-api-iOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use the Prebid Mobile API 1.0 for iOS to implement header bidding in your mobile

## Key Features

- The Publisher knows if the keywords are attached to the `adUnit`.
- The Publisher knows if the keywords are attached to the `request`.
- Implements and supports its own auto refresh, no longer supporting `adServer` refresh.
- Clear result codes that details the response of the Prebid demand fetch request.

Expand Down
4 changes: 2 additions & 2 deletions prebid-mobile/pbm-api/ios/pbm-code-integration-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ Prebid Mobile continuously pre-caches creatives in the background, so that right

**Objective-C**
```
[self.bannerAdUnit addUserKeyword:(NSString*)key:(NSString*)value];
[[Targeting sharedInstance] addUserKeyword:(NSString*)key:(NSString*)value];
```

**Swift**
```
self.bannerAdUnit.addUserKeyword(key: string, value: string)
Targeting.shared.addUserKeyword(key: string, value: string)
```


Expand Down
Loading