追è¨
2018/04/13 14:35:00 ããã« v1.1.1 ããªãªã¼ã¹ãã¾ããããã®ãã¼ã¸ã§ã³ã§å¼æ°ã®æå®æ¹æ³ãå¤ãã£ã¦ãã¾ãï¼ãã¼ã¯ã¼ãå¼æ°ã«å¤æ´ï¼ã以ä¸ã®èª¬æã§ã¯ææ°ã®ãã®ã«ä¿®æ£ãã¦ãã¾ãããæ§çãã使ãã®æ¹ã¯ã注æä¸ããã
ãã£ãã
Ruby ãç¨ã㦠Google Analytics ã®ãã¼ã¿ã API ã§åå¾ããå ´åãLegato
ã¨ãã gem ã使ãã®ãä¸è¬çãã¨æãã¾ã*1ã
ããããªãããã® Legato
ã¯ç§ã®ãããªåå¿è
ã使ãã®ã«ã¯é£ããç¹ãå¤ãããã¾ãããããã§ãç°¡åãªè¨å®ãã¡ã¤ã«ãæ¸ãã ãã§ãã¼ã¿ãåå¾ã§ãã Legato
ã®ã©ããã¼ã¨ãªã gem ãä½ãã¾ããã
simple_ga_reporting
simple_ga_reporting
ã¨ããã®ããã® gem ã«ãªãã¾ããã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã®å ´æã«ããã¾ãã
gem ã¨ãã¦ãå ¬éæ¸ã¿ã§ãã
simple_ga_reporting | RubyGems.org | your community gem host
使ãæ¹
使ãæ¹ã説æãã¾ããREADME ã«ç¶²ç¾ ãã¦ã¯ãã¾ãã*2ãæ¹ãã¦ããã§ã説æãã¾ãã
使ãæ¹ã®å¤§ã¾ããªæµã
使ãããã®å¤§ã¾ããªæµãã¯ä»¥ä¸ã®ã¨ããã§ãã
- API ãç¨ããããã«
private_key
ã¨client_email
ãåå¾ããï¼Google Cloud Platformä¸ï¼ - Google Analytics ã® API ãæå¹ã«ããï¼Google Cloud Platformä¸ï¼
- Google Analytics ã®ã¦ã¼ã¶ã¢ã«ã¦ã³ãã«
client_email
ã®ã¦ã¼ã¶ãç»é²ããï¼Google Analyticsä¸ï¼ - è¨å®ãã¡ã¤ã«ã3ã¤ä½æãã
- 4-1.
private_key
ã¨client_email
ãè¨è¼ããè¨å®ãã¡ã¤ã«ãä½æãã ããã㯠ãã®2ã¤ãã¡ã½ããã®å¼æ°ã§è¨å®ããï¼å¿ é ï¼ - 4-2. åå¾ããããã¼ã¿ã®æ¡ä»¶ãè¨è¼ããè¨å®ãã¡ã¤ã«ãä½æããï¼å¿ é ï¼
- 4-3. ãã¼ã¿ããã£ã«ã¿ãªã³ã°ããå ´åã¯ãã£ã«ã¿ã®è¨å®ãã¡ã¤ã«ãä½æããï¼ä»»æï¼
- 4-1.
- ãã¼ã¿ãåå¾ããããã®ã¢ããªã±ã¼ã·ã§ã³ãæ¸ã
- ã¢ããªã±ã¼ã·ã§ã³ãå®è¡ãã¦ãã¼ã¿ãåå¾ãã
使ãæ¹ã®è©³ç´°
詳ãã使ãæ¹ãä¸ã¤ä¸ã¤é ã追ã£ã¦èª¬æãã¦ããã¾ãã
1. API ãç¨ããããã« private_key
㨠client_email
ãåå¾ããï¼Google Cloud Platformä¸ï¼
private_key
㨠client_email
ãåå¾ãã¾ããå°ã
é·ããªãã¾ãã®ã§ãå¥ã®è¨äºã«ã¾ã¨ãã¾ããã
2. Google Analytics ã® API ãæå¹ã«ããï¼Google Cloud Platformä¸ï¼
Google Cloud Platform 㧠ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãåå¾ããå¾ã«å©ç¨ããã API ãæå¹ã«ããªããã°ããã¾ããã
ã¡ãã¥ã¼ãããAPI ã¨ãµã¼ãã¹ãâãã©ã¤ãã©ãªãã¨ãã©ãã¾ãããã㨠API ãæ¤ç´¢ãããã¨ãã§ãã¾ãã®ã§ããAnalyticsãã¨å ¥åãã¦çµãè¾¼ã¿ã¾ãã
ãããã£ã½ããçµæãããã¤ãåºã¦ãã¾ãããAnalytics API ãé¸ã³ã¾ããGoogle Analytics Reporting APIã§ã¯ãªãã§ã*3ãAnalytics API
ãé¸æå¾ãæå¹åãã¾ãããã
Google Analytics ã®ã¦ã¼ã¶ã¢ã«ã¦ã³ãã« client_email
ã®ã¦ã¼ã¶ãç»é²ããï¼Google Analyticsä¸ï¼
ã1.ãã§åå¾ã§ãã client_email
ã Google Analytics ã®ã¦ã¼ã¶ã¨ãã¦ç»é²ãã¾ãã
ã¾ã Google Analytics ã®ç®¡çç»é¢ã«è¡ãã¾ãã
ä¸çªå³ã®ããã¥ã¼ãã®åãããã¦ã¼ã¶ã¼ç®¡çè ããé¸æãã¾ãããã¦ã¼ã¶ã¼ç®¡çè ãã®ãªã³ã¯ãåå¨ããªãå ´åã¯æä½ãã¦ããã¢ã«ã¦ã³ãã«æ¨©éãããã¾ããã®ã§ã権éãããã¢ã«ã¦ã³ãã§ãã°ã¤ã³ããç´ãã¾ãããã
ãã¦ã¼ã¶ç®¡çè ãã®ç»é¢ã«é·ç§»ããã¨ãå³ä¸ã«ã+ããã¼ã¯ãè¦ãã¾ãããã®ãã¼ã¯ãã¯ãªãã¯ãã¦æ°è¦ã¦ã¼ã¶ã¼ã®ç»é²ãè¡ãã¾ãã
ç»é²ããã¦ã¼ã¶ã®ã¡ã¼ã«ã¢ãã¬ã¹ã¯ client_email
ã®ã¢ãã¬ã¹ã«ãªãã¾ããä»ä¸ãã権éã¯ã表示ã¨åæãã§ååã§ãã
4. è¨å®ãã¡ã¤ã«ã3ã¤ä½æãã
è¨å®ãã¡ã¤ã«ãä½æãã¦ããã¾ãã
4-1. private_key
㨠client_email
ãè¨è¼ããè¨å®ãã¡ã¤ã«ãä½æãã ããã㯠ã¡ã½ããã®å¼æ°ã§è¨å®ããï¼å¿
é ï¼
Google Analytics ã¸ã®ã¢ã¯ã»ã¹ã API çµç±ã§è¡ãããã« private_key
㨠client_email
ãè¨è¼ããè¨å®ãã¡ã¤ã«ãä½æãã¾ããããã©ã«ãã®ä¿åå ´æ㯠config/key_and_email.yml
ã§ãã
è¨å®ãã¡ã¤ã«ã®ãã©ã¼ããã㯠YAML ã§ããprivate_key
㨠client_email
ããã¼ã«æã¡ãå¤ã¯ã1.ãã§åå¾ããå¤ã¨ãªãã¾ãï¼ä¸è¨åç
§ï¼ã
private_key: "-----BEGIN PRIVATE KEY-----\nMIIEããã«é·ãæååãå ¥ãEqw==\n-----END PRIVATE KEY-----\n" client_email: "[email protected]"
â»v1.3.0 ã«ã¦ãä¸è¨ã®ãã¡ã¤ã«ãç¨ããã« SimpleGaReports.filtered_results(private_key: 'FOO', client_email: 'BAR')
ã®ãããªå½¢ã§å¼æ°ã¨ãã¦è¨å®ãããã¨ãã§ããããã«ãªãã¾ãã
4-2. ãåå¾ããããã¼ã¿ã®æ¡ä»¶ããè¨è¼ããè¨å®ãã¡ã¤ã«ãä½æããï¼å¿ é ï¼
Google Analytics ã§ãåå¾ããããã¼ã¿ã®æ¡ä»¶ããè¨ããè¨å®ãã¡ã¤ã«ãä½æãã¾ãããã¡ã¤ã«ã®ãã©ã¼ããã㯠YAML ã§ããããã©ã«ãã®ä¿åå ´æ㯠config/ga_reporting_config.yml
ã§ãããã®ãã¡ã¤ã«ãè¤æ°ä½ããã¨ã§è¤æ°ã®ãã¼ã¿åå¾æ¡ä»¶ã使ãåãããã¨ãã§ãã¾ãã
å®éã®ãã¡ã¤ã«ã®ä¾ã示ãã¾ãããã
profile_name: my_profile_name start_date: 2018-04-01 end_date: 2018-04-05 metrics: - users - pageviews dimensions: - pagePath - pageTitle sort: - -pageviews - -users filters: - chrome_or_fx - happy_page limit: 20
ä¸è¨ã®è¨å®ãã¡ã¤ã«ã«ããåå¾ããããã¼ã¿ã¯æ¬¡ã®ã¨ããã§ãã
- ãmy_profile_nameãã¨ãããã¥ã¼åï¼ãããã¡ã¤ã«åï¼ã®ãã¼ã¿ã§ã
- åå¾ãã¼ã¿ã®æ¥ä»ã®ç¯å²ã¯ 2018-04-01 ã 2018-04-05 ã§ã
- ææ¨ï¼ã¡ããªã¯ã¹ï¼ã¯
users
ã¨pageviews
ã§ã - ãã£ã¡ã³ã·ã§ã³ã¯
pagePath
ã¨pageTitle
ã§ã - çµæã®ä¸¦ã³é ã¯ã
pageviews
ã§éé ã½ã¼ããããã®ãusers
ã§éé ã½ã¼ããããã®ãã§ã - ãã£ã«ã¿ã¼ã¨ãã¦
chrome_or_fx
ã¨happy_page
ã¨ãããã®ãç¨ãã¦ã - 表示件æ°ã®æ大æ°ã 20 ã¨ãã
ãã®è¨å®ãã¡ã¤ã«ã§æå®ã§ãããã¼ã¯ Legato
ã§å®ç¾©ããã¦ãããã¼ã«ãªãã¾ããå
·ä½çã«ã¯ä»¥ä¸ã®ã¨ããã§ãã
- profile_name
- start_date
- end_date
- metrics
- dimensions
- sort
- filters
- limit
- sampling_level
ãã¼ã®è©³ç´°ã¯ å ¬å¼ããã¥ã¡ã³ã ãã覧ãã ããï¼é常ã«è©³ããã§ãï¼ã
ããããã®ãã¼ã«ã¤ãã¦ä»¥ä¸ã§èª¬æããã¾ãã
profile_nameï¼å¿ é ï¼
ãã¼ã¿åå¾ã®å¯¾è±¡ã¨ããããããã¡ã¤ã«åï¼ãã¥ã¼åï¼ãã§ããããããã¡ã¤ã«IDï¼ãã¥ã¼IDï¼ãã§ã¯ãªããããããã¡ã¤ã«åï¼ãã¥ã¼åï¼ããæå®ãã¦ä¸ãã*4ã
start_dateï¼å¿ é ï¼
ãã¼ã¿ãåå¾ããéå§æ¥ã§ããæ¸å¼ã¨ãã¦ã¯ä»¥ä¸ã®ãã®ãèªãããã¦ãã¾ãã
- 2018-04-01
today
ã¾ãã¯yesterday
14daysAgo
- 1æ¥åã®å ´åã
1daysAgo
ã¨è¤æ°å½¢ã«ãªãã¾ã
- 1æ¥åã®å ´åã
end_dateï¼å¿ é ï¼
ãã¼ã¿ãåå¾ããçµäºæ¥ã§ããæ¸å¼ã¯ start_date
ã¨åä¸ã§ãã
metricsï¼å¿ é ï¼
æ¥æ¬èªã§ãææ¨ãã¨å¼ã°ãããã®ã§ãããã®ãã¼ã«åãå¾ãå¤ã«ã¤ãã¦ã¯å ¬å¼ããã¥ã¡ã³ããåç §ãã¾ãããï¼é常ã«è©³ããã便å©ã§ãï¼ã
以ä¸ã®ããã°ã大å¤ã«åèã«ãªãã¾ãã
deimensionsï¼ä»»æï¼
æ¥æ¬èªã§ããã£ã¡ã³ã·ã§ã³ãã¨å¼ã°ãããã®ã§ãããã®ãã¼ã«åãå¾ãå¤ã«ã¤ãã¦ã¯å ¬å¼ããã¥ã¡ã³ããåç §ãã¾ãããï¼é常ã«è©³ããã便å©ã§ãï¼ã
以ä¸ã®ããã°ã大å¤ã«åèã«ãªãã¾ãã
sortï¼ä»»æï¼
åå¾ããããã¼ã¿ãã½ã¼ãï¼ä¸¦ã³æ¿ãï¼ããéã«æå®ãã¾ããæå®ãããå¤ã®åã§ã½ã¼ãããã¾ããå¤ã®åã« -
è¨å·ãä»ä¸ãããå ´åã¯ãéé ããä½ãè¨å·ããªãå ´åã¯ãæé ãã¨ãªãã¾ã*5ã
filtersï¼ä»»æï¼
åå¾ããããã¼ã¿ã«ãã£ã«ã¿ã¼ããããå ´åã«æå®ãã¾ããå¤ã¨ãã¦æå®ããæååã¯ãé©ç¨ãããã£ã«ã¿ã¡ã½ããåãã«ãªãã¾ããéããããå¯è½ã§ãï¼é ä¸åï¼ã
ãã®ãã¼ãç¨ããå ´åã«ã¯å¥éãã£ã«ã¿ã¼ãã¡ã¤ã«ãä½æãããã¨ãå¿ è¦ã§ãããã£ã«ã¿ã¼ãã¡ã¤ã«ã®ä½ææ¹æ³ã¯ã3-3.ãã«ã¦èª¬æãã¾ãã
limitï¼ä»»æï¼
åå¾ãããã¼ã¿ã®è¡æ°ã®ä¸éå¤ãæå®ãã¾ããããã©ã«ãã§ã¯ 100
ã§ãã
sampling_levelï¼ä»»æï¼
åå¾ãããã¼ã¿ã®ã精度ããæå®ãã¾ããããã©ã«ã㧠HIGHER_PRECISION
ã«è¨å®ãã¦ãã¾ããä»ã« FASTER
㨠DEFAULT
ãããã¾ãã精度ãé«ãã»ã©å¦çæéããããã®ã§ãããç§ãããã¾ã§ã«è©¦ããç¯å²ã§ã¯ããã®å¤ãç°ãªããã¨ã«ããå®è¡é度ã®å·®ã¯æãããã¾ããã§ããã
4-3. ãã¼ã¿ããã£ã«ã¿ãªã³ã°ããå ´åã¯ãã£ã«ã¿ã®è¨å®ãã¡ã¤ã«ãä½æããï¼ä»»æï¼
åå¾çµæã«ãã£ã«ã¿ã¼ããããå ´åã«ã¯ãã£ã«ã¿ã¼ãã¡ã¤ã«ãæ¸ããã¨ãå¿ è¦ã§ãããã©ã¼ããã㯠Ruby ã®ã¢ã¸ã¥ã¼ã«ã§ãã
å ·ä½ä¾ã§èª¬æããæ¹ãåãããããã¨æãã¾ãã®ã§ã以ä¸ã«ç¤ºãã¾ãã
module Filters def chrome_or_fx filter :chrome_or_fx, &lambda { contains(:browser, 'Chrome|Firefox') } end def happy_page filter :happy_page, &lambda { contains(:pagePath, '\A.*happy.*\z') } end end
ä¸è¨ã®ãã£ã«ã¿ã¼ãã¡ã¤ã«ã説æãã¾ãã
- ã¢ã¸ã¥ã¼ã«åã¯
Filters
ã¨ãªã£ã¦ãããããã¯åºå®ã§ã - ã¢ã¸ã¥ã¼ã«ã®ä¸ã«ã¡ã½ãããç¨ãã¦ãã£ã«ã¿ã¼ãæå®ãã¾ã
- ã¡ã½ããåã¯ä»»æã§ããããã£ã«ã¿ã¼åã¨åä¸ã«ããæ¹ãåãããããã¨ã¯æãã¾ã
- ãã£ã«ã¿ã¼ä½æã®éã«ã¯ããã£ã«ã¿ã¼ã¡ã½ããåãã¨ããã£ã«ã¿ã¼ã®å
容ããæå®ãã¾ã
- ããã£ã«ã¿ã¼ã¡ã½ããåãã¯ã·ã³ãã«ã§æå®ãã¾ã
- ä¸è¨ã§è¨ãã°
:chrome_or_fx
ã¨:happy_page
ã§ã
- ä¸è¨ã§è¨ãã°
- ããã£ã«ã¿ã¼ã®å
容ãã¯ãããã¯ãªãã¸ã§ã¯ãã§æå®ãã¾ã
- ä¸è¨ã§è¨ãã°
&lambda
ã®ãããã¯å¼æ°ã®é¨åã§ã contains
ãªã©ã®æ¼ç®åã«ä½ãåãããã¯Legato
ã®ããã¥ã¡ã³ã ãåç §ãã¦ä¸ãã- ANDæ¡ä»¶ ã ORæ¡ä»¶ ã¯ä¸ããæ£è¦è¡¨ç¾ã§æå®ã§ãã¾ã
- ãã£ã«ã¿ããéãããããã¦ã ANDæ¡ä»¶ ãä½ãã¾ã
- ä¸è¨ã§è¨ãã°
- ããã£ã«ã¿ã¼ã¡ã½ããåãã¯ã·ã³ãã«ã§æå®ãã¾ã
4. ãã¼ã¿ãåå¾ããããã®ã¢ããªã±ã¼ã·ã§ã³ãæ¸ã
è¨å®ãã¡ã¤ã«ãç¨æã§ããããããããã¼ã¿ãåå¾ããããã®ã¢ããªã±ã¼ã·ã§ã³ãæ¸ãã¾ãããã¡ãããµã³ãã«ã³ã¼ããè¦ã¦ã¿ã¾ãã
注æç¹ã¨ãã¦ããè¨å®ãã¡ã¤ã«åã®ãã¹ãæå®ããå ´åã¯ãå é ã«ã./ï¼ãããã¹ã©ãã·ã¥ï¼ããå¿ ãä»ä¸ãã¦ãã ããã*6ã
require 'simple_ga_reporting' SimpleGaReports.configure(report_config: './bar/my_ga_reporting_config.yml', filters: './foobar/filters.rb', start_date: '2daysAgo', limit: 100) results = SimpleGaReports.filtered_results(key_and_email: './foo/my_key_and_email.yml') results.each do |result| puts '===================================' puts result['pagePath'] puts result['pageTitle'] puts result['pageviews'] puts result['users'] end
ä¸è¨ã®ã³ã¼ãã追ãããã¦ããã¾ãã
- 1è¡ç®ã¯ gem ã require ãã¦ãã¾ããå®è¡ããã¾ã§ã«ã¯ gem ãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ããã
- 3è¡ç®ã§ããã¼ã¿ã®åå¾æ¡ä»¶ã®è¨å®ãã¡ã¤ã«ãã¨ããã£ã«ã¿è¨å®ãã¡ã¤ã«ããèªã¿è¾¼ãã§è¨å®ã確å®ããã¦ãã¾ã
SimpleGaReports.configure
ã¯åºå®ã®ã¯ã©ã¹ã¡ã½ããã§ã- å¼æ°ã¯æ¬¡ã®ã¨ããã§ã
- 第ä¸å¼æ°ã«ã¯
report_config
ããã¼ã¨ãã¦ããã¼ã¿ã®åå¾æ¡ä»¶ã®è¨å®ãã¡ã¤ã«ãã®å ´æãæå®ãã¾ãï¼çç¥æã¯ããã©ã«ãã®å ´æï¼ - 第äºå¼æ°ã«ã¯
filters
ããã¼ã¨ãã¦ããã£ã«ã¿è¨å®ãã¡ã¤ã«ãã®å ´æãæå®ãã¾ãï¼æå®ã¯ä»»æã§ãï¼ - 第ä¸å¼æ°ä»¥éã«ã¯ããã¼ã¿ã®åå¾æ¡ä»¶ã®è¨å®ãã¡ã¤ã«ãã®è¨å®é ç®ã§ä¸æ¸ããããé ç®ãåå¥ã«æå®ã§ãã¾ãï¼æå®ã¯ä»»æã§ãï¼
- 第ä¸å¼æ°ã«ã¯
- 4è¡ç®ã®ã¡ã½ããå®è¡ã«ããçµæãåå¾ã§ãã¾ã
SimpleGaReports.filtered_results
ã¯åºå®ã®ã¯ã©ã¹ã¡ã½ããã§ã- å¼æ°ã«ã¯
key_and_email
ããã¼ã¨ãã¦ãprivate_key
ã¨client_email
ãè¨è¼ããè¨å®ãã¡ã¤ã«ãã®å ´æãå¤ã«æå®ãã¾ãï¼çç¥æã¯ããã©ã«ãã®å ´æï¼ - æ»ãå¤ã¯
Legato::Query
ã§ã- 詳細ã¯
Legato
ã®ããã¥ã¡ã³ã ãåèã«ãã¦ä¸ãã
- 詳細ã¯
- 6è¡ç® ã 12è¡ç® ã§å
·ä½çãªãã¼ã¿ãåãåºãã¦ãã¾ã
each
ã¡ã½ããã§ãã©ãããªãã¸ã§ã¯ãã«å¯¾ãã¦ãã¼ãæå®ãããã¨ã§å¤ãåãåºãã¦ãã¾ã- ãã¼ã«æå®ã§ããæååã¯ï¼ãã¡ããï¼è¨å®ãã¡ã¤ã«ã«è¨è¼ããæååã§ã
5. ã¢ããªã±ã¼ã·ã§ã³ãå®è¡ãã¦ãã¼ã¿ãåå¾ãã
ã4.ãã®ã³ã¼ãããä¾ãã° my_sample_app.rb
ã¨ä¿åãã¦å®è¡ããã°ä»¥ä¸ã®çµæãå¾ããã¾ããgem ã®ã¤ã³ã¹ãã¼ã«ã¯äºãæ¸ã¾ãã¦ããã¦ä¸ãã*7ã
å種è¨å®ãã¡ã¤ã«ã®å 容ã¯ã4-1. ã 4-3.ãã®å 容ãç¨ãããã®ã¨ãã¾ãã
$ ruby ./my_sample_app.rb =================================== /i_am_happy.html I am HAPPY! 10000 1000 =================================== /happy/index.html HAPPY TOP 9000 900 =================================== /path/to/happy.html Are You Happy? 8000 800 =================================== /happy.php HAPPY CHECK! 7000 700 =================================== ......
Rails ã§ä½¿ãå ´å
Ruby on Rails
ã§ç¨ããå ´åã«ç¹å¥ãªãã¨ã¯å¿
è¦ããã¾ãããGemfile
ã«è¿½å ã㦠$ bundle install
ããã°ããã ãã§ããè¨å®ãã¡ã¤ã«ã®ä½ç½®ã¯ããã©ã«ãããå¤æ´ããã»ããã¹ãã¼ãã«ãªãããã§ãã
TODO
- ãåå¾ããããã¼ã¿ã®æ¡ä»¶ãè¨è¼ããè¨å®ãã¡ã¤ã«ãã®ä¸ã«è¨è¼ããããããã¡ã¤ã«ãï¼ãã¥ã¼ï¼ã®æå®ã¯ãç¾å¨ã¯ããããã¡ã¤ã«åï¼ãã¥ã¼åï¼ãã§ããæå®ã§ãã¾ãã
- ãããã¡ã¤ã«IDï¼ãã¥ã¼IDï¼ã§ãæå®ã§ããããã«ãã
- ã¯ã¨ãªãã©ã¡ã¼ã¿ä¸ã®ä»¥ä¸ã®3ã¤ã«ã¤ãã¦ã¯è¨å®ãã¾ã ã§ãã¦ããªã
- offset
- quota_user
- segment_id
- ãã ããã»ã°ã¡ã³ããã®å
容ã¯å®è³ªçã«ã¯ãã£ã«ã¿ããããå ´åã¨åä¸ã§ããã®ã§ããã£ã«ã¿ãç¨ããã°ã»ã°ã¡ã³ãã¨åçã®å¦çã¯å®ç¾ã§ãã¾ã
- ã³ã¼ããã¼ã¹ã§ç®¡çã§ãããã¨ãèããã¨ããã¡ãã®æ¹ãè¯ãããã«æãã¾ã
- ãã ããã»ã°ã¡ã³ããã®å
容ã¯å®è³ªçã«ã¯ãã£ã«ã¿ããããå ´åã¨åä¸ã§ããã®ã§ããã£ã«ã¿ãç¨ããã°ã»ã°ã¡ã³ãã¨åçã®å¦çã¯å®ç¾ã§ãã¾ã
å ¬å¼ããã¥ã¡ã³ãä¸è¦§
- Core Reporting API - Reference Guide
- Dimensions & Metrics Explorer
- Query Explorer
- API Rate Limits
åèæ¸ç±
Google Analytics ã®ç¨èªã®æå³ãåºæ¬çãªæä½æ¹æ³ãå®åã«ä½¿ãéã®å ·ä½çãªèãæ¹ãªã©ã«ã¤ãã¦ã¯ãããã°ã¡ããã¨å¦ã¶ Googleã¢ããªãã£ã¯ã¹ãã大å¤ã«åãããããã§ãã
èè ã®æ¹å·ããããã¯ãããã°ã¡ããã¨å¦ã¶ Git使ãæ¹å ¥éãã®èä½ã§ãæåã§ãããããã®èä½ã«ããã¦ãèªè ã®è¦ç¹ã大åã«ããå 容ã«ãªã£ã¦ãã¦ãèªå·±æºè¶³ã«çµãã£ã¦ããªã*8ã¨ãããç´ æ´ãããã¨æãã¾ãã
ä½è«
gem ãä½ãããã«è²»ãããæéãããããã¥ã¡ã³ãï¼ãã®è¨äºãï¼ãæ¸ãããã«è²»ãããæéã®æ¹ãé·ãã£ãã§ããâ¦â¦ã
*1:Legato ã®å身ã¨ã㦠Garb ã¨ãã gem ãããã¾ã
*2:æ¸ãã®ã«ãã¡ããã¡ãæéãããã£ãâ¦â¦
*3:ãã®çç±ã«ã¤ãã¦ã¯è©³ãã調ã¹ã¦ããªãã§ã
*4:ããã¯ä¿®æ£ããã
*5:ãã©ã¹è¨å·ãã¤ããã¨ã¨ã©ã¼ã«ãªãã®ã§æ³¨æãã¦ä¸ãã
*6:ã¤ã±ã¦ãªãä»æ§ã§ã¯ããã®ã§ããã®ãã¡ç´ãã¾ã
*7:$ gem install simple_ga_reporting ã¾ã㯠Gemfile ã« gem 'simple_ga_reporting' ã¨è¨è¼ã®ä¸ã§ $ bundle install
*8:åãè½ã¨ãã¨ããã¯åãè½ã¨ã