Skip to main content

Android - 進階設定

幫助您取得更多廣告功能與資料收集

自定義廣告請求參數


您可以在建立廣告請求時,選擇性地加入以下自定義的參數,讓 Vpon 可以用更精準的方式投放廣告

VponAdRequest.Builder builder = new VponAdRequest.Builder();

builder.setAutoRefresh(boolean);
// Only available for Banner Ad, will auto refresh ad if set true
builder.addTestDevice(String);
// Set your test device's GAID here if you're trying to get Vpon test ad

builder.setGender(VponAdRequest.Gender.UNSPECIFIED);
// Set user's gender if available
builder.setBirthday(Date);
// Set user's birthday if available
builder.setLocation(Location);
// Set user's location if available

builder.setMaxAdContentRating(String);
// To set up the maximum content rating filter
builder.setTagForUnderAgeOfConsent(-1);
// To set up if the ads will be displayed only to the specific ages of audience
builder.tagForChildDirectedTreatment(-1);
// To set up if the ads will be displayed to childern specific

builder.addKeyword(String);
builder.addKeywords(Set<String>);

回傳內容資訊


您可以透過 setContentUrlsetContentData 將頁面內容資訊透過 SDK 發給 Vpon

Note: 此功能適用於 Vpon SDK v5.1.1 及以上版本

VponAdRequest.Builder builder = new VponAdRequest.Builder();

HashMap<String, Object> contentData = new HashMap<>();
contentData.put("key1", "Vpon");
contentData.put("key2", 1.2);
contentData.put("key3", true);

builder.setContentData(contentData);
builder.setContentUrl("https://www.vpon.com/zh-hant/");