{"id":5905,"date":"2022-05-25T20:06:00","date_gmt":"2022-05-25T11:06:00","guid":{"rendered":"https:\/\/auto-worker.com\/blog\/?p=5905"},"modified":"2023-02-02T09:08:42","modified_gmt":"2023-02-02T00:08:42","slug":"post-5905","status":"publish","type":"post","link":"https:\/\/auto-worker.com\/blog\/?p=5905","title":{"rendered":"GAS\u3067GA4\u306eAPI\u306e\u4f7f\u3044\u65b9\uff01\u7c21\u5358\u306bGA4\u6307\u6a19\u6570\u5024\u304c\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u89e3\u8aac"},"content":{"rendered":"\n<p>Google Apps Script\u3067\u8ffd\u52a0\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u306bGA4\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u300cGoogle Analytics Data API\u300d\u304c\u767b\u5834\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">\u3053\u308c\u307e\u3067\u306fGCP\u306eAPI\u8a2d\u5b9a\u306a\u3069\u8907\u96d1\u3067\u3057\u305f\u304c\u3001GAS\u306e\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u3067\u30ab\u30f3\u30bf\u30f3\u306bGA4\u306eAPI\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/span><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Goolge Apps Script\u3067GA4\u306eAPI\u304b\u3089\u305f\u3063\u305f\u201d3\u5206\u201d\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\uff01GCP\u306e\u8a2d\u5b9a\u4e0d\u8981\u3067Analytics Data API\u3092GAS\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u5b9f\u884c\u3059\u308b\u624b\u9806\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Yd1997LhYQ8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">GA4\u7528API\u300cGoogle Analytics Data API\u300d<\/h2>\n\n\n\n<p>GA4\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3059\u308b\u5834\u5408\u306b\u3001API(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30fb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9)\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5f93\u6765\u306eGoogle Analytics(\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9)\u3067\u3082API\u7d4c\u7531\u3067\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u306fGA4\u3068\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u3067\u306fAPI\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>GA4\u7528\u306eAPI\u306f\u300cGoogle Analytics Data API\u300d\u3068\u3044\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"518\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002.jpg\" alt=\"\u30b0\u30fc\u30b0\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b94(GA4)\u7528\u300cGoogle Analytics Data API \u300d\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u30e1\u30bd\u30c3\u30c9\u306f6\u7a2e\u985e\" class=\"wp-image-3253\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002.jpg 1000w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-300x155.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-768x398.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-530x275.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-565x293.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-710x368.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/04\/20210418_auto_002-725x376.jpg 725w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>2021\u5e74\u6625\u306bGA4\u7528\u306eAPI\u306e\u30d9\u30fc\u30bf\u7248\u304c\u767b\u5834\u3057\u3001GA4\u3067\u53ce\u96c6\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092API\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u53d6\u308a\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5143\u3005\u3001GA4\u306eAPI\u306fGCP\u3067\u6709\u52b9\u5316\u30fb\u6a29\u9650\u8a2d\u5b9a\u304c\u7169\u96d1<\/h2>\n\n\n\n<p>\u305f\u3060\u3001\u5143\u3005\u3001\u3053\u306eGA4\u306eAnalytics Data API\u3092\u4f7f\u3046\u306b\u306f\u3001Google Cloud Platfrom(GCP)\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u4e0a\u3067\u3001Google Apps Script(GAS)\u3067Analytics Data API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u305f\u3081\u306b\u3001GAS\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5074\u3067\u3082\u8a2d\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>GCP\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u767b\u9332<\/li><li>Google Analytics Data API\u6709\u52b9\u5316<\/li><li>API\u306e\u5b9f\u884c\u6a29\u9650\u30fb\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u8a2d\u5b9a<\/li><li>GAS\u30b9\u30af\u30ea\u30d7\u30c8\u3067GCP\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7d10\u3065\u3051<\/li><li>\u30de\u30cb\u30e5\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30ebappsscript.json\u4fee\u6b63<\/li><\/ol>\n\n\n\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306aGCP\u3068GAS\u3067\u305d\u308c\u305e\u308c\u8a2d\u5b9a\u3092\u65bd\u3057\u305f\u4e0a\u3067\u3001GA4 API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308bGAS\u30b3\u30fc\u30c9\u304c\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u203bGA4\u7528API(Analytics Data API)\u3092GAS\u304b\u3089\u5229\u7528\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u8a73\u7d30\u306b\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580 wp-block-embed-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"1HJkZ1VBp4\"><a href=\"https:\/\/auto-worker.com\/blog\/?p=3250\">GA4(\u30b0\u30fc\u30b0\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b94)\u306eAPI\u4f7f\u3044\u65b9\u89e3\u8aac\uff01GAS\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u7d39\u4ecb<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;GA4(\u30b0\u30fc\u30b0\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b94)\u306eAPI\u4f7f\u3044\u65b9\u89e3\u8aac\uff01GAS\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u7d39\u4ecb&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=3250&#038;embed=true#?secret=EiUHFHZcDq#?secret=1HJkZ1VBp4\" data-secret=\"1HJkZ1VBp4\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u3068\u547c\u3070\u308c\u308b\u5f93\u6765\u306e\u30b0\u30fc\u30b0\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u3088\u308a\u3082\u3001GAS\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306e\u304c\u8907\u96d1\u3067\u5927\u5909\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GA4\u306eAPI\u304cGAS\u306e\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u304c\u53ef\u80fd\u306b\uff01<\/h2>\n\n\n\n<p>\u305d\u3093\u306a\u4e2d\u3001GA4\u7528\u306e\u300cGoogle Analytics Data API\u300d\u304cGoogle Apps Script\u3067\u8ffd\u52a0\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u5f93\u6765\u7248Google Analytics(\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9)\u3068\u540c\u69d8\u306b\u3001GAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u4e00\u89a7\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"420\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010.jpg\" alt=\"Google Apps Script\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u304b\u3089GA4\u7528\u306eAPI\u300cGoogle Analytics Data API\u300d\u304c\u8ffd\u52a0\u3057\u3066GAS\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u5b9f\u884c\u53ef\u80fd\u306b\" class=\"wp-image-5916\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-300x158.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-768x403.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-530x278.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-565x297.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-710x373.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_010-725x381.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u306b\u3088\u3063\u3066\u3001Google Apps Script\u306e\u30b5\u30fc\u30d3\u30b9\u304b\u3089GA4\u306eAPI\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u3001API\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>GCP\u3067\u306eAPI\u6709\u52b9\u5316\u3084\u5b9f\u884c\u6a29\u9650\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u306a\u304f\u306a\u308a\u3001\u3068\u3066\u3082\u30ab\u30f3\u30bf\u30f3\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GA4\u306eAPI\u3092GAS\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u3067\u5229\u7528\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u5b9f\u969b\u306bGoogle Apps Script(GAS)\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089Google Analytics Data API\u3092\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u3057\u3066\u3001GA4\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\uff11\uff0eGoogle Apps Script\u3067\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u958b\u304d\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u300c+\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"408\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001.jpg\" alt=\"Google Apps Script(GAS)\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u304b\u3089GA4\u306eAPI\u300cGoogle Analytics Data API\u300d\u3092\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u3057\u3066GA4\u306e\u6307\u6a19\u6570\u5024\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\" class=\"wp-image-5906\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-768x392.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-530x270.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-565x288.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-710x362.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_001-725x370.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\uff12\uff0e\u300c\u30b5\u30fc\u30d3\u30b9\u3092\u8ffd\u52a0\u300d\u753b\u9762\u3067\u3001\u300cGoogle Analytics Data API\u300d\u3092\u9078\u629e\u3057\u3066\u3001\u8ffd\u52a0\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"610\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002.jpg\" alt=\"Google Apps Script(GAS)\u306e\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u308b\u300cGoogle Analytics Data API\u300d\u3092\u9078\u629e\u3057\u3066\u8ffd\u52a0\" class=\"wp-image-5907\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002.jpg 1200w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-1024x521.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-768x390.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-530x269.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-565x287.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-710x361.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_002-725x369.jpg 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>\u30b5\u30fc\u30d3\u30b9\u6b04\u306e\u4e0b\u306b\u300cAnalyticsData\u300d\u3068\u3044\u3046\u8868\u793a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\uff13\uff0e\u30b0\u30fc\u30b0\u30eb\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306bAnalyticsData\u3092\u4f7f\u3063\u3066GA4\u306e\u6307\u6a19\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u63b2\u8f09\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"412\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003.jpg\" alt=\"Google Apps Script\u3067\u306eGoogle Analytics Data API(AnalyticsData)\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30da\u30fc\u30b8\" class=\"wp-image-5908\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-300x155.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-768x396.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-530x273.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-565x291.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-710x366.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_003-725x373.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/developers.google.com\/apps-script\/advanced\/analyticsdata\" target=\"_blank\" rel=\"noopener\">Analytics Data Service(Apps Script)\u3010Google Developers\u3011<\/a><\/p>\n\n\n\n<p>\uff14\uff0e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30da\u30fc\u30b8\u3092\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\u3068\u3001analyticsData.gs\u3068\u3044\u3046\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"413\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004.jpg\" alt=\"Google Apps Script\u3067GA4\u306eAPI\u3092\u5b9f\u884c\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u30b0\u30fc\u30b0\u30eb\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u63b2\u8f09\" class=\"wp-image-5909\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-300x155.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-768x396.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-530x274.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-565x292.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-710x367.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_004-725x374.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\uff15\uff0eGAS\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u304b\u3089\u30b3\u30d4\u30fc\u3057\u3066\u304d\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092GAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-javascript\"><code class=\"language-javascript\">\/**\n * Runs a report of a Google Analytics 4 property ID. Creates a sheet with the\n * report.\n *\/\nfunction runReport() {\n  \/**\n   * TODO(developer): Uncomment this variable and replace with your\n   *   Google Analytics 4 property ID before running the sample.\n   *\/\n  const propertyId = 'YOUR-GA4-PROPERTY-ID';\n\n  try {\n    const metric = AnalyticsData.newMetric();\n    metric.name = 'activeUsers';\n\n    const dimension = AnalyticsData.newDimension();\n    dimension.name = 'city';\n\n    const dateRange = AnalyticsData.newDateRange();\n    dateRange.startDate = '2020-03-31';\n    dateRange.endDate = 'today';\n\n    const request = AnalyticsData.newRunReportRequest();\n    request.dimensions = [dimension];\n    request.metrics = [metric];\n    request.dateRanges = dateRange;\n\n    const report = AnalyticsData.Properties.runReport(request,\n        'properties\/' + propertyId);\n    if (!report.rows) {\n      Logger.log('No rows returned.');\n      return;\n    }\n\n    const spreadsheet = SpreadsheetApp.create('Google Analytics Report');\n    const sheet = spreadsheet.getActiveSheet();\n\n    \/\/ Append the headers.\n    const dimensionHeaders = report.dimensionHeaders.map(\n        (dimensionHeader) => {\n          return dimensionHeader.name;\n        });\n    const metricHeaders = report.metricHeaders.map(\n        (metricHeader) => {\n          return metricHeader.name;\n        });\n    const headers = [...dimensionHeaders, ...metricHeaders];\n\n    sheet.appendRow(headers);\n\n    \/\/ Append the results.\n    const rows = report.rows.map((row) => {\n      const dimensionValues = row.dimensionValues.map(\n          (dimensionValue) => {\n            return dimensionValue.value;\n          });\n      const metricValues = row.metricValues.map(\n          (metricValues) => {\n            return metricValues.value;\n          });\n      return [...dimensionValues, ...metricValues];\n    });\n\n    sheet.getRange(2, 1, report.rows.length, headers.length)\n        .setValues(rows);\n\n    Logger.log('Report spreadsheet created: %s',\n        spreadsheet.getUrl());\n  } catch (e) {\n    \/\/ TODO (Developer) - Handle exception\n    Logger.log('Failed with error: %s', e.error);\n  }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"410\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005.jpg\" alt=\"AnalyticsData\u30b5\u30fc\u30d3\u30b9\u306eGoogle Apps Script\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30da\u30fc\u30b8\u304b\u3089GA4\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\" class=\"wp-image-5910\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-300x154.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-768x394.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-530x272.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-565x290.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-710x364.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_005-725x372.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u203b\u8d64\u67a0\u306e\u30b3\u30e1\u30f3\u30c8\u90e8\u5206\u306b10\u884c\u76ee\u306b\u3042\u308b\u300cpropertyId\u300d\u3092\u81ea\u5206\u306eGA4\u30d7\u30ed\u30d1\u30c6\u30a3\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\uff16\uff0eGoogle Analytics\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001GAS\u3067\u53d6\u5f97\u3057\u305f\u3044GA4\u30d7\u30ed\u30d1\u30c6\u30a3\u306eID\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"400\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_006.jpg\" alt=\"Google Analytics\u306e\u30b5\u30fc\u30d3\u30b9\u753b\u9762\u3067GA4\u306e\u30d7\u30ed\u30d1\u30c6\u30a3ID\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\" class=\"wp-image-5911\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_006.jpg 600w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_006-300x200.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_006-530x353.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_006-565x377.jpg 565w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>\uff17\uff0e\u78ba\u8a8d\u3057\u305fGA4\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306eID(\u6570\u5b579\u6841)\u306b\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e10\u884c\u76ee\u306b\u3042\u308bpropertyId\u3092\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"409\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007.jpg\" alt=\"GA4\u306e\u30d7\u30ed\u30d1\u30c6\u30a3Id\u3092\u78ba\u8a8d\u3057\u3001propertyId\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067Google Apps Script\u3067\u81ea\u5206\u306eGA4\u306e\u5024\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\" class=\"wp-image-5912\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-768x393.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-530x271.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-565x289.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-710x363.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_007-725x371.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0a\u3067\u3001GA4\u7528\u306eGoogle Analytics Data API\u306e\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u304b\u3089\u3001GA4\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n<p>GA4\u306e\u6307\u6a19(\u30e1\u30c8\u30ea\u30af\u30b9)\u3068\u3057\u3066\u30a2\u30af\u30c6\u30a3\u30d6\u30e6\u30fc\u30b6\u30fc\u6570\u3092\u3001\u90fd\u5e02\u3068\u3044\u3046\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>GAS\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u3067runReport\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5b9f\u884c\u30ed\u30b0\u306b\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eURL\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"407\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008.jpg\" alt=\"Google Apps Script(GAS)\u3067GA4\u306eAPI(Google Analytics Data API)\u3092\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u5b9f\u884c\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\" class=\"wp-image-5913\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-768x391.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-530x270.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-565x287.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-710x361.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_008-725x369.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eURL\u3092\u30b3\u30d4\u30da\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001GA4\u304b\u3089\u62bd\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"410\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009.jpg\" alt=\"Google Apps Script(GAS)\u306eGA4\u30b5\u30fc\u30d3\u30b9\u3092\u8ffd\u52a0\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001GA4\u306e\u6307\u6a19\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3057\u305f\u7d50\u679c\" class=\"wp-image-5914\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-300x154.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-768x394.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-530x272.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-565x290.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-710x364.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/05\/20220525_auto_009-725x372.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u958b\u59cb\u65e5\u30fb\u7d42\u4e86\u65e5\u306e\u6307\u5b9a\u3055\u308c\u305f\u671f\u9593\u3067\u306e\u90fd\u5e02\u5358\u4f4d\u3067\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u30e6\u30fc\u30b6\u30fc\u6570\u304c\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8a18\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d5\u30a3\u30eb\u30bf\u3067\u7d5e\u308a\u8fbc\u307f\u3057\u305f\u3044\u5834\u5408<\/h2>\n\n\n\n<p>GA4\u304b\u3089\u5404\u7a2e\u6307\u6a19\u30fb\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u306e\u6570\u5024\u3092\u62bd\u51fa\u3059\u308b\u5834\u5408\u3001\u4e00\u5b9a\u306e\u6761\u4ef6\u306b\u7d5e\u308a\u8fbc\u3080\u30d5\u30a3\u30eb\u30bf\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>Google Apps Script(GAS)\u304b\u3089GA4\u306eAPI\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u969b\u306b\u3082\u3001\u30d5\u30a3\u30eb\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>GA4\u306e\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u3092\u884c\u3046GAS\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580 wp-block-embed-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"tXxDn2JMNW\"><a href=\"https:\/\/auto-worker.com\/blog\/?p=7078\">GAS\u3067GA4\u306eAPI\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u65b9\u6cd5\u3092\u89e3\u8aac\uff01(\u6587\u5b57\u5217\u30fb\u6570\u5024\u30d5\u30a3\u30eb\u30bf\u306e\u30b3\u30fc\u30c9\u4ed8\u304d)<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;GAS\u3067GA4\u306eAPI\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u65b9\u6cd5\u3092\u89e3\u8aac\uff01(\u6587\u5b57\u5217\u30fb\u6570\u5024\u30d5\u30a3\u30eb\u30bf\u306e\u30b3\u30fc\u30c9\u4ed8\u304d)&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=7078&#038;embed=true#?secret=7dp3dOb1mB#?secret=tXxDn2JMNW\" data-secret=\"tXxDn2JMNW\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u6307\u6a19\u3084\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u306b\u6bd4\u3079\u3001\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u306f\u96e3\u3057\u3044\u3067\u3059\u304c\u3001\u4f7f\u3048\u308b\u3068\u3088\u308a\u8a73\u7d30\u306a\u30c7\u30fc\u30bf\u5206\u6790\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30e1\u30c8\u30ea\u30af\u30b9\u3084\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u306e\u628a\u63e1\u304c\u91cd\u8981<\/h2>\n\n\n\n<p>GA4\u306e\u8272\u3005\u306a\u6307\u6a19\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u3068\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u628a\u63e1\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3088\u304f\u4f7f\u3046\u30e1\u30c8\u30ea\u30af\u30b9\u3068\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3068\u3057\u3066\u306f\u3053\u3046\u3044\u3063\u305f\u3082\u306e\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u25cb\u30e1\u30c8\u30ea\u30af\u30b9<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>activeUsers(\u30e6\u30fc\u30b6\u30fc)<\/li><li>newUsers(\u65b0\u898f\u30e6\u30fc\u30b6\u30fc)<\/li><li>sessions(\u30bb\u30c3\u30b7\u30e7\u30f3)<\/li><li>screenPageViews(PV)<\/li><li>bounceRate(\u96e2\u8131\u7387)<\/li><li>engagedSessions<\/li><\/ul>\n\n\n\n<p><strong>\u25cb\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>pageTitle<\/li><li>sourceMedium<\/li><li>campaignName<\/li><li>deviceCategory<\/li><li>userGender<\/li><li>userAgeBracket<\/li><\/ul>\n\n\n\n<p>\u305d\u306e\u4ed6\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3068\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u8abf\u3079\u305f\u3044\u5834\u5408\u306f<a href=\"https:\/\/ga-dev-tools.web.app\/ga4\/query-explorer\/\" target=\"_blank\" rel=\"noopener\">Query Explorer<\/a>\u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u3067\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30ec\u30dd\u30fc\u30c8\u3084\u30d4\u30dc\u30c3\u30c8\u30ec\u30dd\u30fc\u30c8\u3082<\/h2>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u30d9\u30fc\u30b7\u30c3\u30af\u306a\u901a\u5e38\u30ec\u30dd\u30fc\u30c8\u306e\u6570\u5024\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001GA4\u7528\u30b5\u30fc\u30d3\u30b9AnalyticsData\u306b\u306f\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30ec\u30dd\u30fc\u30c8\u3084\u30d4\u30dc\u30c3\u30c8\u30ec\u30dd\u30fc\u30c8\u3082\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30d4\u30dc\u30c3\u30c8\u30ec\u30dd\u30fc\u30c8\u306f\u4ed5\u7d44\u307f\u304c\u96e3\u3057\u3044\u3067\u3059\u304c\u3001\u8907\u5408\u7684\u306a\u30c7\u30fc\u30bf\u96c6\u8a08\u304c\u53ef\u80fd\u3068\u306a\u308b\u305f\u3081\u3001\u4f7f\u3044\u3053\u306a\u3059\u3053\u3068\u3067\u3001\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30e1\u30c8\u30ea\u30af\u30b9\u6307\u6a19\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u3067\u6761\u4ef6\u3092\u7d5e\u3063\u305f\u30c7\u30fc\u30bf\u53d6\u5f97<\/h2>\n\n\n\n<p>Google Apps Script(GAS)\u3067GA4\u306eAPI\u3092\u5229\u7528\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001\u6307\u6a19\u3068\u30c7\u30a3\u30e1\u30f3\u30b7\u30e7\u30f3\u3001\u96c6\u8a08\u671f\u9593\u306e3\u3064\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u4ed6\u306b\u3001GA4\u306e\u63a2\u7d22\u30ec\u30dd\u30fc\u30c8\u3067\u8a2d\u5b9a\u3059\u308b\u30d5\u30a3\u30eb\u30bf\u3082GA4\u306eAPI\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u8a2d\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067GAS\u306eGA4\u7528API\u3067\u300c\u3007\u3007\u3092\u542b\u3080\u300d\u3084\u300c\u25a0\u4ee5\u4e0a\u306e\u6570\u5024\u300d\u3068\u3044\u3063\u305f\u30d5\u30a3\u30eb\u30bf\u6761\u4ef6\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580 wp-block-embed-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"tXxDn2JMNW\"><a href=\"https:\/\/auto-worker.com\/blog\/?p=7078\">GAS\u3067GA4\u306eAPI\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u65b9\u6cd5\u3092\u89e3\u8aac\uff01(\u6587\u5b57\u5217\u30fb\u6570\u5024\u30d5\u30a3\u30eb\u30bf\u306e\u30b3\u30fc\u30c9\u4ed8\u304d)<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;GAS\u3067GA4\u306eAPI\u30d5\u30a3\u30eb\u30bf\u8a2d\u5b9a\u65b9\u6cd5\u3092\u89e3\u8aac\uff01(\u6587\u5b57\u5217\u30fb\u6570\u5024\u30d5\u30a3\u30eb\u30bf\u306e\u30b3\u30fc\u30c9\u4ed8\u304d)&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=7078&#038;embed=true#?secret=7dp3dOb1mB#?secret=tXxDn2JMNW\" data-secret=\"tXxDn2JMNW\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u3092\u4f7f\u3044\u3053\u306a\u305b\u3070\u3001\u3088\u308a\u5206\u6790\u76ee\u7684\u306b\u6cbf\u3063\u305fGA4\u30ec\u30dd\u30fc\u30c8\u3092GAS\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\u30fb\u7d42\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u3001GA4\u306eAPI\u3067\u3042\u308b\u300cAnalytics Data API\u300d\u304cGoogle Apps Script\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306e\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u8ffd\u52a0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u5229\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u5143\u3005\u3001GA4\u306eAPI\u3092\u4f7f\u3046\u306b\u306fGCP\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3001GAS\u5074\u3067\u3082\u8272\u3005\u306a\u8abf\u6574\u304c\u5fc5\u8981\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001GAS\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u3001Google Analytics Data API\u304c\u767b\u5834\u3057\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u304b\u3089\u30b5\u30fc\u30d3\u30b9\u8ffd\u52a0\u3057\u3066\u30ab\u30f3\u30bf\u30f3\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>GA4\u306f\u30b5\u30fc\u30d3\u30b9\u304c\u7d42\u4e86\u3059\u308b\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u304b\u3089\u7f6e\u304d\u63db\u3048\u304c\u9032\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30e6\u30cb\u30d0\u30fc\u30b5\u30eb\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u306e\u30c7\u30fc\u30bf\u3092API\u7d4c\u7531\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3057\u3066\u3044\u305f\u5834\u5408\u306f\u3001\u4eca\u56de\u7d39\u4ecb\u3057\u305fGA4\u306eAPI\u3092GAS\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Apps Script\u3067\u8ffd\u52a0\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u306bGA4\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u300cGoogle Analytics Data API\u300d\u304c\u767b\u5834\u3057\u307e\u3057\u305f\u3002 \u3053\u308c\u307e\u3067\u306fGCP\u306eAPI\u8a2d\u5b9a\u306a\u3069\u8907\u96d1\u3067\u3057\u305f\u304c\u3001GAS\u306e\u30b5\u30fc\u30d3\u30b9\u8ffd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[853,2],"tags":[14,631,957],"class_list":["post-5905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ga4","category-gas","tag-gas","tag-google-analytics-data-api","tag-957"],"_links":{"self":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5905"}],"version-history":[{"count":7,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5905\/revisions"}],"predecessor-version":[{"id":7222,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5905\/revisions\/7222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/5907"}],"wp:attachment":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}