Data Connector for Google Analytics Reporting å¾¹åºè§£èª¬ ãã®ï¼
æ¬è¨äºã¯ç§»è»¢ãã¾ãããæ°ãµã¤ãã«ãªãã¤ã¬ã¯ããã¾ãã
"); // ãªãã¤ã¬ã¯ã ããsetTimeout("redirect()", 0);ã// 0 sec ããfunction redirect(){ ãã ãlocation.href = url; ãã} ã ã// canonical ã®æ¸ãæã ããvar link = document.getElementsByTagName("link")[0]; ããlink.href = url; -->ååã¾ã§
2. Google APIs ä¸ã§ã®è¨å®
2-1. ãã°ã¤ã³
â é©å㪠Google ã¢ã«ã¦ã³ã㧠Google APIs ã«ãã°ã¤ã³ãã¾ãããé©åãªã¢ã«ã¦ã³ããã¨ã¯ï¼åå¾ããã Google Analytics ã« API ãéãã¦ã¢ã¯ã»ã¹ãããã¨ã許ããã¦ããã¢ã«ã¦ã³ããæå³ãã¾ãã
2-2. ããã¸ã§ã¯ãã®ä½æ
2-2-1. Project æ°è¦ä½æ
â Projects ãã¿ã³ãããCreate projectããé¸æãï¼Data Connector ã§å©ç¨ããããã®ããã¸ã§ã¯ããä½æãã¾ãã
â ä»åã¯ãGA to TDãã¨ããããã¸ã§ã¯ãåãä¸ãã¦ãã¾ãã
2-2-2. Service Account ã®æ°è¦ä½æ
以ä¸ï¼ãGA to TDãããã¸ã§ã¯ãä¸ã§è¨å®ãé²ãã¦è¡ãã¾ãã
â ã¾ãã¯ãService Accountããæ°è¦ä½æãã¾ãããã®ã¢ã«ã¦ã³ãã¯å¾ã»ã© GA ã¸ã® API ã«ããã¢ã¯ã»ã¹ã許å¯ããã¢ã«ã¦ã³ãã¨ãã¦å©ç¨ããã¾ãããã®ãServiceãã¢ã«ã¦ã³ãã¯ï¼ç¹å®ã®ããã¸ã§ã¯ãå ã§ä½æãããã¢ã«ã¦ã³ãã§ããï¼Google APIs ã«ãã°ã¤ã³ããä¸è¬ã® Google ã¢ã«ã¦ã³ãã¨ã¯ç°ãªãæ¦å¿µã®ãã®ã§ãã
â ä»åã¯ãtreasure-dataãã¨ãããµã¼ãã¹ã¢ã«ã¦ã³ããä½æãã¾ãããªãã·ã§ã³ã®é¸æè¢ã¯ã©ã¡ããæå®ãã¦ããã¾ãããCreateããã¿ã³ãæ¼ãã¨ï¼æ¬ãµã¼ãã¹ã¢ã«ã¦ã³ãã«ãããèªè¨¼æ å ±ã JSON ãã¡ã¤ã«ï¼ä»åã®ä¾ã§ã¯ GA to TD-18f4c65b19b3.json ã¨ããååï¼ã¨ãã¦ãã¦ã³ãã¼ãããã¾ãã
â ãã®JSONãã¡ã¤ã«ã® private key æ å ±ã¯å¾ã® Embulk ã®è¨å®ãã¡ã¤ã«å ã§ããã£ã¨å©ç¨ããã®ã§å¤§åã«ä¿ç®¡ããããã«ãã¦ãã ããã
â ã¾ãï¼åæã«ã[email protected]ãã¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãIDãä½æããã¾ããå¾ã® GA ã®ç®¡çç»é¢ã§ï¼ãã® ID ã« API ã¢ã¯ã»ã¹è¨±å¯ã®æ¨©éãä¸ãããã¨ã«ãªãã¾ãã
2-3. 使ç¨ãã Analytics API ãæå¹ã«ãã
2-3-1. API ã®æ¤ç´¢
â 次ã«ãã®ããã¸ã§ã¯ãã§ä½¿ç¨ãã API ãæå¹ã«ãã¦ããã¾ããä»å㯠GA ã«é¢ä¿ãã2ã¤ã®APIãç»é²ãã¾ãã
ãLibraryãã®æ¤ç´¢ãã¼ãã
- Analytics API
- Analytics Reporting API V4
ãæ¤ç´¢ãï¼ãã®2ã¤ãæå¹ã«ãã¾ãã
2-3-2. API ã®æå¹å
â ããããã® API ãªã³ã¯ã«å ¥ã£ã¦ãã® API ããEnableãã«ãã¾ãã
â API ãæå¹ã«ããã¨ï¼ãDashboardãã¡ãã¥ã¼ããï¼ç»é²ããã APIãä¸è¦§ã§åç §ãããã¨ãã§ãï¼ã㤠API ã®ã¢ãã¿ãªã³ã°ããã®æç¹ããéå§ããã¾ãã
2-4. çµããã«
Google APIs ã§è¨å®ããé ç®ã«ã¤ãã¦ç´¹ä»ãã¾ããã次ã«ãã®ä½æãããµã¼ãã¹ã¢ã«ã¦ã³ãIDã§ï¼åå¾å¯¾è±¡ã®Google Analytics ã®ãã¼ã¿ã«ã¢ã¯ã»ã¹ã§ããããã«ï¼æ¨©éã追å ãã¦ããã¾ãã
Â