Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Ödüllü reklam gösterme
Bu örnekte, ödüllü reklam istemek ve oluşturmak için Google Yayıncı Etiketi (GPT) kitaplığının kullanımı gösterilmektedir. Ödüllü reklam biçimleri, uygulama ve web kullanıcılarının reklam görüntüleme karşılığında ödül kazanmasına olanak tanır. Ödüllü reklamlar hakkında daha fazla bilgiyi Google Ad Manager Yardım Merkezi'nde bulabilirsiniz.
Ödüllü reklamları görüntülemek ve bunlarla etkileşim kurmak için aşağıdaki GPT etkinliklerini kullanabilirsiniz:
Bu örnekte, hem kullanıcıdan ödüllü reklamı görüntülemesini istemek hem de tamamlandığında ödülü göstermek için basit bir modal iletişim kutusu kullanılmaktadır. Uygulamada, bu görevleri yerine getirmek için kendi arayüzünü uygulamak yayıncının sorumluluğundadır.
Kullanım notları
Optimum bir kullanıcı deneyimi sağlamak için ödüllü reklamlar yalnızca biçimi uygun şekilde destekleyen sayfalarda istenir. Bu nedenle, defineOutOfPageSlot()
null
döndürebilir. Gereksiz bir iş yapmadığınızdan emin olmak için bu durumu kontrol etmeniz gerekir. Ödüllü reklamlar şu anda yalnızca yakınlaştırmanın nötr olduğu mobil cihazlar için optimize edilmiş sayfalarda desteklenmektedir. Bu genellikle yayıncının sayfanın <head>
bölümünde <meta name="viewport"
content="width=device-width, initial-scale=1">
veya benzer bir öğeye sahip olduğu anlamına gelir.
Ödüllü reklamlar kendi reklam alanlarını oluşturur. Diğer reklam türlerinin aksine, ödüllü reklamlar için <div>
tanımlamak gerekli değildir. Ödüllü reklamlar, bir reklam yüklendiğinde kendi kapsayıcılarını otomatik olarak oluşturup sayfaya ekler.
Örnek uygulama
Demoyu görüntüleyin
[null,null,[],[],[],null,["# Display a rewarded ad\n=====================\n\nThis example demonstrates using the Google Publisher Tag (GPT) library to\nrequest and render a rewarded ad. Rewarded ad formats let app and web users\nreceive rewards for viewing ads. Learn more about rewarded ads in the\n[Google Ad Manager help center](//support.google.com/admanager/answer/9116812).\n\nYou can use the following GPT events to display and interact with rewarded ads:\n\n| Event | Fired when... |\n|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [RewardedSlotClosedEvent](//developers.google.com/publisher-tag/reference#googletag.events.rewardedslotclosedevent) | A rewarded ad slot has been closed. |\n| [RewardedSlotGrantedEvent](//developers.google.com/publisher-tag/reference#googletag.events.rewardedslotgrantedevent) | A reward has been granted for viewing an ad. |\n| [RewardedSlotReadyEvent](//developers.google.com/publisher-tag/reference#googletag.events.rewardedslotreadyevent) | A rewarded ad slot is ready to be displayed. |\n| [RewardedSlotVideoCompletedEvent](//developers.google.com/publisher-tag/reference#googletag.events.rewardedslotvideocompletedevent) | A rewarded ad slot has finsihed playing a video. |\n\nFor the purpose of this example, a simple modal dialog is used to both prompt\nthe user to view the rewarded ad and to display the reward upon completion. In\npractice, it is the responsibility of the publisher to implement their own\ninterface to accomplish these tasks.\n| **Important:** Before you display a rewarded ad, you must comply with the [policies for ad units that offer rewards](//support.google.com/admanager/answer/7496282) and obtain user consent.\n\nUsage notes\n-----------\n\n- **To ensure an optimal user experience, rewarded ads are only requested on\n pages that properly support the format.** Because of this,\n `defineOutOfPageSlot()` may return `null`; you should check for this case to\n ensure you're not doing any unnecessary work. Currently, rewarded ads are\n only supported on mobile optimized pages where zoom is neutral. Typically\n this means the publisher has `\u003cmeta name=\"viewport\"\n content=\"width=device-width, initial-scale=1\"\u003e` or similar in the `\u003chead\u003e`\n of the page.\n\n- **Rewarded ads generate their own ad slot.** Unlike other ad types, it's not\n necessary to define a `\u003cdiv\u003e` for rewarded ads. Rewarded ads automatically\n create and insert their own container into the page when an ad fills.\n\nSample implementation\n---------------------\n\n[View demo](https://googleads.github.io/google-publisher-tag-samples/display-rewarded-ad/js/demo.html) \n\n### JavaScript\n\nLoading...\n----------\n\nLoading...\n----------\n\n[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/display-rewarded-ad/js) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback%3A+display-rewarded-ad/js)\n\n### TypeScript\n\nLoading...\n----------\n\nLoading...\n----------\n\n[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/display-rewarded-ad/ts) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback%3A+display-rewarded-ad/ts)"]]