LoginSignup
9

More than 5 years have passed since last update.

OctopressでGoogleアナリティクスを使おう!

Posted at

Octopressは、デフォルトでGoogleアナリティクスを使う事が可能です。

Googleアナリティクス情報は、_config.ymlに追記します。

_config.yml
# ----------------------- #
#   3rd Party Settings    #
# ----------------------- #

# Google Analytics
google_analytics_tracking_id: UA-XXXXXXXX-X

後は例の如く、以下の要領で自動生成させて、デプロイします。

$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
/Users/fakestarbaby/.rvm/gems/ruby-1.9.3-p0@fakestarbaby.github.com/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
Configuration from /Users/fakestarbaby/Projects/rails/fakestarbaby.github.com/_config.yml
/Users/fakestarbaby/.rvm/gems/ruby-1.9.3-p0@fakestarbaby.github.com/gems/ffi-1.0.9/lib/ffi/platform.rb:27: Use RbConfig instead of obsolete and deprecated Config.
Building site: source -> public
Successfully generated site: source -> public
$ rake deploy
## Deploying branch to Github Pages 

## copying public to _deploy

## Commiting: Site updated at 2012-03-28 03:43:40 UTC
[master 8d8a8aa] Site updated at 2012-03-28 03:43:40 UTC
 3 files changed, 25 insertions(+), 1 deletions(-)

## Pushing generated _deploy website
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 934 bytes, done.
Total 7 (delta 4), reused 0 (delta 0)
To git@github.com:FakeStarBaby/fakestarbaby.github.com.git
   b45b1ca..8d8a8aa  master -> master

## Github Pages deploy complete

後は、Googleアナリティクス側でトラッキングコードが確認出来ればオーケーです。
簡単ですね!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9