SlideShare a Scribd company logo
1 of 15
2018/04/18(水)渋谷.rb[:20180418]
Google Analytics を簡単に使うための
gem を作った話
Osamu Takiya
Google Analytics とは #1
✤ Google製のアクセス解析ツール
✤ 同種のツールの中では圧倒的シェア(に違いない)
✤ こんな感じ(自分のブログの場合)
✤ https://analytics.google.com/analytics/web/?hl=ja&pl
i=1#/embed/report-
home/a49421871w81159698p84037207
Google Analytics とは #2
✤ データを取得するためにはWebでポチポチが基本
✤ CSVやxlsxで書き出せば再利用できる
Google Analytics とは #3
✤ 自動化の仕組みはある
✤ GAS(一番現実的)
✤ カスタムレポート
✤ データスタジオ
Google Analytics とは #4
✤ しかし……
✤ どれもスマートじゃない……
✤ 作ろう
simple-ga-reporting #1
✤ 先人 Legato
✤ https://github.com/tpitale/legato
✤ (自分には)難しすぎ問題
✤ Legato をラップした
✤ https://github.com/corselia/simple-ga-reporting
simple-ga-reporting #2
✤ 方針
✤ 機能を削ぎ落としてもいいのでとにかく簡単にする
✤ 設定項目は柔軟に変更できるようにする
simple-ga-reporting #3
✤ できたもの
✤ 設定ファイルを1つ、フィルターファイルを1つ(任意)
書いて実行するだけ
✤ 設定ファイルの内容は引数で上書きもできる
✤ フィルターファイルに書いたフィルターは使いまわせ
る
→ ここらへんで実演
simple-ga-reporting #4
✤ よいところ #1
✤ バージョン管理ができる(GAaC)
✤ 設定内容やフィルタ内容を変更してデータを取得する
のが楽(気軽に色々試せる)
✤ 何だかんだで機能は十分
✤ 「セグメント」は「フィルター」と同義(代替可能
)
simple-ga-reporting #5
✤ よいところ #2
✤ 「サンプリング」を回避できる
✤ 「サンプリング」とは? → 次のスライド
「サンプリング」とは?
✤ データ量が膨大になった際に集計されるデータが「予
測値」になること
✤ 膨大なデータ: あるページのページビューを1分刻み
で算出し、集計期間を一ヶ月とすると……
✤ 60 * 24 * 30 = 43,200 行 のデータ
simple-ga-reporting #6
✤ 「サンプリング」を回避するには集計期間を短くすればい
い
✤ 「30日分のデータをまとめて取得」するのではなく、「1
日分のデータを30回取得」する
✤ 期間指定の設定項目を引数で上書きしてループで回す
だけ
✤ Rate Limits はあってないようなもの
もろもろ #1
✤ gem を作っている時間よりドキュメントを書いてい
る時間のほうが長かった(体感)
✤ https://github.com/corselia/simple-ga-
reporting/blob/master/README.md
もろもろ #2
✤ 「これは車輪の再発明なのでは……」
✤ そうだったとしてもGAを復習するよい機会になっ
たので問題なし
✤ もちろん Ruby を書くよい機会にもなったので問題
なし
おわり
「技術書典4」に出ますのでお時間があれば……

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Google Analytics を簡単に使うための gem を作った話