Menu

Advanced Settings

● Block requests from specific platforms

💡Tips

  • Required TopOn SDK version: v6.3.40 and above
  • Must be called before load()
  • network_firm_id
    The custom Network id can be obtained by clicking on custom network in
    the TopOn dashboard

● Global Dimension

java Copy
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);

● Ad Placement Dimension

java Copy
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);

● Mark Risky Devices

💡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);
java Copy
// 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);

● Custom Filtering Rules

💡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)
java 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:

  1. Network restriction
  • Target Network IDs: Network 1, Network 2
  1. 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)
  1. 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)
  1. 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
java Copy
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

  1. Network restriction
  • Target Network IDs: Network 1, Network 2
  1. Bid type restriction
  • Filter types: Non-bidding ads (NORMAL)
  1. 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)
  1. Price range restriction
  • Currency unit: RMB_CENT Chinese yuan cents
  • Price range: ≤5000

Condition 2

  1. Network restriction
  • Target Network IDs: Network 3
  1. Bid type restriction
  • Filter types: Bidding ads (C2S/S2S)
  1. Restriction on ad placements of ad platforms
  • Target Network's ad placement IDs: Ad placement 1 (corresponds to the NetworkPlacementId field of ad platforms)
  1. Price range restriction
  • Currency unit: RMB Chinese yuan
  • Price range: ≥10
java Copy
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
        )
);
Previous
Revenue reporting for v6.3.70 and below
Next
Privacy Policy
Last modified: 2025-05-30Powered by