Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của Ad Manager trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
Định dạng quảng cáo gốc tuỳ chỉnh loại Mạng Hiển thị và tiêu chí Đo lường mở
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nếu bạn dự định sử dụng tính năng đo lường mở với các định dạng quảng cáo gốc tuỳ chỉnh
không chứa tài sản video, thì bạn sẽ chịu trách nhiệm gọi API Mở
Chính API đo lường. Tính năng đo lường mở cho quảng cáo gốc tuỳ chỉnh loại hiển thị
các định dạng chỉ được phiên bản 7.43.0 trở lên hỗ trợ. Nếu bạn đang sử dụng
định dạng quảng cáo gốc có thành phần video, thì bạn không cần làm theo
hướng dẫn—SDK quảng cáo trên thiết bị di động của Google theo dõi khả năng xem của nội dung video trên
cho bạn.
Điều kiện tiên quyết
SDK Quảng cáo của Google trên thiết bị di động phiên bản 7.44.0 trở lên.
Việc tải quảng cáo là giống nhau cho dù bạn đang sử dụng tính năng đo lường mở hay không. Trong phần này
Trong trường hợp này, chúng ta sẽ sử dụng một ViewController đơn giản để minh hoạ cách tải một
GADNativeCustomFormatAd:
@interfaceOpenMeasurementNativeCustomFormatAdViewController()<GADNativeCustomFormatAdLoaderDelegate>{IBOutletUIView*_parentView;GADAdLoader*_adLoader;GADNativeCustomFormatAd*_customTemplateAd;MySimpleNativeAdView*_simpleNativeAdView;}@end@implementationOpenMeasurementNativeCustomFormatAdViewController-(void)viewDidLoad{[superviewDidLoad];_adLoader=[[GADAdLoaderalloc]initWithAdUnitID:@"your ad unit ID"rootViewController:selfadTypes:@[kGADAdLoaderAdTypeNativeCustomFormat]options:nil];_adLoader.delegate=self;[selfloadAd];}-(void)loadAd{GAMRequest*request=[GAMRequestrequest];[_adLoaderloadRequest:request];}...@end
Đăng ký lượt xem của bạn và bắt đầu đo lường
Khi hiển thị GADNativeCustomFormatAd, bạn cần phải đăng ký quảng cáo tuỳ chỉnh của mình
thành phần hiển thị với GADNativeTemplateAd bằng displayAdMeasurement.view
thuộc tính này.
Bạn cũng cần thông báo rõ ràng cho SDK biết để bắt đầu đo lường quảng cáo của bạn. Để thực hiện việc này,
gọi phương thức startWithError: trên thuộc tính displayAdMeasurement của
GADNativeCustomFormatAd. startWithError: phải được gọi từ
luồng và các lệnh gọi tiếp theo đều không có hiệu lực.
@implementationOpenMeasurementNativeCustomFormatAdViewController...#pragma mark - GADNativeCustomFormatAdLoaderDelegate-(void)adLoader:(GADAdLoader*)adLoaderdidReceiveNativeCustomFormatAd:(GADNativeCustomFormatAd*)nativeCustomFormatAd{NSLog(@"Received custom native ad: %@",nativeCustomFormatAd);_customTemplateAd=nativeCustomFormatAd;// Put the custom native ad on screen._simpleNativeAdView=[[NSBundlemainBundle]loadNibNamed:@"SimpleCustomNativeAdView"owner:niloptions:nil].firstObject;[_parentViewaddSubview:_simpleNativeAdView];[_simpleNativeAdViewpopulateWithCustomNativeAd:_customTemplateAd];// Set the top-level native ad view on the GADNativeCustomFormatAd so the// Google Mobile Ads SDK can track viewability for that view._customTemplateAd.displayAdMeasurement.view=_simpleNativeAdView;// Begin measuring your impressions and clicks.NSError*error=nil;[_customTemplateAd.displayAdMeasurementstartWithError:&error];if(error){NSLog(@"Failed to start the display measurement.");}}...@end
Đó là tất cả những gì cần làm. Sau khi phát hành ứng dụng, bạn sẽ bắt đầu nhận được
dữ liệu đo lường, tuy nhiên, dữ liệu của bạn sẽ không được chứng nhận cho đến khi bạn
Giấy chứng nhận của IAB
.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[[["\u003cp\u003eOpen Measurement is required for custom native ad formats without video assets, utilizing the Open Measurement APIs in Google Mobile Ads SDK version 7.43.0 or later.\u003c/p\u003e\n"],["\u003cp\u003eFor display-type custom native ad formats, IAB certification as a Measurement Provider is necessary for certified measurement results.\u003c/p\u003e\n"],["\u003cp\u003eTo implement Open Measurement, you must use Google Mobile Ads SDK 7.44.0 or higher, integrate custom native ad formats, configure a viewability provider, and register your ad view for tracking.\u003c/p\u003e\n"],["\u003cp\u003eLoading an ad remains the same with Open Measurement, requiring you to register your custom ad view and initiate measurement using the \u003ccode\u003estartWithError\u003c/code\u003e method.\u003c/p\u003e\n"]]],["For display-type custom native ads without video assets, you must manually call Open Measurement APIs using Google Mobile Ads SDK version 7.43.0 or later. Key actions include: configuring a viewability provider, loading an ad via `GADAdLoader`, registering the custom ad view with `displayAdMeasurement.view`, and initiating measurement using `startWithError:`. Measurement data is generated, but IAB certification is required for official validation. Ensure the Measurement Provider is IAB certified for certified results.\n"],null,["# Display-type Custom Native Ad Formats and Open Measurement\n\nIf you plan to use open measurement with custom native ad formats that\ndon't contain a video asset, you'll be responsible for calling the Open\nMeasurement APIs yourself. Open measurement for display-type custom native ad\nformats is only supported by version 7.43.0 and later. If you're using custom\nnative ad formats with a video asset, you don't need to follow this\nguide---the Google Mobile Ads SDK tracks viewability of the video asset on\nyour behalf.\n| **Key Point:** In order for your display-type native custom ad measurement results to be certified by the IAB, you must be certified as a [Measurement\n| Provider](//iabtechlab.com/compliance-programs/faq-om-sdk-compliance/) with the IAB Tech Lab.\n\nPrerequisites\n-------------\n\n- Google Mobile Ads SDK version 7.44.0 or higher.\n- Read [Open Measurement with the Mobile Ads\n SDK](/ad-manager/mobile-ads-sdk/ios/open-measurement).\n- Integrate [custom native ad\n formats](/ad-manager/mobile-ads-sdk/ios/native/custom-formats).\n- [Configure a viewability\n provider](//support.google.com/admanager/answer/9025968#configure-a-viewability-provider) and assign it to your line item.\n- Enter your partner name when [creating a custom\n format](//support.google.com/admanager/answer/7661908) in the Ad Manager UI.\n\nLoad an ad\n----------\n\nLoading an ad is the same whether you're using open measurement or not. In this\ncase we'll use a simple `ViewController` to demonstrate loading a\n`GADNativeCustomFormatAd`: \n\n @interface OpenMeasurementNativeCustomFormatAdViewController ()\n \u003cGADNativeCustomFormatAdLoaderDelegate\u003e {\n IBOutlet UIView *_parentView;\n GADAdLoader *_adLoader;\n GADNativeCustomFormatAd *_customTemplateAd;\n MySimpleNativeAdView *_simpleNativeAdView;\n }\n\n @end\n\n @implementation OpenMeasurementNativeCustomFormatAdViewController\n\n - (void) viewDidLoad {\n [super viewDidLoad];\n\n _adLoader = [[GADAdLoader alloc] initWithAdUnitID:@\"\u003cvar translate=\"no\"\u003eyour ad unit ID\u003c/var\u003e\"\n rootViewController:self\n adTypes:@[ kGADAdLoaderAdTypeNativeCustomFormat ]\n options:nil];\n _adLoader.delegate = self;\n [self loadAd];\n }\n\n - (void) loadAd {\n GAMRequest *request = [GAMRequest request];\n [_adLoader loadRequest:request];\n }\n ...\n @end\n\nRegister your view and begin measuring\n--------------------------------------\n\nWhen you show a `GADNativeCustomFormatAd`, you need to register your custom ad\nview with the `GADNativeTemplateAd` using the `displayAdMeasurement.view`\nproperty.\n\nYou also need to explicitly tell the SDK to begin measuring your ad. To do this,\ncall the `startWithError:` method on the `displayAdMeasurement` property of your\n`GADNativeCustomFormatAd`. `startWithError:` must be called from the main\nthread, and subsequent calls have no effect. \n\n @implementation OpenMeasurementNativeCustomFormatAdViewController\n ...\n #pragma mark - GADNativeCustomFormatAdLoaderDelegate\n\n - (void) adLoader:(GADAdLoader *) adLoader\n didReceiveNativeCustomFormatAd:(GADNativeCustomFormatAd *)nativeCustomFormatAd {\n NSLog(@\"Received custom native ad: %@\", nativeCustomFormatAd);\n\n _customTemplateAd = nativeCustomFormatAd;\n\n // Put the custom native ad on screen.\n _simpleNativeAdView =\n [[NSBundle mainBundle] loadNibNamed:@\"SimpleCustomNativeAdView\"\n owner:nil\n options:nil]\n .firstObject;\n [_parentView addSubview:_simpleNativeAdView];\n [_simpleNativeAdView populateWithCustomNativeAd:_customTemplateAd];\n\n // Set the top-level native ad view on the GADNativeCustomFormatAd so the\n // Google Mobile Ads SDK can track viewability for that view.\n _customTemplateAd.displayAdMeasurement.view = _simpleNativeAdView;\n // Begin measuring your impressions and clicks.\n NSError *error = nil;\n [_customTemplateAd.displayAdMeasurement startWithError:&error];\n\n if (error) {\n NSLog(@\"Failed to start the display measurement.\");\n }\n }\n ...\n @end\n\nThat's all there is to it. Once you release your app you will begin receiving\nmeasurement data, however your data won't be certified until you go through the\n[IAB certification\nprocess](//iabtechlab.com/compliance-programs/faq-om-sdk-compliance/)."]]