💡Tips
- Required TopOn SDK version: v6.3.40 and above
- Must be called before
load()
- network_firm_id
Thecustom Network id
can be obtained by clicking on custom network in
the TopOn dashboard
List<String> networkFirmIdList = new ArrayList<>();
// Input the ids of the ad platforms you wish to block
// networkFirmIdList.add("network_firm_id");
// Set to block requests from specific Network ids
ATSDK.setForbidNetworkFirmIdList(networkFirmIdList);
List<String> networkFirmIdList = new ArrayList<>();
// Input the ids of the ad platforms you wish to block
// networkFirmIdList.add("network_firm_id");
// Set not to initiate requests for specific platforms
ATSDK.setFilterNetworkFirmIdList("your placement id", networkFirmIdList);
// Set to allow displays for specific platforms
ATSDK.setAllowedShowNetworkFirmIdList("your placement id", networkFirmIdList);
// Set not to display ads for specific platforms
ATSDK.setForbidShowNetworkFirmIdList("your placement id", networkFirmIdList);
-----------------------------------------------------------------------------------
List<String> adSourceIdList = new ArrayList<>();
// Input the ids of the ad sources you wish to block
// adSourceIdList.add("ad_source_id");
// Set not to initiate requests for specific ad sources
ATSDK.setFilterAdSourceIdList("your placement id", adSourceIdList);
💡Tips
- Required TopOn SDK version: v6.4.60 and above
java Copy/** * Mark risky devices to filter out certain ad platforms * @param risk Risk flag (1=enable filtering, 0=disable filtering) * @param networkFirmIdList Ad Network IDs */ ATSDK.setRiskFilterNetworkFirmIdList(int risk, List<String> networkFirmIdList);
// Example
// Enable filtering and filter out requests from specific platforms
ATSDK.setRiskFilterNetworkFirmIdList(1, Arrays.asList("Network 1", "Network 2"));
// Enable filtering and filter out all Network requests
ATSDK.setRiskFilterNetworkFirmIdList(1, null);
💡Tips
- Required TopOn SDK version: v6.4.60 and above
java Copy/** * Add custom filtering rules for an ad placement * @param placementId Ad placement ID * @param filter Filter criteria object */ ATSDK.putFilter(String placementId, ATAdFilter filter)
- Refer here for ad network firm id
filterNetworkIds
,filterBidTypes
,filterNetworkPlacementIds
,filterAdPrice
can be combined into a filtering
rule as neededjava Copy// Remove custom filtering rules for an ad placement ATSDK.removeFilterWithPlacementId("your placement id"); // Remove all custom filtering rules ATSDK.removeFilters();
● Example 1
Filtering rule: the following conditions must be met together:
- Network restriction
- Target Network IDs: Network 1, Network 2
- Bid type restriction
- Filter types: Bidding ads (C2S/S2S) and non-bidding ads (NORMAL) (i.e., exclude both real-time bidding and
non-bidding ad types)
- Restriction on ad placements of ad platforms
- Target Network's ad placement IDs: Ad placement 1, Ad placement 2 (corresponds to the NetworkPlacementId field of ad
platforms)
- Price range restriction (⚠️If you write the price range as ≤10 and ≥50, it will be considered invalid)
- Currency unit: USD dollars
- Price range: ≥10 and ≤50
ATSDK.putFilter("your placement id", new ATWaterfallFilter()
.filterNetworkIds(Arrays.asList("Network 1", "Network 2")) // Filtering out specified network ids
.filterBidTypes(Arrays.asList(ATWaterfallFilter.NORMAL, ATWaterfallFilter.C2S, ATWaterfallFilter.S2S)) // Filtering out bidding and non-bidding types
.filterNetworkPlacementIds(Arrays.asList("network placement id 1", "network placement id 2")) // Filtering out specified ad placement ids of ad platforms
.filterAdPrice(new ATWaterfallFilter.PriceInterval(ATAdConst.CURRENCY.USD) // Select currency unit, filtering out specified price range
// The example below shows the filtered price range is [10, 50]
.moreThanPrice(10) // Greater than or equal to 10
.lessThanPrice(50) // Less than or equal to 50
)
);
● Example 2
Filtering rule: either Condition 1 or Condition 2 needs to be satisfied (💡Use
.orFilter()
to connect each
condition)Condition 1
- Network restriction
- Target Network IDs: Network 1, Network 2
- Bid type restriction
- Filter types: Non-bidding ads (NORMAL)
- Restriction on ad placements of ad platforms
- Target Network's ad placement IDs: Ad placement 1, Ad placement 2 (corresponds to the NetworkPlacementId field of ad
platforms)
- Price range restriction
- Currency unit: RMB_CENT Chinese yuan cents
- Price range: ≤5000
Condition 2
- Network restriction
- Target Network IDs: Network 3
- Bid type restriction
- Filter types: Bidding ads (C2S/S2S)
- Restriction on ad placements of ad platforms
- Target Network's ad placement IDs: Ad placement 1 (corresponds to the NetworkPlacementId field of ad platforms)
- Price range restriction
- Currency unit: RMB Chinese yuan
- Price range: ≥10
ATSDK.putFilter("your placement id", new ATWaterfallFilter()
// Condition 1
.filterNetworkIds(Arrays.asList("Network 1", "Network 2")) // Filtering out specified Network ids
.filterBidTypes(Arrays.asList(ATWaterfallFilter.NORMAL)) // Filtering out non-bidding types
.filterNetworkPlacementIds(Arrays.asList("network placement id 1", "network placement id 2")) // Filtering out specified ad placement ids of ad platforms
.filterAdPrice(new ATWaterfallFilter.PriceInterval(ATAdConst.CURRENCY.RMB_CENT) // Select currency unit RMB cents, filtering out specified price range
.lessThanPrice(5000) // Less than or equal to 5000
)
.orFilter()
// Condition 2
.filterNetworkIds(Arrays.asList("Network 3")) // Filtering out specified Network ids
.filterBidTypes(Arrays.asList(ATWaterfallFilter.C2S, ATWaterfallFilter.S2S)) // Filtering out bidding types
.filterNetworkPlacementIds(Arrays.asList("network placement id 1")) // Filtering out specified ad placement ids of ad platforms
.filterAdPrice(new ATWaterfallFilter.PriceInterval(ATAdConst.CURRENCY.RMB) // Select currency unit RMB, filtering out specified price range
.moreThanPrice(10) // Greater than or equal to 10
)
);