如何使用 CMS 或 Javascript 投放广告?
根据此处的讨论,我正在寻找一种易于实现的方法在客户网站上投放广告的解决方案。当我们测试 Adsense 和其他广告网络时,代码会定期更改。当然,我不想继续打扰客户,要求他们更改网站上的代码。我想在他们的网站上放置一些保持不变的代码,并根据所使用的广告网络在我们这边进行更改。
已经建议使用 CMS 解决方案(drupal、CMSMS、Tiki 等),但这是否不需要在客户站点上安装 CMS?是否可以使用 CMS 生成几行代码,然后动态地提供 Adsense 等服务?
另外,我知道 Javascript 可能是另一种选择。这会比 CMS 解决方案更容易实施吗?这样会安全吗?
Based on the discussion here, I am looking for an easy-to-implement solution for serving ads on clients' websites. The code changes on a regular basis, as we test Adsense and other ad networks. Naturally, I do not want to keep bothering the client do ask them to change the code on the site. I want to put a bit of code on their site that stays the same and change it on our end depending on the ad network being used.
A CMS solution has been suggested (drupal, CMSMS, Tiki, etc) however would that not require the CMS to be installed on the clients' sites? Is it possible to use a CMS to generate a couple lines of code that could then serve Adsense, etc dynamically?
Also, I understand that Javascript may be another option. Would that be simpler to implement than a CMS solution? Would it be secure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大型网络通常对广告进行 iframe,以防止发布商的 CSS 或 JavaScript 以任何方式影响广告的呈现。
因此,在基本层面上,发布商所需要的只是一些 JavaScript,用于设置具有相关变量的 iframe(即要显示的广告)。执行此操作的 JavaScript 由您托管,以便对代码的任何更新都会传播到您的客户端。
使用像 Drupal 这样的 CMS 来托管广告是毫无意义的,而且速度很慢。缓存广告页面并设置正确的标题(例如无 etag 等)。
然后,您需要将所有内容(HTML、图像和 JavaScript)推送到 CDN(例如 Amazon 的 S3)上。
Large networks often iframe the ads to prevent the publisher's CSS or JavaScript affecting the rendering of the ad in any way.
Therefore, at a basic level, all the publisher needs is a bit of JavaScript that sets the iframe with the relevant variables (i.e. which ad to show). The JavaScript to do that is hosted by you so that any updates to the code are propagated to your clients.
Using a CMS like Drupal to host the ads would be pointless and slow. Cache the ad pages and set the right headers (like no etags, etc).
Then you need to push everything (HTML, image and JavaScript) onto a CDN like Amazon's S3.
您可以查看 Google DFP 和 OIO 发布商专业版。
You can have a look At Google DFP and OIO publishers Pro Version.