Depending on how accurately you need it, you probably need a table containing the records for which the user has read this article. Their MAC address is not sent with their HTTP request, and their IP address (v4) is probably not unique.
If you want to display data (e.g. stackoverflow), you will not be able to use analytics.
, , Rails.
Pseudo-ish code ( API ):
ArticlesController < ApplicationController
def show
@article = Article.find(params[:id])
current_user.article_readings.find_or_create_by_article_id(@article)
@article_readings = ArticleReading.count(@article.id)
end
end
- "", , , (, , ). google.