โฆษณาที่โหลดสำเร็จจะแสดง
ออบเจ็กต์ ResponseInfo
รายการ ออบเจ็กต์นี้มีข้อมูลเกี่ยวกับโฆษณาที่โหลด นอกเหนือจากข้อมูลเกี่ยวกับการแสดงโฆษณาสื่อกลางตามลำดับขั้นที่ใช้โหลดโฆษณา
ในกรณีที่โฆษณาโหลดสำเร็จ ออบเจ็กต์โฆษณาจะมีแอตทริบิวต์
GetResponseInfo()
วิธี เช่น interstitialAd.GetResponseInfo()
รับข้อมูลการตอบกลับสำหรับโฆษณาคั่นระหว่างหน้าที่โหลด
ในกรณีที่โฆษณาโหลดไม่สำเร็จและมีเพียงข้อผิดพลาดเท่านั้น ข้อมูลการตอบกลับจะดูได้ผ่าน LoadAdError.GetResponseInfo()
private void LoadInterstitialAd()
{
AdRequest adRequest = new AdRequest();
InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd insterstitialAd, LoadAdError error) =>
{
// If the operation failed with a reason.
if (error != null)
{
ResponseInfo errorInfo = error.GetResponseInfo();
Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
return;
}
ResponseInfo loadInfo = insterstitialAd.GetResponseInfo();
});
}
ข้อมูลการตอบกลับ
ต่อไปนี้คือตัวอย่างเอาต์พุตที่ ResponseInfo.ToString()
แสดงข้อมูลการแก้ไขข้อบกพร่องที่แสดงผลสําหรับโฆษณาที่โหลด
Android
{ "Response ID": "COOllLGxlPoCFdAx4Aod-Q4A0g", "Mediation Adapter Class Name": "com.google.ads.mediation.admob.AdMobAdapter", "Adapter Responses": [ { "Adapter": "com.google.ads.mediation.admob.AdMobAdapter", "Latency": 328, "Ad Source Name": "Reservation campaign", "Ad Source ID": "7068401028668408324", "Ad Source Instance Name": "[DO NOT EDIT] Publisher Test Interstitial", "Ad Source Instance ID": "4665218928925097", "Credentials": {}, "Ad Error": "null" } ], "Loaded Adapter Response": { "Adapter": "com.google.ads.mediation.admob.AdMobAdapter", "Latency": 328, "Ad Source Name": "Reservation campaign", "Ad Source ID": "7068401028668408324", "Ad Source Instance Name": "[DO NOT EDIT] Publisher Test Interstitial", "Ad Source Instance ID": "4665218928925097", "Credentials": {}, "Ad Error": "null" }, "Response Extras": { "mediation_group_name": "Campaign" } }
iOS
** Response Info ** Response ID: CIzs0ZO5kPoCFRqWAAAdJMINpQ Network: GADMAdapterGoogleAdMobAds ** Loaded Adapter Response ** Network: GADMAdapterGoogleAdMobAds Ad Source Name: Reservation campaign Ad Source ID: 7068401028668408324 Ad Source Instance Name: [DO NOT EDIT] Publisher Test Interstitial Ad Source Instance ID: [DO NOT EDIT] Publisher Test Interstitial AdUnitMapping: { } Error: (null) Latency: 0.391 ** Extras Dictionary ** { "mediation_group_name" = Campaign; } ** Mediation line items ** Entry (1) Network: GADMAdapterGoogleAdMobAds Ad Source Name: Reservation campaign Ad Source ID:7068401028668408324 Ad Source Instance Name: [DO NOT EDIT] Publisher Test Interstitial Ad Source Instance ID: [DO NOT EDIT] Publisher Test Interstitial AdUnitMapping: { } Error: (null) Latency: 0.391
เมธอดในออบเจ็กต์ ResponseInfo
มีดังนี้
วิธีการ | คำอธิบาย |
---|---|
GetAdapterResponses |
แสดงรายการ AdapterResponseInfo ที่มีข้อมูลเมตา
สำหรับอะแดปเตอร์แต่ละรายการที่รวมอยู่ในการตอบกลับโฆษณา สามารถใช้เพื่อแก้ไขข้อบกพร่อง
การแสดงโฆษณาสื่อกลางตามลำดับขั้น (Waterfall Mediation) และการเสนอราคา ลำดับของรายการตรงกับ
ลำดับการแสดงโฆษณาสื่อกลางตามลำดับขั้นสำหรับคำขอโฆษณานี้
ดูข้อมูลเพิ่มเติมได้ที่ข้อมูลการตอบกลับของอะแดปเตอร์ |
GetLoadedAdapterResponseInfo |
แสดงผล AdapterResponseInfo ที่สอดคล้องกับอะแดปเตอร์ที่โหลดโฆษณา |
GetMediationAdapterClassName |
แสดงชื่อคลาสอะแดปเตอร์สื่อกลางของเครือข่ายโฆษณาที่โหลด โฆษณา |
GetResponseId |
ตัวระบุการตอบกลับคือตัวระบุที่ไม่ซ้ำสำหรับการตอบกลับโฆษณา ช่วงเวลานี้ จะใช้เพื่อระบุและบล็อกโฆษณาในศูนย์ตรวจสอบโฆษณา (ARC) ได้ |
GetResponseExtras |
แสดงข้อมูลเพิ่มเติมเกี่ยวกับการตอบกลับโฆษณา ส่วนขยายสามารถแสดงผล
คีย์ต่อไปนี้
|
ตัวอย่างค่าการอ่านจาก ResponseInfo
ที่โหลด
private void LoadInterstitialAd()
{
AdRequest adRequest = new AdRequest();
InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd insterstitialAd, LoadAdError error) =>
{
// If the operation failed with a reason.
if (error != null)
{
Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
return;
}
ResponseInfo responseInfo = insterstitialAd.GetResponseInfo();
string responseId = responseInfo.GetResponseId();
string mediationAdapterClassName = responseInfo.GetMediationAdapterClassName();
List<AdapterResponseInfo> adapterResponses = responseInfo.GetAdapterResponses();
AdapterResponseInfo loadedAdapterResponseInfo = responseInfo.GetLoadedAdapterResponseInfo();
Dictionary<string, string> extras = responseInfo.GetResponseExtras();
string mediationGroupName = extras["mediation_group_name"];
string mediationABTestName = extras["mediation_ab_test_name"];
string mediationABTestVariant = extras["mediation_ab_test_variant"];
});
}
ข้อมูลการตอบกลับอะแดปเตอร์
AdapterResponseInfo
มีข้อมูลเมตาสําหรับแต่ละอะแดปเตอร์ที่รวมอยู่ในคําตอบของโฆษณา ซึ่งสามารถใช้แก้ไขข้อบกพร่องของสื่อกลาง Waterfall และการดําเนินการเสนอราคา ลำดับของรายการตรงกับลำดับของการแสดงโฆษณาสื่อกลางตามลำดับขั้น
สำหรับคำขอโฆษณา
ต่อไปนี้คือตัวอย่างเอาต์พุตที่ AdapterResponseInfo
แสดงผล
Android
{ "Adapter": "com.google.ads.mediation.admob.AdMobAdapter", "Latency": 328, "Ad Source Name": "Reservation campaign", "Ad Source ID": "7068401028668408324", "Ad Source Instance Name": "[DO NOT EDIT] Publisher Test Interstitial", "Ad Source Instance ID": "4665218928925097", "Credentials": {}, "Ad Error": "null" }
iOS
Network: GADMAdapterGoogleAdMobAds Ad Source Name: Reservation campaign Ad Source ID: 7068401028668408324 Ad Source Instance Name: [DO NOT EDIT] Publisher Test Interstitial Ad Source Instance ID: [DO NOT EDIT] Publisher Test Interstitial AdUnitMapping: { } Error: (null) Latency: 0.391
AdapterResponseInfo
มีวิธีการต่อไปนี้สําหรับเครือข่ายโฆษณาแต่ละเครือข่าย
วิธีการ | คำอธิบาย |
---|---|
AdError |
ได้รับข้อผิดพลาดที่เกี่ยวข้องกับคำขอที่ส่งไปยังเครือข่าย คิกรีเทิร์น
null หากเครือข่ายโหลดโฆษณาสำเร็จ หรือหากเครือข่าย
ไม่มีการพยายามทำเครือข่าย |
AdSourceId |
รับรหัสแหล่งที่มาของโฆษณาที่เชื่อมโยงกับการตอบกลับของอะแดปเตอร์นี้ สำหรับแคมเปญ
ส่งกลับ 6060308706800320801 สำหรับโฆษณาที่ใช้สื่อกลาง
ประเภทเป้าหมายแคมเปญ
และระบบจะส่งคืน 7068401028668408324 สำหรับการแสดงผลและคลิก
ประเภทเป้าหมาย ดูแหล่งที่มาของโฆษณา
สำหรับรายการรหัสแหล่งที่มาของโฆษณาที่เป็นไปได้เมื่อเครือข่ายโฆษณาแสดงโฆษณา |
AdSourceInstanceId |
รับรหัสอินสแตนซ์ของแหล่งที่มาของโฆษณาที่เชื่อมโยงกับอะแดปเตอร์นี้ คำตอบ |
AdSourceInstanceName |
รับชื่ออินสแตนซ์แหล่งที่มาของโฆษณาที่เชื่อมโยงกับการตอบกลับของอะแดปเตอร์นี้ |
AdSourceName |
รับแหล่งที่มาของโฆษณาที่แสดงเครือข่ายโฆษณาที่เฉพาะเจาะจงซึ่งแสดงโฆษณา
การแสดงผล สำหรับแคมเปญ
ส่งกลับ Mediated House Ads สำหรับโฆษณาที่ใช้สื่อกลาง
ประเภทเป้าหมายแคมเปญ
และระบบจะส่งคืน Reservation Campaign สำหรับการแสดงผลและคลิก
ประเภทเป้าหมาย ดูแหล่งที่มาของโฆษณา
สำหรับรายการชื่อแหล่งที่มาของโฆษณาที่เป็นไปได้เมื่อเครือข่ายโฆษณาแสดง
โฆษณาของคุณ |
AdapterClassName |
รับชื่อคลาสที่ระบุเครือข่ายโฆษณา |
AdUnitMapping |
รับการกำหนดค่าเครือข่ายจาก AdMob UI |
LatencyMillis |
รับระยะเวลาที่เครือข่ายโฆษณาใช้ในการโหลดโฆษณา
แสดงผล 0 หากไม่มีการพยายามเชื่อมต่อเครือข่าย |
ตัวอย่างค่าการอ่านจาก AdapterResponseInfo
ที่โหลด
private void LoadInterstitialAd()
{
AdRequest adRequest = new AdRequest();
InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd insterstitialAd, LoadAdError error) =>
{
// If the operation failed with a reason.
if (error != null)
{
Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
return;
}
ResponseInfo responseInfo = insterstitialAd.GetResponseInfo();
AdapterResponseInfo loadedAdapterResponseInfo = responseInfo.getLoadedAdapterResponseInfo();
AdError adError = loadedAdapterResponseInfo.AdError;
string adSourceId = loadedAdapterResponseInfo.AdSourceId;
string adSourceInstanceId = loadedAdapterResponseInfo.AdSourceInstanceId;
string adSourceInstanceName = loadedAdapterResponseInfo.AdSourceInstanceName;
string adSourceName = loadedAdapterResponseInfo.AdSourceName;
string adapterClassName = loadedAdapterResponseInfo.AdapterClassName;
Dictionary<string, string> credentials = loadedAdapterResponseInfo.AdUnitMapping;
long latencyMillis = loadedAdapterResponseInfo.LatencyMillis;
});
}