MySQLデータベースにデータが保存されているAnalyticsのページカウンタ

StackOverflow https://stackoverflow.com/questions/9528674

質問

のようなこの質問、ページビューの数を追跡します。ただし、その質問とは異なり、MySQLを使用してデータを保存します。私がその特定のページに関連するデータを効率的に保持するように私のテーブルをセットアップすることをどのように提案しますか?

私はまたページカウンターにいくつかの「インテリジェンス」を適用したいと思います。全体のPageViewsに加えて、(SOと同様に)固有のPageViewsを追跡できますか?これらの変更に合わせてテーブルを上から変更するにはどうすればよいですか?

追加的に、この情報を広告 "views"を追跡することができますか?もしそうなら、どうですか?そうでなければ、それから私はそれを別の質問として喜んで投稿します。

ありがとう。

役に立ちましたか?

解決

This could be the structure of the table you would record every-single-hit.

id | date | ip | user-cookie | agent

And then for performance reasons you could have another table that would be updated by a cron-job.

id | unique-hits

How to define a unique user?
This is a bit of a grey area where your own levels of paranoia kick in. A unique user can be a registered user and that should count as really one hit per user. You can follow the flawed one ip / one user. You can mix and match IP's and user agent's to try and better debunk unique users. Time can also be put into the mix, say every IP after x days will count as a new user.

Do you have a digital fingeprint?
Flash version, and other odities may cause your browser to be "different" from all other browsers creating a more unique view of yourself. Hit the great https://panopticlick.eff.org/ for a preview of what you may look like to a server.

How does Google Analytics does it?
Aparenttly they go cookie all the way.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top