{"id":59,"date":"2021-09-17T15:23:55","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=59"},"modified":"2021-09-17T15:23:55","modified_gmt":"1970-01-01T00:00:00","slug":"post-59","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=59","title":{"rendered":"Swift\u3067Google Analytics\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5(\u610f\u5916\u3068\u7c21\u5358\uff01)"},"content":{"rendered":"<p>iTunes Connect\u3067\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u304c\u3067\u304d\u305f\u3068\u306f\u3044\u3048\u3001<\/p>\n<p><strong>Google Analytics<\/strong>\u306e\u307b\u3046\u304c\u60c5\u5831\u3082\u591a\u304f\u3001\u6163\u308c\u89aa\u3057\u3093\u3067\u3044\u308b\u4eba\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Swift<\/strong>\u3067iOS\u30a2\u30d7\u30ea\u306b<strong>Google \u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9<\/strong>\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3059\u308b\u3088\uff01<\/p>\n<p>\u305f\u3076\u309310\u5206\u3082\u3042\u308c\u3070\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>Google Analytics\u3092Swift\u3067\u5c0e\u5165\u3059\u308b\u624b\u9806<\/h2>\n<p>\u524d\u63d0:\u00a0<a href=\"https:\/\/www.google.com\/intl\/ja_jp\/analytics\/\" target=\"_blank\">Google Analytics<\/a>\u306e\u767b\u9332\u306f\u6e08\u3093\u3067\u3044\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>1.\u00a0<a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/ios\/v3\/sdk-download?hl=ja#download_sdk\" target=\"_blank\">Google Developers<\/a>\u306e\u30b5\u30a4\u30c8\u3067GoogleAnalyticsServicesiOS_3.13.zip (\u73fe\u6642\u70b9\u3067\u306f3.13)\u3092DL\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>2. \u89e3\u51cd\u3055\u308c\u305f\u4e2d\u306eGoogleAnalytics\/Library\u30d5\u30a9\u30eb\u30c0\u306e\u4ee5\u4e0b\u306e10\u30d5\u30a1\u30a4\u30eb\u3092\u5bfe\u8c61\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u30b3\u30d4\u30fc(\u30c9\u30e9\u30c3\u30b0&amp;\u30c9\u30ed\u30c3\u30d7)\u3059\u308b\u3002(Target\u3092\u52a0\u3048\u308b\u306e\u3092\u5fd8\u308c\u305a\u306b<\/p>\n<ul>\n<li>GAI.h<\/li>\n<li>GAIDictionaryBuilder.h<\/li>\n<li>GAIEcommerceFields.h<\/li>\n<li>GAIEcommerceProduct.h<\/li>\n<li>GAIEcommerceProductAction.h<\/li>\n<li>GAIEcommercePromotion.h<\/li>\n<li>GAIFields.h<\/li>\n<li>GAILogger.h<\/li>\n<li>GAITrackedViewController.h<\/li>\n<li>GAITracker.h<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>3. \u89e3\u51cd\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306e\u76f4\u4e0b\u306b\u3042\u308b\u3001libAdIdAccess.a\u3082\u30b3\u30d4\u30fc\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>4. \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e -&gt; TARGETS -&gt; General -&gt; Linked Frameworks and Libraries\u306b\u4ee5\u4e0b\u306e5\u3064\u3092\u8ffd\u52a0\u3002<\/p>\n<ul>\n<li>CoreData.framework<\/li>\n<li>SystemConfiguration.framework<\/li>\n<li>libz.dylib<\/li>\n<li>libsqlite3.dylib<\/li>\n<li>libGoogleAnalyticsServices.a (\u81ea\u52d5\u3067\u8ffd\u52a0\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>5. File -&gt; New -&gt; File\u304b\u3089Cocoa Touch Class\u3092\u9078\u629e\u3057\u3066\u3001\u540d\u524d\u3092hogeViewController\u3001Language\u3092Objective-C\u306b\u5909\u66f4\u3057\u3066\u4f5c\u6210\u3057\u3001Bridge-Header\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>6. Bridge-Header\u4ee5\u5916\u306f\u5fc5\u8981\u306a\u3044\u306e\u3067\u30015. \u3067\u3067\u304d\u305f2\u30d5\u30a1\u30a4\u30eb\u3092\u6d88\u53bb\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>7. (\u305f\u3076\u3093\u30d5\u30a9\u30eb\u30c0\u4e00\u89a7\u306e\u4e00\u756a\u4e0b)\u306b[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d]-Bridging-Header.h\u304c\u3042\u308b\u306e\u3067\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002<\/p>\n<pre class=\"toolbar-overlay:false lang:objc decode:true \">#import \"GAI.h\"\r\n#import \"GAIDictionaryBuilder.h\"\r\n#import \"GAIEcommerceFields.h\"\r\n#import \"GAIEcommerceProduct.h\"\r\n#import \"GAIEcommerceProductAction.h\"\r\n#import \"GAIEcommercePromotion.h\"\r\n#import \"GAIFields.h\"\r\n#import \"GAILogger.h\"\r\n#import \"GAITrackedViewController.h\"\r\n#import \"GAITracker.h\"<\/pre>\n<p>&nbsp;<\/p>\n<p>8. \u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3057\u305f\u3044\u5834\u6240\u306b\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3002<\/p>\n<pre class=\"toolbar-overlay:false lang:swift decode:true \">GAI.sharedInstance().trackerWithTrackingId(\"UA-xxxxxx-x\")\r\n\r\nvar tracker = GAI.sharedInstance().defaultTracker\r\ntracker.set(kGAIScreenName, value: \"Google Analytics\u8868\u793a\u540d\")\r\nvar params = GAIDictionaryBuilder.createScreenView().build() as [NSObject : AnyObject]\r\ntracker.send(params)<\/pre>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3067\u5b8c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Google Analytics\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30b5\u30de\u30ea\u30fc\u3067\u3001\u3057\u3063\u304b\u308a\u3068\u30a2\u30af\u30bb\u30b9\u304c\u98db\u3093\u3067\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u307e\u305b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u624b\u9806\u306f\u82e5\u5e72\u3042\u308b\u3051\u3069\u3001\u30a8\u30e9\u30fc\u3082\u8d77\u304d\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u5272\u3068\u304b\u3093\u305f\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3088\u304b\u3063\u305f\u3088\u304b\u3063\u305f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iTunes Connect\u3067\u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9\u304c\u3067\u304d\u305f\u3068\u306f\u3044\u3048\u3001 Google Analytics\u306e\u307b\u3046\u304c\u60c5\u5831\u3082\u591a\u304f\u3001\u6163\u308c\u89aa\u3057\u3093\u3067\u3044\u308b\u4eba\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002 &nbsp; Swift\u3067iOS\u30a2\u30d7\u30ea\u306bGoogle \u30a2\u30ca\u30ea\u30c6\u30a3\u30af\u30b9&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/59"}],"collection":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=59"}],"version-history":[{"count":5,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/59\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}