モバイル版 Google Analytics は PHP5 以降に対応しています。ですから、PHP4 で Google Analytics を使うには Google のコードを改造する必要があります。改造方法は他のサイトで紹介されていますが、しっかりと最初から最後までまとめているサイトがなかったので、ここにまとめさせて頂きます。 なるべく PHP の分からない初心者でもできるように書いていきます。 サーバー環境・モバイルサイト環境 今回は以下の条件で Google Analytics を組み込む方法を紹介します。 HTML ファイル構成された静的サイト PHP4 の共用サーバー .htaccess で php_value を使って include_path が設定できる .htaccess で 拡張子 .html ファイルを PHP ファイルとして動かすことができる PEAR をサーバーに