Skip to main content

Ad Deduplication

The deduplication feature is supported for ads (banner / native simple / native general type ads) loaded using the unified loader (= GFPAdLoader).

Create GFPAdDedupeManager

Declare a GFPAdDedupeManager property and create an instance to manage deduplication.

numAdsDedupe refers to the number of ads subject to deduplication control. It guarantees non-duplicate ad exposure for n consecutive ads. It is recommended to set this parameter to a value between 2 and 5.

var dedupeManager : GFPAdDedupeManager?
self.dedupeManager = GFPAdDedupeManager(numAdsDeduped: 3) //Number of ads for which deduplication is guaranteed.

Create GFPAdLoader

Create a GFPAdLoader object to load ads.

For guidance on creating a GFPAdLoader object for each ad type, refer to the following:

Ad Request via GFPAdDedupeManager

Request ads through GFPAdDedupeManager. Pass a GFPAdLoader as a parameter when making the ad request. Ads are requested in the order of the provided loaders, and the load success or failure is delivered to the delegate of the respective loader.

self.dedupeManager?.loadAd(with: self.loader)

Deduplication is also available for GFPAdLoader objects with different Unit IDs.

self.loader2 = GFPAdLoader.init(unitID: "INPUT_YOUR_UNIT_ID2", rootViewController: self, adParam: adParam)
...(omitted)... //option configuration and registration
self.loader2.delegate = self;

self.loader3 = GFPAdLoader.init(unitID: "INPUT_YOUR_UNIT_ID3", rootViewController: self, adParam: adParam)
...(omitted)... //option configuration and registration
self.loader3.delegate = self;

self.dedupeManager?.loadAd(with: loader2)
self.dedupeManager?.loadAd(with: loader3)

GFPAdLoaderDelegate

By implementing GFPAdLoaderDelegate, you can receive ad loading-related events through the corresponding methods.

For handling GFPAdLoaderDelegate for each ad type, refer to the following guides: