Counterize*詳細カウンター&アクセス解析

Sponsored Link

ページ全体を細かくカウントしてくれるプラグインです。
アクセス解析にもなります。

Sponsored Link

1.

PluginのDownload

My Playground様のサイトから、counterize.phpをダウンロードする。
ダウンロードした箇所の下に、イメージのダウンロードもあるので、それもダウンロードする。

 

2.

ファイルをPluginフォルダへ入れて、Upload。

ダウンロードしたフォルダを解凍し、プラグインフォルダに入れてアップロードし、プラグインを有効にする。
ただし、counterize.phpはフォルダを作りプラグインフォルダ(pluguins/counterize/counterize.php)にアップロードしてもよいが、イメージファイルだけは、プラグインフォルダの直下pluguins/○○.png)に入れないと反映されない。

※この時点で、以下(4.事項)のことが反映されない場合について。

データベースを開く。

phpMyAdmin にログインし、
左サイドバーをみて下記がなかった場合、テーブルが作られていないことになります。
※%sはWordPressをインストールした時に作成したテーブル名の接頭語です。
デフォルトのまま作成したなら、wp_lovelog_になっているはず。
ない場合テーブルを作成します。

%s_categories

SQL文を実行

以下の構文を記入してSQL文を実行する。
%SにはプラグインをインストールしたWordPressの接頭語を入れる。
(デフォルトのままなら「wp_lovelog_」

create table %sCounterize
(
id integer not null auto_increment,
IP varchar(16) not null default ‘unknown’,
timestamp datetime not null default ‘now()’,
url varchar(255) not null default ‘unknown’,
referer varchar(255) not null default ‘unknown’,
useragent text,
primary key(id)
)

これで、テーブルが作成されているはずです。
私の場合は自動で作成されていました。

 

3.

設定

以下のカウントができるみたいです。

echo counterize_getuniqueurl()
— Returns amount of unique URl’s that have been shown

echo counterize_getamount()
— Returns total hits seen by Counterize.

echo counterize_gethitstoday()
— Returns total hits registered today.

echo counterize_getuniquebrowsers()
— Returns amount of unique browser-strings that have visited.

echo counterize_getuniquereferers()
— Returns amount of unique referers that’s registered.

echo counterize_getlatest7days()
— Returns total amount of hits from the last 7 days.

echo counterize_getuniqueamount()
— Returns total unique IP’s that’s been seen.

echo counterize_getfromcurrentip()
— Returns total hits from the IP that’s visiting.

echo counterize_getuniquehitstoday()
— Returns the number of different IP’s registered today.

echo counterize_gethitstodayfromcurrentip()
— Returns daily hits from the IP that’s visiting.

echo counterize_return_first_hit()
— Returns the date of the first registrated entry in the database.

counterize_most_visited_pages()
— Create graph of most visited pages.

counterize_most_visited_ips()
— Create graph of most active IPs.

counterize_most_used_browsers()
— Create graph of most seen useragents.

反映されている箇所は、以下のようにダッシュボードの右コンテンツの下あたりに、簡単なカウンターがある。

Counterize Status ?
Total: 173 hits and 11 unique.
Today: 12 hits and 4 unique.

管理画面に、Counterizeが増えている。

 

4.

ページにカウンターとして使うには。

ヒット数などの、専門ページを作成するならば、テンプレートを作る。
3の引用した箇所を参考に、必要な箇所を以下のphpタグに習って保存し、
ページ作成⇒テンプレートを選択⇒保存をしてアップロードする。

 
Sponsored Link