如何与不受支持的广告公司一起使用 AdWhirl?
有谁知道 AdWhirl 是如何工作的?
我为 Greystripe 设置了自定义事件,在其中初始化 SDK(如果尚未初始化)并刷新 BannerView,但我没有看到自定义事件被调用。所以我的主要问题是,AdWhirl 如何以及何时调用自定义事件?什么是口粮和周转?我没有对它们做任何事情(主要是因为我不知道为什么需要它们。AdWhirl 对它们做什么?)
另外,我如何控制 AdWhirl 何时刷新我的横幅?我想将刷新与按钮操作联系起来。
这两天我一直在网上不停地搜索,阅读了很多人们分享的教程和示例Java类,但没有一个起作用。 AdWhirl 看起来似乎停滞不前。我不清楚 AdWhirl 的工作原理:它在应用程序和您想要在广告中使用的所有广告机会之间进行协调。对于我来说,这是一个太高层次的理解,无法继续前进。 :(
Does anyone know how AdWhirl works?
I set up my custom event for Greystripe in which I initialize the SDK if it wasn't already initialized, and refresh the BannerView, but I don't see the custom event getting called. So my main question is, how and when does AdWhirl call the custom event? What are the rations and rollovers? I haven't done anything with them (mainly because I don't know why I need them. What does AdWhirl do with them?)
Also, how do I control when AdWhirl refreshes my banner? I'd like to tie the refresh with a button action.
I've been searching online nonstop for the past two days and read a lot of tutorials and example Java classes that people have shared, but none of them have worked. It just looks like AdWhirl is stagnate. It's so unclear to me how AdWhirl works beyond: it mediates between the app and all the ad opportunities you want to use in your ad. That's an entirely too high-level understanding for me to move forward. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
评论(2)
如果您愿意,您可以使用我开发的开源库,该库允许将 AdWhirl 与其他(不受支持的)广告网络(但也与官方支持的广告网络)一起使用。该库也是可扩展的,因此您可以向其中添加新网络并通过 AdWhirl 轻松管理。
该库是 AdMAL(广告中介抽象层),可在 Apache 2.0 开源许可证下的 github.com 存储库上使用: https://github.com/marcosiino/AdMAL
使用 AdMAL,您可以在支持和不支持的网络的应用程序中轻松实现 AdWhirl(集成比实现 AdWhirl SDK 最简单)。实际上它只支持iOS(它是用Objective-C开发的),但我计划在接下来的几个月内移植到Android。
我出于自己的目的启动了 AdMAL,然后决定在几天前根据开源许可证向公众发布它。希望这有帮助!我鼓励其他开发人员改进该库并实现新的网络支持,以便每个人都能受益。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您是否阅读过介绍如何使用自定义事件的wiki 页面?您基本上可以在后端 UI 中创建一个自定义事件,其行为类似于另一个广告网络,并且您可以配置其流量。然后你就可以在后端实现你命名的函数名称了。唯一不直观的部分是您必须实现 AdWhirlInterface 来侦听自定义事件,这意味着创建一个 adWhirlGeneric() 方法。不过,此方法可以为空,我在创建自己的测试事件时没有看到它被调用。最后,确保设置 AdWhirlInterface。
因此,假设您在后端创建了一个网络:
并为其提供了流量(我建议在测试时为其提供 100% 的流量),那么您的代码将如下所示:
要控制刷新广告,请在以下情况下调用 AdWhirlLayout 上的rotateThreadedNow()例如,单击按钮。这将使 AdWhirl 完成随机确定新广告网络并调用正确的适配器或在本例中为自定义事件的过程。如果您选择走这条路线,您可能不希望自动刷新,在这种情况下,您应该在后端禁用自动刷新。
配给对象由配置数据中的数据填充。每个配给代表一个广告网络,并具有代表各个广告网络 ID、您在后端设置的权重百分比和回填优先级的键。回填优先级是在原始请求未填充时 AdWhirl 将请求的网络顺序。这种经历回填优先级的过程称为翻转。在实现您自己的自定义事件时,您需要了解一些有关翻转的知识。
提到的 wiki 页面有以下建议可添加到您的自定义事件中:
如果您的自定义事件正确获取广告,您将需要重置滚动顺序(以便下一个请求将具有正确的回填顺序),并调用rotateThreadedDelayed(),以便刷新将在您在后端指定的时间内自动发生。如果广告请求失败,您将需要调用 rolloverThreaded() ,以便 AdWhirl 可以完成其翻转过程来检查您其他配置的广告网络中的广告。
Have you read the wiki page that describes how to use Custom Events? You basically create a custom event in the backend UI which behaves like another ad network, and you can configure it's traffic. Then you can implement the function name that you named in the backend. The only unintuitive part is that you have to implement AdWhirlInterface to listen for the custom event, which means creating an adWhirlGeneric() method. This method can be empty though, I am not seeing it called when creating my own test event. Finally, make sure to set the AdWhirlInterface.
So assuming on the backend you created a network with:
and gave it traffic (I recommend giving it 100% traffic when testing), then your code would look something like this:
To control refreshing your ad, call rotateThreadedNow() on the AdWhirlLayout when a button is clicked, for example. This will take AdWhirl through the process of randomly determining a new ad network, and calling the correct adapter, or custom event in this case. If you choose to go this route, you may not want automatic refreshing, in which case you should disable automatic refreshing on the back end.
The ration object is populated with data from the configuration data. Each ration represents an ad network, and has keys which represent the individual ad network ids, weight percentages that you set in the backend, and backfill priority. Backfill priority is the network order that AdWhirl will request from if the original request did not fill. This process of going through backfill priority is called rollover. You will need to know a little bit about rollover when implementing your own custom event.
The wiki page mentioned has these recommendations to add to your custom event:
If your custom event properly fetches an ad, you will want to reset the rollover order (so the next request will have the correct backfill order), and call rotateThreadedDelayed() so that a refresh will happen automatically in the amount of time you specified on the back end. If the ad request failed, you will want to call rolloverThreaded() so that AdWhirl can go through it's rollover process to check your other configured ad networks for ads.