Redundancy control guide
The redundancy control function is available for server-to-server Banner, Native Simple, and Native types of advertisements loaded through GfpAdLoader.
It is only supported in NDA modules.
Creation of GfpDedupeManager for redundancy control
To use the redundancy control function supported by SDK, the below GfpDedupeManager needs to be created first.
- Kotlin
- Java
val dedupeManager = GfpDedupeManager(3)
GfpDedupeManager dedupeManager = new GfpDedupeManager(3);
As shown below, the creator of the GfpDedupeManager receives the numAdsDeduped parameter.
- Kotlin
- Java
class GfpDedupeManager(@IntRange(from = 2, to = 5) val numAdsDeduped: Int) {
// . . .
}
public GfpDedupeManager(@IntRange(from = 2, to = 5) int numAdsDeduped) {
// . . .
}
The numAdsDeduped value is the chunk size in which the consecutive advertisements are redundancy-controlled.
As in the example of creating GfpDedupeManager, if a new GfpDedupeManager(3); is declared, non-redundant advertisement exposure is available for three consecutive advertisements.
Also, the numAdsDeduped value is recommended between 2 and 5, as shown in the example above.
Load advertisements
To load an advertisement while using the redundancy control function, load the advertisement through the GfpDedupeManager created earlier.
- Kotlin
- Java
val dedupeManager = GfpDedupeManager(3)
// . . .
val adLoader1 = GfpAdLoader.Builder(context, adParam)
.withAdListener(/* ... */)
.withNativeSimpleAd(/* ... */)
.build()
val adLoader2 = GfpAdLoader.Builder(context, adParam)
.withAdListener(/* ... */)
.withNativeSimpleAd(/* ... */)
.build()
// . . .
dedupeManager.loadAd(adLoader1)
dedupeManager.loadAd(adLoader2)
GfpDedupeManager dedupeManager = new GfpDedupeManager(3);
// . . .
GfpAdLoader adLoader1 = new GfpAdLoader.Builder(context, adParam)
.withAdListener(/* ... */)
.withNativeSimpleAd(/* ... */)
.build();
GfpAdLoader adLoader2 = new GfpAdLoader.Builder(context, adParam)
.withAdListener(/* ... */)
.withNativeSimpleAd(/* ... */)
.build();
// . . .
dedupeManager.loadAd(adLoader1)
dedupeManager.loadAd(adLoader2)
This can be done by transmitting the instance of the GfpAdLoader that will load the advertisement to the created GfpDedupeManager as a parameter as shown below.
When transmitting a GfpAdLoader instance to the GfpDedupeManager#loadAd(GfpAdLoader) method, the advertisement is loaded while operating the redundancy control logic within the SDK. Also, the GfpAdLoaders delivered through the loadAd(GfpAdLoader) method undergo the redundancy control logic in the order of delivery.
Receive and delete advertising events
GfpDedupeManager is only responsible for controlling the redundancy of the received GfpAdLoaders. Other matters related to advertising loading, such as receiving and deleting advertising events, can be done through GfpAdLoader.
In addition, the GfpAdLoader instances transmitted to GfpDedupeManager through the loadAd(GfpAdLoader) method are managed internally in the SDK. Therefore, even if the cancel() method of a specific loader is called, the redundancy control functions properly.
Description of redundancy control
If the numAdsDeduped value is set to 5 when creating GfpDedupeManager, the redundancy control operation can be checked by referring to the image below.
- 5th ad view -> (guaranteed) Redundancy control of 1st, 2nd, 3rd, and 4th
- 9th ad view -> (guaranteed) Redundancy control of 6th, 7th, and 8th + (non-guaranteed) 1st, 2nd, 3rd, 4th, and 5th ads
- In the best case, redundancy control is from 1 to 9
- 13th ad view -> (guaranteed) Redundancy control of 11 and 12 + (non-guaranteed) 3rd to 10th ads
- In the best case, redundancy control is from 3 to 13