This repository has been archived by the owner on Mar 23, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0cc98c8
Showing
11 changed files
with
579 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
0.2 2009--5-09 00:32:42 JST Ryuzo Yamamoto (dragon3) | |||
- Insert comment tags around JavaScript code. ( thanx k1LoW ) | |||
|
|||
0.1 2008-12-25 18:19:28 JST Ryuzo Yamamoto (dragon3) | |||
- First release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,53 @@ | |||
## | |||
## Makefile -- Build procedure for sample google_analytics Apache module | |||
## Autogenerated via ``apxs -n mod_google_analytics -g''. | |||
## | |||
|
|||
basedir=/usr/share/apache2 | |||
|
|||
# CentOS or RHEL | |||
# basedir=/usr/lib/httpd | |||
|
|||
top_srcdir=${basedir} | |||
top_builddir=${basedir} | |||
|
|||
builddir=. | |||
|
|||
include ${top_builddir}/build/special.mk | |||
|
|||
# the used tools | |||
APXS=apxs | |||
APACHECTL=apachectl | |||
|
|||
# additional defines, includes and libraries | |||
#DEFS=-Dmy_define=my_value | |||
#INCLUDES=-Imy/include/dir | |||
#LIBS=-Lmy/lib/dir -lmylib | |||
|
|||
# the default target | |||
all: local-shared-build | |||
|
|||
# install the shared object file into Apache | |||
install: install-modules-yes | |||
|
|||
# cleanup | |||
clean: | |||
-rm -f mod_google_analytics.o mod_google_analytics.lo mod_google_analytics.slo mod_google_analytics.la | |||
|
|||
# simple test | |||
test: reload | |||
lynx -mime_header http://localhost/mod_google_analytics | |||
|
|||
# install and activate shared object by reloading Apache to | |||
# force a reload of the shared object file | |||
reload: install restart | |||
|
|||
# the general Apache start/restart/stop | |||
# procedures | |||
start: | |||
$(APACHECTL) start | |||
restart: | |||
$(APACHECTL) restart | |||
stop: | |||
$(APACHECTL) stop | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,85 @@ | |||
================================================================================ | |||
_ | |||
_ __ ___ ___ __| | | |||
| '_ ` _ \ / _ \ / _` | | |||
| | | | | | (_) | (_| | | |||
|_| |_| |_|\___/ \__,_| | |||
_ _ _ _ | |||
__ _ ___ ___ __ _| | ___ __ _ _ __ __ _| |_ _| |_(_) ___ ___ | |||
/ _` |/ _ \ / _ \ / _` | |/ _ \ / _` | '_ \ / _` | | | | | __| |/ __/ __| | |||
| (_| | (_) | (_) | (_| | | __/ | (_| | | | | (_| | | |_| | |_| | (__\__ \ | |||
\__, |\___/ \___/ \__, |_|\___| \__,_|_| |_|\__,_|_|\__, |\__|_|\___|___/ | |||
|___/ |___/ |___/ | |||
|
|||
================================================================================ | |||
http://trac.codecheck.in/share/wiki/ModGoogleAnalytics | |||
|
|||
* これは何? | |||
GoogleAnalyticsのタグを自動的にHTMLに挿入するApacheフィルタモジュールです。 | |||
|
|||
* 動作環境 | |||
Apache 2.2 | |||
|
|||
* インストール方法 | |||
makeコマンドによりソースコンパイルとインストールを行います。 | |||
|
|||
Makefileの下記を環境に応じて変更すればコンパイルできるでしょう。 | |||
---------- | |||
basedir=/usr/share/apache2 | |||
---------- | |||
|
|||
コンパイル、インストールを下記コマンドで行います。 | |||
|
|||
su | |||
make install | |||
|
|||
または | |||
|
|||
sudo make install | |||
|
|||
* 設定方法 | |||
httpd.conf に下記設定を追加します。 | |||
---------- | |||
LoadModule google_analytics_module modules/mod_google_analytics.so | |||
|
|||
AddOutputFilterByType GOOGLE_ANALYTICS text/html | |||
GoogleAnalyticsAccountNumber UA-1234567-8 | |||
---------- | |||
|
|||
"GoogleAnalyticsAccountNumber"は、GoogleAnalyticsのアカウント番号です。 | |||
|
|||
AddOutputFilterByTypeなどのフィルタ指定ディレクティブでON/OFFを指定するので、 | |||
<Location/> <Directory/> などに適用することができます。 | |||
|
|||
なお、HTML中にすでにGoogleAnalyticsタグが存在しているっぽい場合は、挿入しません。 | |||
|
|||
* パフォーマンス | |||
未使用の場合にくらべ約80%程のパフォーマンスになります。 | |||
|
|||
下記URLにある mod_ext_filter + sed で同様の機能を実現する場合よりも、 | |||
約7倍以上高速に動作しました。 | |||
|
|||
[Google Analytics 用のトラッキングコードを Apache に自動挿入させる] | |||
http://pmakino.jp/tdiary/20051114.html | |||
|
|||
[参考ベンチマーク] | |||
環境: | |||
CPU: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz / Memory: 4GB / OS: Ubuntu 8.10 / Apache: 2.2.9-7ubuntu3 | |||
|
|||
- ab -n1000 | |||
| | [#/sec] | | |||
| none | 3145.50 | | |||
| mod_ext_filter + sed | 326.63 | | |||
| mod_google_analytics | 2443.20 | | |||
|
|||
- ab -c10 -n1000 | |||
| | [#/sec] | | |||
| none | 3270.49 | | |||
| mod_ext_filter + sed | (not completed...) | | |||
| mod_google_analytics | 2776.35 | | |||
( mod_ext_filter + sed は、sedプロセスが残って終了できませんでした ) | |||
|
|||
|
|||
* ライセンス | |||
Apache License, Version 2.0 | |||
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,85 @@ | |||
================================================================================ | |||
_ | |||
_ __ ___ ___ __| | | |||
| '_ ` _ \ / _ \ / _` | | |||
| | | | | | (_) | (_| | | |||
|_| |_| |_|\___/ \__,_| | |||
_ _ _ _ | |||
__ _ ___ ___ __ _| | ___ __ _ _ __ __ _| |_ _| |_(_) ___ ___ | |||
/ _` |/ _ \ / _ \ / _` | |/ _ \ / _` | '_ \ / _` | | | | | __| |/ __/ __| | |||
| (_| | (_) | (_) | (_| | | __/ | (_| | | | | (_| | | |_| | |_| | (__\__ \ | |||
\__, |\___/ \___/ \__, |_|\___| \__,_|_| |_|\__,_|_|\__, |\__|_|\___|___/ | |||
|___/ |___/ |___/ | |||
|
|||
================================================================================ | |||
http://trac.codecheck.in/share/wiki/ModGoogleAnalytics | |||
|
|||
* これは何? | |||
GoogleAnalyticsのタグを自動的にHTMLに挿入するApacheフィルタモジュールです。 | |||
|
|||
* 動作環境 | |||
Apache 2.2 | |||
|
|||
* インストール方法 | |||
makeコマンドによりソースコンパイルとインストールを行います。 | |||
|
|||
Makefileの下記を環境に応じて変更すればコンパイルできるでしょう。 | |||
---------- | |||
basedir=/usr/share/apache2 | |||
---------- | |||
|
|||
コンパイル、インストールを下記コマンドで行います。 | |||
|
|||
su | |||
make install | |||
|
|||
または | |||
|
|||
sudo make install | |||
|
|||
* 設定方法 | |||
httpd.conf に下記設定を追加します。 | |||
---------- | |||
LoadModule google_analytics_module modules/mod_google_analytics.so | |||
|
|||
AddOutputFilterByType GOOGLE_ANALYTICS text/html | |||
GoogleAnalyticsAccountNumber UA-1234567-8 | |||
---------- | |||
|
|||
"GoogleAnalyticsAccountNumber"は、GoogleAnalyticsのアカウント番号です。 | |||
|
|||
AddOutputFilterByTypeなどのフィルタ指定ディレクティブでON/OFFを指定するので、 | |||
<Location/> <Directory/> などに適用することができます。 | |||
|
|||
なお、HTML中にすでにGoogleAnalyticsタグが存在しているっぽい場合は、挿入しません。 | |||
|
|||
* パフォーマンス | |||
未使用の場合にくらべ約80%程のパフォーマンスになります。 | |||
|
|||
下記URLにある mod_ext_filter + sed で同様の機能を実現する場合よりも、 | |||
約7倍以上高速に動作しました。 | |||
|
|||
[Google Analytics 用のトラッキングコードを Apache に自動挿入させる] | |||
http://pmakino.jp/tdiary/20051114.html | |||
|
|||
[参考ベンチマーク] | |||
環境: | |||
CPU: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz / Memory: 4GB / OS: Ubuntu 8.10 / Apache: 2.2.9-7ubuntu3 | |||
|
|||
- ab -n1000 | |||
| | [#/sec] | | |||
| none | 3145.50 | | |||
| mod_ext_filter + sed | 326.63 | | |||
| mod_google_analytics | 2443.20 | | |||
|
|||
- ab -c10 -n1000 | |||
| | [#/sec] | | |||
| none | 3270.49 | | |||
| mod_ext_filter + sed | (not completed...) | | |||
| mod_google_analytics | 2776.35 | | |||
( mod_ext_filter + sed は、sedプロセスが残って終了できませんでした ) | |||
|
|||
|
|||
* ライセンス | |||
Apache License, Version 2.0 | |||
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
* 携帯端末の場合にJavaScript挿入ではなく、下記サイトのような処理をおこなう | |||
- http://www.ianlewis.org/jp/google-analytics | |||
- http://ke-tai.org/blog/2009/01/16/selenga4k/ | |||
* 設定値のチェック | |||
* 文字列置換処理の改善 |
Oops, something went wrong.