قالبهای تبلیغات بومی سفارشی نوع نمایش و اندازهگیری باز
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اگر قصد دارید از اندازهگیری باز با قالبهای تبلیغات بومی سفارشی که حاوی دارایی ویدیویی نیستند استفاده کنید، خودتان مسئول فراخوانی Open Measurement API هستید. اندازهگیری باز برای قالبهای تبلیغات بومی سفارشی نوع نمایش فقط توسط نسخه 7.43.0 و جدیدتر پشتیبانی میشود. اگر از قالبهای تبلیغات بومی سفارشی با دارایی ویدیویی استفاده میکنید، نیازی به پیروی از این راهنما ندارید—Google Mobile Ads SDK قابلیت مشاهده دارایی ویدیو را از طرف شما ردیابی میکند.
هنگام ایجاد قالب سفارشی در رابط کاربری Ad Manager نام شریک خود را وارد کنید.
یک تبلیغ را بارگیری کنید
چه از اندازهگیری باز استفاده کنید یا نه، بارگذاری یک تبلیغ یکسان است. در این مورد ما از یک ViewController ساده برای نشان دادن بارگیری یک 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
مشاهده خود را ثبت کنید و اندازه گیری را شروع کنید
وقتی یک GADNativeCustomFormatAd را نشان میدهید، باید نمای آگهی سفارشی خود را با استفاده از ویژگی displayAdMeasurement.view با GADNativeTemplateAd ثبت کنید.
همچنین باید صریحاً به SDK بگویید تا شروع به اندازهگیری آگهی شما کند. برای انجام این کار، متد startWithError: را در ویژگی displayAdMeasurementGADNativeCustomFormatAd خود فراخوانی کنید. startWithError: باید از رشته اصلی فراخوانی شود و تماس های بعدی هیچ تاثیری ندارند.
@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
این تمام چیزی است که در آن وجود دارد. پس از انتشار برنامه، شروع به دریافت دادههای اندازهگیری خواهید کرد، اما تا زمانی که فرآیند صدور گواهینامه IAB را طی نکنید، دادههای شما تأیید نمیشوند.
تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی."],[[["\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/)."]]