最佳做法:跟踪横幅展示次数 [英] Best Practices: Tracking Banner Impressions

查看:106
本文介绍了最佳做法:跟踪横幅展示次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用php / mysql编写横幅广告引擎。我不想使用OpenX或交钥匙解决方案,因为会有很多自定义功能,而我不想依靠现有系统来灵活地适应。

I am writing a banner ad engine in php/mysql. I don't want to use OpenX or a turn-key solution because there is going to be a bunch of custom functionality that I would rather not rely upon an existing system to have to flex to accommodate.

这是我的印象以及我当前对印象结构的处理方法:

Here is the thinking and my current approaches to the impressions architecture:


  • 对标语服务器的请求通过javascript传入目标站点上的代码段

  • 服务器已缓存要投放的横幅列表,并根据需要返回适当的图像。

  • 印象数记录到类似于apache的日志文件中访问日志样式:使用旋转的文本文件,每印象增加一行。

  • 日志文件记录用户IP,网址,横幅ID,时间等。

  • 日志文件每小时轮换一次,然后汇总(也每小时一次)到mysql数据库中,以便广告客户可以获得(接近)实时的活动统计信息

  • Requests to banner server come in via javascript snippet on target site
  • Server has cached list of banners to serve and returns appropriate image as needed.
  • Impressions are recorded to log files similar to apache's access log style: using a rotating text file, adding one line per impression.
  • Log files record user IP, url, banner id, time, etc.
  • Log files are rotated hourly and are then summarized (also hourly) to a mysql DB so advertisers can get (close to) real-time stats on activity

我担心的是:


  • 正在以有效且可扩展的方式写入日志文件o记录印象?我们希望每月提供13-15百万次印象。

  • 使用日志编写方法有什么陷阱吗?

推荐答案

我建议对 mod_accesslog 。在主要目的是静态文件推送的情况下,建议使用lighttpd。

I would suggest using lighttpd with mod_accesslog . lighttpd is recommended where static file pushing is the main objective.

由于您在各个网站上都使用javascript,因此请在查询图片的查询字符串中包含所需的信息。顺便说一句,这类似于Google Analytics(分析)汇总其信息的方式。

Since you are using javascript on the individual websites, include the needed information in the query string requesting the image. This is similar to how Google Analytics aggregates their information, by the way.

旋转Web服务器访问日志并在每次旋转期间进行解析。

Rotate the web servers access log and parse during each rotation.

雕刻您访问的日志格式可直接导入到临时mysql表中以进行进一步处理。

Sculpt you access log format to be directly importable into a temporary mysql table for further processing.

我们预计会尽早获得大量的展示次数,并希望在某个时候扩展展示位置,您可以考虑使用CDN。

If you are expecting massive amounts of impressions early and expect to scale at some point, you may consider using a CDN.

这篇关于最佳做法:跟踪横幅展示次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆