iAd 的 URL 结构
来自 iOS 开发者的求助电话。我正在尝试识别手机中的不同广告网络。为此,我唯一可用的数据是来自应用程序和浏览器的 HTTP 标头的 URL。我可以通过 url 结构轻松识别某些广告网络,例如 Admob、Jumptap。例如,admob 是这样的:
http://a.admob.com/*
http://p.admob.com/*
但我不知道如何识别 Apple 的 iAd。有谁知道这些会产生什么样的 URL?
A call of help from iOS developers out there. I am trying to recognize different Ad Networks in mobile phones. For this the only data available to me are the URL from HTTP headers from the Apps and browser. I could identify certain Ad Networks like Admob, Jumptap easily with the url structure. For example, the admob one is something like this:
http://a.admob.com/*
http://p.admob.com/*
But I can't figure how to identify iAds from Apple. Does anyone know what kind of URLs these produce?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最好的选择是监听设备正在使用的实际 URL。有很多方法可以做到这一点,有些涉及越狱,但是TUAW 上描述的似乎相当不错。通过这种方式,您可以观察许多广告并寻找共同特征。
Your best bet here is to snoop the actual urls that the device is using. There are many ways to do this, some involving Jailbreaking, but the way described on TUAW seems to be pretty good. This way you can observe many ads and look for common traits.
好的。我借助几部 iPhone 和我的本地防火墙/Web 代理服务器对此事进行了一些窥探,这就是我发现的内容:
唉,也没有主机名可以帮助您。对横幅和广告单元的请求在 URL 中包含 IP 地址,而不是主机名。顺便说一句,哪些 IP 地址似乎是遍布各处的 Akamai 内容分发服务器;我见过的地址大多在 70.183.* 和 174.* 中,但在这一点上没有保证。
我见过的 URL 结构相当复杂。删除并替换为~我在嗅探到的数百个请求中观察到的变化的部分,将其作为横幅请求的 URL 模式:
这对于横幅触摸后下载的实际广告:
可能会发生什么如果您不需要区分广告横幅显示和点击,更有用的是寻找用户代理,对于所有横幅请求来说,它是“AdSheet/1.0”。 (当然,请注意,对于正在下载的任何给定横幅,都会有多个横幅请求 - 应用程序编写者向 iAd 指示他想要使用的所有不同尺寸;而且下载广告内容时并非如此,这只是使用 iPhone 的常规用户代理。但如果您只想检测 iAd 是否正在使用等,那可能就不那么重要了。)
Okay. I've done some snooping into the matter with the aid of a couple of iPhones and my local firewall/web proxy server here, and this is what I've found:
Alas, no hostnames to help you, either. The requests for both banners and ad units have IP addresses in the URLs, not hostnames. Which IP addresses, incidentally, appear to be Akamai content distribution servers all over the place; the addresses I've seen have mostly been in 70.183.* and 174.*, but no guarantees on that point.
The URL structures I've seen are quite complex. Stripping out and replacing with ~ the parts which I've observed varying over the few hundred requests I've sniffed gives me this as a URL pattern for a banner request:
And this for an actual ad being downloaded after a banner touch:
What may be of more use, if you don't have any need to distinguish ad banner displays from clickthroughs, is to look for the user agent, which for all the banner requests is "AdSheet/1.0". (Noting of course that there are multiple banner requests for any given banner being downloaded - all the different sizes the app writer indicates to iAd that he wants to use; and also that this is NOT the case when ad content is being downloaded, which just uses the iPhone's regular user agent. But if all you're wanting to do is detect that iAd is in use, etc., that probably doesn't matter so much.)
它似乎使用 https 和 Akamai 进行内容分发。检查 iAd 框架中的文本字符串会发现
https://iadsdk.apple.com/adserver
,它看起来很有希望作为加载广告列表的基地址。It seems that it uses https with Akamai for the content distribution. Checking the iAd framework for text strings reveals
https://iadsdk.apple.com/adserver
, which looks promising as the base address from which the list of ads are loaded.