একটি অ্যাপ পরিবেশিত বিজ্ঞাপন সম্পর্কে আরও জানতে, বিজ্ঞাপনটিকে তার নিজস্ব GADAdMetadataDelegate হিসাবে সেট করুন। তারপর আপনি GADAdMetadataDelegate এ adMetadataDidChange: পদ্ধতি প্রয়োগ করে বিজ্ঞাপন মেটাডেটা পরিবর্তনের জন্য শুনতে পারেন। একবার এই প্রতিনিধিকে ডাকা হলে, বিজ্ঞাপনে adMetadata প্রপার্টি চেক করুন।
adMetadataDidChange: একটি বিজ্ঞাপন লোড হওয়ার ঠিক পরে বা যখন একটি বিজ্ঞাপনের মেটাডেটা লোড হওয়ার পরে অ্যাসিঙ্ক্রোনাসভাবে পরিবর্তিত হয় তখন বলা হয়। এটা নিশ্চিত নয় যে বিজ্ঞাপনের মেটাডেটা লোডের সময় উপলব্ধ, তাই আমরা একটি বিজ্ঞাপনের মেটাডেটা অ্যাক্সেস করার আগে এই কলব্যাকের জন্য অপেক্ষা করার পরামর্শ দিই।
পুরস্কৃত বিজ্ঞাপনের জন্য কীভাবে বিজ্ঞাপনের মেটাডেটা পুনরুদ্ধার করতে হয় তা দেখানো কোডের উদাহরণ এখানে দেওয়া হল:
@interfaceViewController()<GADFullScreenContentDelegate,GADAdMetadataDelegate>
@end@implementationViewController-(void)loadRewardedAd{*request=[request];[GADRewardedAdloadWithAdUnitID:@"ca-app-pub-3940256099942544/4806952744"request:requestcompletionHandler:^(GADRewardedAd*ad,NSError*error){if(error){NSLog(@"Rewarded ad failed to load with error: %@",[errorlocalizedDescription]);return;}self.rewardedAd=ad;self.rewardedAd.fullScreenContentDelegate=self;/// Set the ad to be the delegate of its ad metadata.self.rewardedAd.adMetadataDelegate=self;NSLog(@"Rewarded ad loaded.");}];}/#pragmamarkGADAdMetadataDelegateimplementation-(void)adMetadataDidChange:(id<GADAdMetadataProvider>)ad{NSDictionary<NSString*,id>*adMetadata=_rewardedAd.adMetadata;NSString*adId=adMetadata[@"AdId"];}
মেটাডেটা পুনরুদ্ধার করার পরে, আপনি আপনার যত্নশীল কীগুলির জন্য বান্ডিলটি পরীক্ষা করতে পারেন৷ বিভিন্ন ধরণের বিজ্ঞাপনের সাথে যুক্ত বিভিন্ন বিজ্ঞাপন মেটাডেটা কী থাকতে পারে। VAST ভিডিও বিজ্ঞাপনগুলির নিম্নলিখিত কীগুলি রয়েছে:
চাবি
টাইপ
বর্ণনা
AdId
স্ট্রিং
বিজ্ঞাপনের আইডি বা খালি স্ট্রিং যদি উপলব্ধ না হয়।
AdTitle
স্ট্রিং
শিরোনাম, নির্দিষ্ট না থাকলে খালি।
CreativeDurationMs
পূর্ণসংখ্যা
মিলিসেকেন্ডে নির্বাচিত সৃজনশীল সময়কাল, -1 যদি অ-রৈখিক হয়।
TraffickingParameters
স্ট্রিং
ট্রাফিকিং পরামিতি, বা খালি স্ট্রিং যদি উপলব্ধ না হয়।
DealId
স্ট্রিং
বর্তমান বিজ্ঞাপনের জন্য র্যাপার চেইনে উপস্থিত প্রথম ডিল আইডি, শীর্ষ থেকে শুরু করে, অথবা এই তথ্য উপলব্ধ না হলে খালি স্ট্রিং।
AdSystem
স্ট্রিং
বিজ্ঞাপনের সোর্স অ্যাড সার্ভার, খালি না থাকলে।
CreativeId
স্ট্রিং
বিজ্ঞাপনের জন্য নির্বাচিত সৃজনশীলের আইডি, উপলব্ধ না হলে খালি।
MediaURL
স্ট্রিং
নির্বাচিত মিডিয়ার URL।
Wrappers
অ্যারে
অ্যারেটি সবচেয়ে ভিতরের র্যাপার বিজ্ঞাপন (ইনলাইন বিজ্ঞাপনের কাছাকাছি) থেকে শুরু হওয়া উপাদানগুলি দিয়ে পূর্ণ হয় যা বাইরের দিকের র্যাপার বিজ্ঞাপনে চলে যায়। অ্যারের প্রতিটি উপাদান হল একটি অভিধান যাতে নিম্নলিখিত কী এবং মান রয়েছে।
AdId
স্ট্রিং মোড়ক বিজ্ঞাপনের জন্য ব্যবহৃত বিজ্ঞাপন আইডি, উপলব্ধ না হলে খালি।
AdSystem
স্ট্রিং মোড়ক বিজ্ঞাপনের জন্য ব্যবহৃত বিজ্ঞাপন সিস্টেম, উপলব্ধ না হলে খালি।
CreativeId
স্ট্রিং র্যাপার বিজ্ঞাপনের জন্য ক্রিয়েটিভ আইডি ব্যবহার করা হয়, যদি উপলব্ধ না হয় তাহলে খালি।
[null,null,["2025-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThis guide helps publishers integrate ad metadata with the Google Mobile Ads iOS SDK for rewarded and rewarded interstitial ad formats.\u003c/p\u003e\n"],["\u003cp\u003eYou need to set the ad as its own \u003ccode\u003eGADAdMetadataDelegate\u003c/code\u003e and implement the \u003ccode\u003eadMetadataDidChange:\u003c/code\u003e method to receive ad metadata updates.\u003c/p\u003e\n"],["\u003cp\u003eAd metadata may not be available immediately when an ad loads, so waiting for the \u003ccode\u003eadMetadataDidChange:\u003c/code\u003e callback is recommended.\u003c/p\u003e\n"],["\u003cp\u003eVAST video ads provide specific metadata keys like AdId, AdTitle, CreativeDurationMs, and more, which can be accessed through the ad's \u003ccode\u003eadMetadata\u003c/code\u003e property.\u003c/p\u003e\n"]]],[],null,["# Ad Metadata\n\nSelect platform: [Android](/ad-manager/mobile-ads-sdk/android/ad-metadata \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/ad-metadata \"View this page for the iOS platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide is intended for publishers integrating ad metadata with the Google\nMobile Ads iOS SDK.\n\nPrerequisites\n-------------\n\n- Google Mobile Ads SDK minimum version 7.41.0.\n- Complete the steps in either of the guides below:\n - [Rewarded ads](/ad-manager/mobile-ads-sdk/ios/rewarded)\n - [Rewarded interstitial\n ads](/ad-manager/mobile-ads-sdk/ios/rewarded-interstitial)\n\nFetching ad metadata\n--------------------\n\nTo have an app know more about ads that are served, set the ad to be its own\n`GADAdMetadataDelegate`. Then you can listen for ad metadata changes by\nimplementing the `adMetadataDidChange:` method on `GADAdMetadataDelegate`. Once\nthis delegate is called, check the `adMetadata` property on the ad.\n\n`adMetadataDidChange:` is called just after an ad loads or when an ad's\nmetadata changes asynchronously after it loads. It is not guaranteed that ad\nmetadata is available at load time, so we recommend waiting for this callback\nbefore accessing an ad's metadata.\n\nHere is a code example showing how to retrieve the ad metadata for a rewarded\nad: \n\n @interface ViewController () \u003cGADFullScreenContentDelegate, GADAdMetadataDelegate\u003e\n\n @end\n\n @implementation ViewController\n - (void)loadRewardedAd {\n *request = [ request];\n [GADRewardedAd\n loadWithAdUnitID:@\"ca-app-pub-3940256099942544/4806952744\"\n request:request\n completionHandler:^(GADRewardedAd *ad, NSError *error) {\n if (error) {\n NSLog(@\"Rewarded ad failed to load with error: %@\", [error localizedDescription]);\n return;\n }\n self.rewardedAd = ad;\n self.rewardedAd.fullScreenContentDelegate = self;\n\n /// Set the ad to be the delegate of its ad metadata.\n self.rewardedAd.adMetadataDelegate = self;\n\n NSLog(@\"Rewarded ad loaded.\");\n }];\n }\n\n /#pragma mark GADAdMetadataDelegate implementation\n - (void)adMetadataDidChange:(id\\\u003cGADAdMetadataProvider\\\u003e)ad {\n NSDictionary\\\u003cNSString\\*, id\\\u003e \\*adMetadata = _rewardedAd.adMetadata;\n NSString \\*adId = adMetadata\\[@\"AdId\"\\];\n }\n\nAfter retrieving the metadata, you can check the Bundle for the keys you care\nabout. Different types of ads might have different ad metadata keys associated\nwith them. VAST video ads have the following keys:\n\n| Key | Type | Description |\n|-------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `AdId` | String | The ID of the ad, or the empty string if not available. |\n| `AdTitle` | String | The title, empty if not specified. |\n| `CreativeDurationMs` | Integer | The selected creative duration in milliseconds, `-1` if non-linear. |\n| `TraffickingParameters` | String | Trafficking parameters, or the empty string if not available. |\n| `DealId` | String | The first deal ID present in the wrapper chain for the current ad, starting from the top, or the empty string if this information is not available. |\n| `AdSystem` | String | The source ad server of the ad, empty if not available. |\n| `CreativeId` | String | The ID of the selected creative for the ad, empty if not available. |\n| `MediaURL` | String | The URL of the selected media. |\n| `Wrappers` | Array | The array is populated with elements beginning at the innermost wrapper ad (close to the inline ad) moving outwards to the outermost wrapper ad. Each element in the array is a dictionary that contains the following keys and values. `AdId` : *String*. Ad ID used for wrapper ad, empty if not available. `AdSystem` : *String*. Ad system used for wrapper ad, empty if not available. `CreativeId` : *String*. Creative ID used for wrapper ad, empty if not available. |\n\n| **Note:** Only VAST wrapper ads have `Wrappers` key in the ad metadata. VAST inline ads don't contain `Wrappers` metadata."]]