{"id":2192,"date":"2012-10-31T20:07:34","date_gmt":"2012-10-31T12:07:34","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=2192"},"modified":"2012-10-31T20:24:51","modified_gmt":"2012-10-31T12:24:51","slug":"%e7%bd%91%e7%ab%99%e7%bb%9f%e8%ae%a1%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e6%94%b6%e9%9b%86%e5%8e%9f%e7%90%86%e5%8f%8a%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/2192.html","title":{"rendered":"\u7f51\u7ad9\u7edf\u8ba1\u4e2d\u7684\u6570\u636e\u6536\u96c6\u539f\u7406\u53ca\u5b9e\u73b0"},"content":{"rendered":"<p>\u539f\u6587\uff1a<a href=\"http:\/\/www.codinglabs.org\/html\/how-web-analytics-data-collection-system-work.html\">http:\/\/www.codinglabs.org\/html\/how-web-analytics-data-collection-system-work.html<\/a><\/p>\n<p><span style=\"font-size: small;\">\u7f51\u7ad9\u6570\u636e\u7edf\u8ba1\u5206\u6790\u5de5\u5177\u662f\u7f51\u7ad9\u7ad9\u957f\u548c\u8fd0\u8425\u4eba\u5458\u7ecf\u5e38\u4f7f\u7528\u7684\u4e00\u79cd\u5de5\u5177\uff0c\u6bd4\u8f83\u5e38\u7528\u7684\u6709\u8c37\u6b4c\u5206\u6790\u3001\u767e\u5ea6\u7edf\u8ba1\u548c\u817e\u8baf\u5206\u6790\u7b49\u7b49\u3002\u6240\u6709\u8fd9\u4e9b\u7edf\u8ba1\u5206\u6790\u5de5\u5177\u7684\u7b2c\u4e00\u6b65\u90fd\u662f\u7f51\u7ad9\u8bbf\u95ee\u6570\u636e\u7684\u6536\u96c6\u3002\u76ee\u524d\u4e3b\u6d41\u7684\u6570\u636e\u6536\u96c6\u65b9\u5f0f\u57fa\u672c\u90fd\u662f\u57fa\u4e8ejavascript\u7684\u3002\u672c\u6587\u5c06\u7b80\u8981\u5206\u6790\u8fd9\u79cd\u6570\u636e\u6536\u96c6\u7684\u539f\u7406\uff0c\u5e76\u4e00\u6b65\u4e00\u6b65\u5b9e\u9645\u642d\u5efa\u4e00\u4e2a\u5b9e\u9645\u7684\u6570\u636e\u6536\u96c6\u7cfb\u7edf\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u6570\u636e\u6536\u96c6\u539f\u7406\u5206\u6790<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7b80\u5355\u6765\u8bf4\uff0c\u7f51\u7ad9\u7edf\u8ba1\u5206\u6790\u5de5\u5177\u9700\u8981\u6536\u96c6\u5230\u7528\u6237\u6d4f\u89c8\u76ee\u6807\u7f51\u7ad9\u7684\u884c\u4e3a\uff08\u5982\u6253\u5f00\u67d0\u7f51\u9875\u3001\u70b9\u51fb\u67d0\u6309\u94ae\u3001\u5c06\u5546\u54c1\u52a0\u5165\u8d2d\u7269\u8f66\u7b49\uff09\u53ca\u884c\u4e3a\u9644\u52a0\u6570\u636e\uff08\u5982\u67d0\u4e0b\u5355\u884c\u4e3a\u4ea7\u751f\u7684\u8ba2\u5355\u91d1\u989d\u7b49\uff09\u3002\u65e9\u671f\u7684\u7f51\u7ad9\u7edf\u8ba1\u5f80\u5f80\u53ea\u6536\u96c6\u4e00\u79cd\u7528\u6237\u884c\u4e3a\uff1a\u9875\u9762\u7684\u6253\u5f00\u3002\u800c\u540e\u7528\u6237\u5728\u9875\u9762\u4e2d\u7684\u884c\u4e3a\u5747\u65e0\u6cd5\u6536\u96c6\u3002\u8fd9\u79cd\u6536\u96c6\u7b56\u7565\u80fd\u6ee1\u8db3\u57fa\u672c\u7684\u6d41\u91cf\u5206\u6790\u3001\u6765\u6e90\u5206\u6790\u3001\u5185\u5bb9\u5206\u6790\u53ca\u8bbf\u5ba2\u5c5e\u6027\u7b49\u5e38\u7528\u5206\u6790\u89c6\u89d2\uff0c\u4f46\u662f\uff0c\u968f\u7740ajax\u6280\u672f\u7684\u5e7f\u6cdb\u4f7f\u7528\u53ca\u7535\u5b50\u5546\u52a1\u7f51\u7ad9\u5bf9\u4e8e\u7535\u5b50\u5546\u52a1\u76ee\u6807\u7684\u7edf\u8ba1\u5206\u6790\u7684\u9700\u6c42\u8d8a\u6765\u8d8a\u5f3a\u70c8\uff0c\u8fd9\u79cd\u4f20\u7edf\u7684\u6536\u96c6\u7b56\u7565\u5df2\u7ecf\u663e\u5f97\u529b\u4e0d\u80fd\u53ca\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u540e\u6765\uff0cGoogle\u5728\u5176\u4ea7\u54c1\u8c37\u6b4c\u5206\u6790\u4e2d\u521b\u65b0\u6027\u7684\u5f15\u5165\u4e86\u53ef\u5b9a\u5236\u7684\u6570\u636e\u6536\u96c6\u811a\u672c\uff0c\u7528\u6237\u901a\u8fc7\u8c37\u6b4c\u5206\u6790\u5b9a\u4e49\u597d\u7684\u53ef\u6269\u5c55\u63a5\u53e3\uff0c\u53ea\u9700\u7f16\u5199\u5c11\u91cf\u7684javascript\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0\u81ea\u5b9a\u4e49\u4e8b\u4ef6\u548c\u81ea\u5b9a\u4e49\u6307\u6807\u7684\u8ddf\u8e2a\u548c\u5206\u6790\u3002\u76ee\u524d\u767e\u5ea6\u7edf\u8ba1\u3001\u641c\u72d7\u5206\u6790\u7b49\u4ea7\u54c1\u5747\u7167\u642c\u4e86\u8c37\u6b4c\u5206\u6790\u7684\u6a21\u5f0f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5176\u5b9e\u8bf4\u8d77\u6765\u4e24\u79cd\u6570\u636e\u6536\u96c6\u6a21\u5f0f\u7684\u57fa\u672c\u539f\u7406\u548c\u6d41\u7a0b\u662f\u4e00\u81f4\u7684\uff0c\u53ea\u662f\u540e\u4e00\u79cd\u901a\u8fc7javascript\u6536\u96c6\u5230\u4e86\u66f4\u591a\u7684\u4fe1\u606f\u3002\u4e0b\u9762\u770b\u4e00\u4e0b\u73b0\u5728\u5404\u79cd\u7f51\u7ad9\u7edf\u8ba1\u5de5\u5177\u7684\u6570\u636e\u6536\u96c6\u57fa\u672c\u539f\u7406\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u6d41\u7a0b\u6982\u89c8<\/span><\/p>\n<p><span style=\"font-size: small;\">\u9996\u5148\u901a\u8fc7\u4e00\u5e45\u56fe\u603b\u4f53\u770b\u4e00\u4e0b\u6570\u636e\u6536\u96c6\u7684\u57fa\u672c\u6d41\u7a0b\u3002<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2195\" title=\"1\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/1.png\" alt=\"\" width=\"640\" height=\"300\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/1.png 640w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/1-300x140.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/1-250x117.png 250w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe1. \u7f51\u7ad9\u7edf\u8ba1\u6570\u636e\u6536\u96c6\u57fa\u672c\u6d41\u7a0b<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u9996\u5148\uff0c\u7528\u6237\u7684\u884c\u4e3a\u4f1a\u89e6\u53d1\u6d4f\u89c8\u5668\u5bf9\u88ab\u7edf\u8ba1\u9875\u9762\u7684\u4e00\u4e2ahttp\u8bf7\u6c42\uff0c\u8fd9\u91cc\u59d1\u4e14\u5148\u8ba4\u4e3a\u884c\u4e3a\u5c31\u662f\u6253\u5f00\u7f51\u9875\u3002\u5f53\u7f51\u9875\u88ab\u6253\u5f00\uff0c\u9875\u9762\u4e2d\u7684\u57cb\u70b9javascript\u7247\u6bb5\u4f1a\u88ab\u6267\u884c\uff0c\u7528\u8fc7\u76f8\u5173\u5de5\u5177\u7684\u670b\u53cb\u5e94\u8be5\u77e5\u9053\uff0c\u4e00\u822c\u7f51\u7ad9\u7edf\u8ba1\u5de5\u5177\u90fd\u4f1a\u8981\u6c42\u7528\u6237\u5728\u7f51\u9875\u4e2d\u52a0\u5165\u4e00\u5c0f\u6bb5javascript\u4ee3\u7801\uff0c\u8fd9\u4e2a\u4ee3\u7801\u7247\u6bb5\u4e00\u822c\u4f1a\u52a8\u6001\u521b\u5efa\u4e00\u4e2ascript\u6807\u7b7e\uff0c\u5e76\u5c06src\u6307\u5411\u4e00\u4e2a\u5355\u72ec\u7684js\u6587\u4ef6\uff0c\u6b64\u65f6\u8fd9\u4e2a\u5355\u72ec\u7684js\u6587\u4ef6\uff08\u56fe1\u4e2d\u7eff\u8272\u8282\u70b9\uff09\u4f1a\u88ab\u6d4f\u89c8\u5668\u8bf7\u6c42\u5230\u5e76\u6267\u884c\uff0c\u8fd9\u4e2ajs\u5f80\u5f80\u5c31\u662f\u771f\u6b63\u7684\u6570\u636e\u6536\u96c6\u811a\u672c\u3002\u6570\u636e\u6536\u96c6\u5b8c\u6210\u540e\uff0cjs\u4f1a\u8bf7\u6c42\u4e00\u4e2a\u540e\u7aef\u7684\u6570\u636e\u6536\u96c6\u811a\u672c\uff08\u56fe1\u4e2d\u7684backend\uff09\uff0c\u8fd9\u4e2a\u811a\u672c\u4e00\u822c\u662f\u4e00\u4e2a\u4f2a\u88c5\u6210\u56fe\u7247\u7684\u52a8\u6001\u811a\u672c\u7a0b\u5e8f\uff0c\u53ef\u80fd\u7531php\u3001python\u6216\u5176\u5b83\u670d\u52a1\u7aef\u8bed\u8a00\u7f16\u5199\uff0cjs\u4f1a\u5c06\u6536\u96c6\u5230\u7684\u6570\u636e\u901a\u8fc7http\u53c2\u6570\u7684\u65b9\u5f0f\u4f20\u9012\u7ed9\u540e\u7aef\u811a\u672c\uff0c\u540e\u7aef\u811a\u672c\u89e3\u6790\u53c2\u6570\u5e76\u6309\u56fa\u5b9a\u683c\u5f0f\u8bb0\u5f55\u5230\u8bbf\u95ee\u65e5\u5fd7\uff0c\u540c\u65f6\u53ef\u80fd\u4f1a\u5728http\u54cd\u5e94\u4e2d\u7ed9\u5ba2\u6237\u7aef\u79cd\u690d\u4e00\u4e9b\u7528\u4e8e\u8ffd\u8e2a\u7684cookie\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e0a\u9762\u662f\u4e00\u4e2a\u6570\u636e\u6536\u96c6\u7684\u5927\u6982\u6d41\u7a0b\uff0c\u4e0b\u9762\u4ee5\u8c37\u6b4c\u5206\u6790\u4e3a\u4f8b\uff0c\u5bf9\u6bcf\u4e00\u4e2a\u9636\u6bb5\u8fdb\u884c\u4e00\u4e2a\u76f8\u5bf9\u8be6\u7ec6\u7684\u5206\u6790\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u57cb\u70b9\u811a\u672c\u6267\u884c\u9636\u6bb5<\/span><\/p>\n<p><span style=\"font-size: small;\">\u82e5\u8981\u4f7f\u7528\u8c37\u6b4c\u5206\u6790\uff08\u4ee5\u4e0b\u7b80\u79f0GA\uff09\uff0c\u9700\u8981\u5728\u9875\u9762\u4e2d\u63d2\u5165\u4e00\u6bb5\u5b83\u63d0\u4f9b\u7684javascript\u7247\u6bb5\uff0c\u8fd9\u4e2a\u7247\u6bb5\u5f80\u5f80\u88ab\u79f0\u4e3a\u57cb\u70b9\u4ee3\u7801\u3002\u4e0b\u9762\u662f\u6211\u7684\u535a\u5ba2\u4e2d\u6240\u653e\u7f6e\u7684\u8c37\u6b4c\u5206\u6790\u57cb\u70b9\u4ee3\u7801\u622a\u56fe\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2196\" title=\"2\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/2.png\" alt=\"\" width=\"640\" height=\"111\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/2.png 640w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/2-300x52.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/2-250x43.png 250w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe2. \u8c37\u6b4c\u5206\u6790\u57cb\u70b9\u4ee3\u7801<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u5176\u4e2d_gaq\u662fGA\u7684\u7684\u5168\u5c40\u6570\u7ec4\uff0c\u7528\u4e8e\u653e\u7f6e\u5404\u79cd\u914d\u7f6e\uff0c\u5176\u4e2d\u6bcf\u4e00\u6761\u914d\u7f6e\u7684\u683c\u5f0f\u4e3a\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n_gaq.push(&#x5B;'Action', 'param1', 'param2', ...]);\r\n<\/pre>\n<p><span style=\"font-size: small;\">Action\u6307\u5b9a\u914d\u7f6e\u52a8\u4f5c\uff0c\u540e\u9762\u662f\u76f8\u5173\u7684\u53c2\u6570\u5217\u8868\u3002GA\u7ed9\u7684\u9ed8\u8ba4\u57cb\u70b9\u4ee3\u7801\u4f1a\u7ed9\u51fa\u4e24\u6761\u9884\u7f6e\u914d\u7f6e\uff0c_setAccount\u7528\u4e8e\u8bbe\u7f6e\u7f51\u7ad9\u6807\u8bc6ID\uff0c\u8fd9\u4e2a\u6807\u8bc6ID\u662f\u5728\u6ce8\u518cGA\u65f6\u5206\u914d\u7684\u3002_trackPageview\u544a\u8bc9GA\u8ddf\u8e2a\u4e00\u6b21\u9875\u9762\u8bbf\u95ee\u3002\u66f4\u591a\u914d\u7f6e\u8bf7\u53c2\u8003\uff1ahttps:\/\/developers.google.com\/analytics\/devguides\/collection\/gajs\/\u3002\u5b9e\u9645\u4e0a\uff0c\u8fd9\u4e2a_gaq\u662f\u88ab\u5f53\u505a\u4e00\u4e2aFIFO\u961f\u5217\u6765\u7528\u7684\uff0c\u914d\u7f6e\u4ee3\u7801\u4e0d\u5fc5\u51fa\u73b0\u5728\u57cb\u70b9\u4ee3\u7801\u4e4b\u524d\uff0c\u5177\u4f53\u8bf7\u53c2\u8003\u4e0a\u8ff0\u94fe\u63a5\u7684\u8bf4\u660e\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5c31\u672c\u6587\u6765\u8bf4\uff0c_gaq\u7684\u673a\u5236\u4e0d\u662f\u91cd\u70b9\uff0c\u91cd\u70b9\u662f\u540e\u9762\u533f\u540d\u51fd\u6570\u7684\u4ee3\u7801\uff0c\u8fd9\u624d\u662f\u57cb\u70b9\u4ee3\u7801\u771f\u6b63\u8981\u505a\u7684\u3002\u8fd9\u6bb5\u4ee3\u7801\u7684\u4e3b\u8981\u76ee\u7684\u5c31\u662f\u5f15\u5165\u4e00\u4e2a\u5916\u90e8\u7684js\u6587\u4ef6\uff08ga.js\uff09\uff0c\u65b9\u5f0f\u662f\u901a\u8fc7document.createElement\u65b9\u6cd5\u521b\u5efa\u4e00\u4e2ascript\u5e76\u6839\u636e\u534f\u8bae\uff08http\u6216https\uff09\u5c06src\u6307\u5411\u5bf9\u5e94\u7684ga.js\uff0c\u6700\u540e\u5c06\u8fd9\u4e2aelement\u63d2\u5165\u9875\u9762\u7684dom\u6811\u4e0a\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6ce8\u610fga.async = true\u7684\u610f\u601d\u662f\u5f02\u6b65\u8c03\u7528\u5916\u90e8js\u6587\u4ef6\uff0c\u5373\u4e0d\u963b\u585e\u6d4f\u89c8\u5668\u7684\u89e3\u6790\uff0c\u5f85\u5916\u90e8js\u4e0b\u8f7d\u5b8c\u6210\u540e\u5f02\u6b65\u6267\u884c\u3002\u8fd9\u4e2a\u5c5e\u6027\u662fHTML5\u65b0\u5f15\u5165\u7684\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u6570\u636e\u6536\u96c6\u811a\u672c\u6267\u884c\u9636\u6bb5<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6570\u636e\u6536\u96c6\u811a\u672c\uff08ga.js\uff09\u88ab\u8bf7\u6c42\u540e\u4f1a\u88ab\u6267\u884c\uff0c\u8fd9\u4e2a\u811a\u672c\u4e00\u822c\u8981\u505a\u5982\u4e0b\u51e0\u4ef6\u4e8b\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">1\u3001\u901a\u8fc7\u6d4f\u89c8\u5668\u5185\u7f6ejavascript\u5bf9\u8c61\u6536\u96c6\u4fe1\u606f\uff0c\u5982\u9875\u9762title\uff08\u901a\u8fc7document.title\uff09\u3001referrer\uff08\u4e0a\u4e00\u8df3url\uff0c\u901a\u8fc7document.referrer\uff09\u3001\u7528\u6237\u663e\u793a\u5668\u5206\u8fa8\u7387\uff08\u901a\u8fc7windows.screen\uff09\u3001cookie\u4fe1\u606f\uff08\u901a\u8fc7document.cookie\uff09\u7b49\u7b49\u4e00\u4e9b\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">2\u3001\u89e3\u6790_gaq\u6536\u96c6\u914d\u7f6e\u4fe1\u606f\u3002\u8fd9\u91cc\u9762\u53ef\u80fd\u4f1a\u5305\u62ec\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u4e8b\u4ef6\u8ddf\u8e2a\u3001\u4e1a\u52a1\u6570\u636e\uff08\u5982\u7535\u5b50\u5546\u52a1\u7f51\u7ad9\u7684\u5546\u54c1\u7f16\u53f7\u7b49\uff09\u7b49\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">3\u3001\u5c06\u4e0a\u9762\u4e24\u6b65\u6536\u96c6\u7684\u6570\u636e\u6309\u9884\u5b9a\u4e49\u683c\u5f0f\u89e3\u6790\u5e76\u62fc\u63a5\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">4\u3001\u8bf7\u6c42\u4e00\u4e2a\u540e\u7aef\u811a\u672c\uff0c\u5c06\u4fe1\u606f\u653e\u5728http request\u53c2\u6570\u4e2d\u643a\u5e26\u7ed9\u540e\u7aef\u811a\u672c\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u8fd9\u91cc\u552f\u4e00\u7684\u95ee\u9898\u662f\u6b65\u9aa44\uff0cjavascript\u8bf7\u6c42\u540e\u7aef\u811a\u672c\u5e38\u7528\u7684\u65b9\u6cd5\u662fajax\uff0c\u4f46\u662fajax\u662f\u4e0d\u80fd\u8de8\u57df\u8bf7\u6c42\u7684\u3002\u8fd9\u91ccga.js\u5728\u88ab\u7edf\u8ba1\u7f51\u7ad9\u7684\u57df\u5185\u6267\u884c\uff0c\u800c\u540e\u7aef\u811a\u672c\u5728\u53e6\u5916\u7684\u57df\uff08GA\u7684\u540e\u7aef\u7edf\u8ba1\u811a\u672c\u662fhttp:\/\/www.google-analytics.com\/__utm.gif\uff09\uff0cajax\u884c\u4e0d\u901a\u3002\u4e00\u79cd\u901a\u7528\u7684\u65b9\u6cd5\u662fjs\u811a\u672c\u521b\u5efa\u4e00\u4e2aImage\u5bf9\u8c61\uff0c\u5c06Image\u5bf9\u8c61\u7684src\u5c5e\u6027\u6307\u5411\u540e\u7aef\u811a\u672c\u5e76\u643a\u5e26\u53c2\u6570\uff0c\u6b64\u65f6\u5373\u5b9e\u73b0\u4e86\u8de8\u57df\u8bf7\u6c42\u540e\u7aef\u3002\u8fd9\u4e5f\u662f\u540e\u7aef\u811a\u672c\u4e3a\u4ec0\u4e48\u901a\u5e38\u4f2a\u88c5\u6210gif\u6587\u4ef6\u7684\u539f\u56e0\u3002\u901a\u8fc7http\u6293\u5305\u53ef\u4ee5\u770b\u5230ga.js\u5bf9__utm.gif\u7684\u8bf7\u6c42\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2197\" title=\"3\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/3.png\" alt=\"\" width=\"453\" height=\"248\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/3.png 453w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/3-300x164.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/3-250x136.png 250w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe3. \u540e\u7aef\u811a\u672c\u8bf7\u6c42\u7684http\u5305<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u53ef\u4ee5\u770b\u5230ga.js\u5728\u8bf7\u6c42__utm.gif\u65f6\u5e26\u4e86\u5f88\u591a\u4fe1\u606f\uff0c\u4f8b\u5982utmsr=1280\u00d71024\u662f\u5c4f\u5e55\u5206\u8fa8\u7387\uff0cutmac=UA-35712773-1\u662f_gaq\u4e2d\u89e3\u6790\u51fa\u7684\u6211\u7684GA\u6807\u8bc6ID\u7b49\u7b49\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c__utm.gif\u672a\u5fc5\u53ea\u4f1a\u5728\u57cb\u70b9\u4ee3\u7801\u6267\u884c\u65f6\u88ab\u8bf7\u6c42\uff0c\u5982\u679c\u7528_trackEvent\u914d\u7f6e\u4e86\u4e8b\u4ef6\u8ddf\u8e2a\uff0c\u5219\u5728\u4e8b\u4ef6\u53d1\u751f\u65f6\u4e5f\u4f1a\u8bf7\u6c42\u8fd9\u4e2a\u811a\u672c\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7531\u4e8ega.js\u7ecf\u8fc7\u4e86\u538b\u7f29\u548c\u6df7\u6dc6\uff0c\u53ef\u8bfb\u6027\u5f88\u5dee\uff0c\u6211\u4eec\u5c31\u4e0d\u5206\u6790\u4e86\uff0c\u5177\u4f53\u540e\u9762\u5b9e\u73b0\u9636\u6bb5\u6211\u4f1a\u5b9e\u73b0\u4e00\u4e2a\u529f\u80fd\u7c7b\u4f3c\u7684\u811a\u672c\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u540e\u7aef\u811a\u672c\u6267\u884c\u9636\u6bb5<\/span><\/p>\n<p><span style=\"font-size: small;\">GA\u7684__utm.gif\u662f\u4e00\u4e2a\u4f2a\u88c5\u6210gif\u7684\u811a\u672c\u3002\u8fd9\u79cd\u540e\u7aef\u811a\u672c\u4e00\u822c\u8981\u5b8c\u6210\u4ee5\u4e0b\u51e0\u4ef6\u4e8b\u60c5\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">1\u3001\u89e3\u6790http\u8bf7\u6c42\u53c2\u6570\u7684\u5230\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">2\u3001\u4ece\u670d\u52a1\u5668\uff08WebServer\uff09\u4e2d\u83b7\u53d6\u4e00\u4e9b\u5ba2\u6237\u7aef\u65e0\u6cd5\u83b7\u53d6\u7684\u4fe1\u606f\uff0c\u5982\u8bbf\u5ba2ip\u7b49\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">3\u3001\u5c06\u4fe1\u606f\u6309\u683c\u5f0f\u5199\u5165log\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">5\u3001\u751f\u6210\u4e00\u526f1\u00d71\u7684\u7a7agif\u56fe\u7247\u4f5c\u4e3a\u54cd\u5e94\u5185\u5bb9\u5e76\u5c06\u54cd\u5e94\u5934\u7684Content-type\u8bbe\u4e3aimage\/gif\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">5\u3001\u5728\u54cd\u5e94\u5934\u4e2d\u901a\u8fc7Set-cookie\u8bbe\u7f6e\u4e00\u4e9b\u9700\u8981\u7684cookie\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e4b\u6240\u4ee5\u8981\u8bbe\u7f6ecookie\u662f\u56e0\u4e3a\u5982\u679c\u8981\u8ddf\u8e2a\u552f\u4e00\u8bbf\u5ba2\uff0c\u901a\u5e38\u505a\u6cd5\u662f\u5982\u679c\u5728\u8bf7\u6c42\u65f6\u53d1\u73b0\u5ba2\u6237\u7aef\u6ca1\u6709\u6307\u5b9a\u7684\u8ddf\u8e2acookie\uff0c\u5219\u6839\u636e\u89c4\u5219\u751f\u6210\u4e00\u4e2a\u5168\u5c40\u552f\u4e00\u7684cookie\u5e76\u79cd\u690d\u7ed9\u7528\u6237\uff0c\u5426\u5219Set-cookie\u4e2d\u653e\u7f6e\u83b7\u53d6\u5230\u7684\u8ddf\u8e2acookie\u4ee5\u4fdd\u6301\u540c\u4e00\u7528\u6237cookie\u4e0d\u53d8\uff08\u89c1\u56fe4\uff09\u3002<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2198\" title=\"4\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/4.png\" alt=\"\" width=\"434\" height=\"666\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/4.png 434w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/4-195x300.png 195w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/4-97x150.png 97w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe4. \u901a\u8fc7cookie\u8ddf\u8e2a\u552f\u4e00\u7528\u6237\u7684\u539f\u7406<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u8fd9\u79cd\u505a\u6cd5\u867d\u7136\u4e0d\u662f\u5b8c\u7f8e\u7684\uff08\u4f8b\u5982\u7528\u6237\u6e05\u6389cookie\u6216\u66f4\u6362\u6d4f\u89c8\u5668\u4f1a\u88ab\u8ba4\u4e3a\u662f\u4e24\u4e2a\u7528\u6237\uff09\uff0c\u4f46\u662f\u662f\u76ee\u524d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u624b\u6bb5\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6ca1\u6709\u8de8\u7ad9\u8ddf\u8e2a\u540c\u4e00\u7528\u6237\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u901a\u8fc7js\u5c06cookie\u79cd\u690d\u5728\u88ab\u7edf\u8ba1\u7ad9\u70b9\u7684\u57df\u4e0b\uff08GA\u662f\u8fd9\u4e48\u505a\u7684\uff09\uff0c\u5982\u679c\u8981\u5168\u7f51\u7edf\u4e00\u5b9a\u4f4d\uff0c\u5219\u901a\u8fc7\u540e\u7aef\u811a\u672c\u79cd\u690d\u5728\u670d\u52a1\u7aef\u57df\u4e0b\uff08\u6211\u4eec\u5f85\u4f1a\u7684\u5b9e\u73b0\u4f1a\u8fd9\u4e48\u505a\uff09\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u7cfb\u7edf\u7684\u8bbe\u8ba1\u5b9e\u73b0<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6839\u636e\u4e0a\u8ff0\u539f\u7406\uff0c\u6211\u81ea\u5df1\u642d\u5efa\u4e86\u4e00\u4e2a\u8bbf\u95ee\u65e5\u5fd7\u6536\u96c6\u7cfb\u7edf\u3002\u603b\u4f53\u6765\u8bf4\uff0c\u642d\u5efa\u8fd9\u4e2a\u7cfb\u7edf\u8981\u505a\u5982\u4e0b\u7684\u4e8b\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2199\" title=\"5\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/5.png\" alt=\"\" width=\"523\" height=\"262\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/5.png 523w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/5-300x150.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/5-250x125.png 250w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe5. \u8bbf\u95ee\u6570\u636e\u6536\u96c6\u7cfb\u7edf\u5de5\u4f5c\u5206\u89e3<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u4e0b\u9762\u8be6\u8ff0\u6bcf\u4e00\u6b65\u7684\u5b9e\u73b0\u3002\u6211\u5c06\u8fd9\u4e2a\u7cfb\u7edf\u53eb\u505aMyAnalytics\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u786e\u5b9a\u6536\u96c6\u7684\u4fe1\u606f<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e3a\u4e86\u7b80\u5355\u8d77\u89c1\uff0c\u6211\u4e0d\u6253\u7b97\u5b9e\u73b0GA\u7684\u5b8c\u6574\u6570\u636e\u6536\u96c6\u6a21\u578b\uff0c\u800c\u662f\u6536\u96c6\u4ee5\u4e0b\u4fe1\u606f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u540d\u79f0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u9014\u5f84 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5907\u6ce8<\/span><\/p>\n<p><span style=\"font-size: small;\">\u8bbf\u95ee\u65f6\u95f4 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0web server \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Nginx \u00a0$msec<\/span><br \/>\n<span style=\"font-size: small;\"> IP \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0web server \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Nginx \u00a0 $remote_addr<\/span><br \/>\n<span style=\"font-size: small;\"> \u57df\u540d \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0document.domain<\/span><br \/>\n<span style=\"font-size: small;\"> URL \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0document.URL<\/span><br \/>\n<span style=\"font-size: small;\"> \u9875\u9762\u6807\u9898 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0document.title<\/span><br \/>\n<span style=\"font-size: small;\"> \u5206\u8fa8\u7387 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0window.screen.height &amp; width<\/span><br \/>\n<span style=\"font-size: small;\"> \u989c\u8272\u6df1\u5ea6 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0window.screen.colorDepth<\/span><br \/>\n<span style=\"font-size: small;\"> Referrer \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0document.referrer<\/span><br \/>\n<span style=\"font-size: small;\"> \u6d4f\u89c8\u5ba2\u6237\u7aef \u00a0 \u00a0 \u00a0 web server \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Nginx $http_user_agent<\/span><br \/>\n<span style=\"font-size: small;\"> \u5ba2\u6237\u7aef\u8bed\u8a00 \u00a0 \u00a0 \u00a0 \u00a0javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0navigator.language<\/span><br \/>\n<span style=\"font-size: small;\"> \u8bbf\u5ba2\u6807\u8bc6 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 cookie<\/span><br \/>\n<span style=\"font-size: small;\"> \u7f51\u7ad9\u6807\u8bc6 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0javascript \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u81ea\u5b9a\u4e49\u5bf9\u8c61<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u57cb\u70b9\u4ee3\u7801<\/span><\/p>\n<p><span style=\"font-size: small;\">\u57cb\u70b9\u4ee3\u7801\u6211\u5c06\u501f\u9274GA\u7684\u6a21\u5f0f\uff0c\u4f46\u662f\u76ee\u524d\u4e0d\u4f1a\u5c06\u914d\u7f6e\u5bf9\u8c61\u4f5c\u4e3a\u4e00\u4e2aFIFO\u961f\u5217\u7528\u3002\u4e00\u4e2a\u57cb\u70b9\u4ee3\u7801\u7684\u6a21\u677f\u5982\u4e0b\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\nvar _maq = _maq || &#x5B;];\r\n_maq.push(&#x5B;'_setAccount', '\u7f51\u7ad9\u6807\u8bc6']);\r\n\r\n(function() {\r\n    var ma = document.createElement('script'); ma.type = 'text\/javascript'; ma.async = true;\r\n    ma.src = ('https:' == document.location.protocol ? 'https:\/\/analytics' : 'http:\/\/analytics') + '.codinglabs.org\/ma.js';\r\n    var s = document.getElementsByTagName('script')&#x5B;0]; s.parentNode.insertBefore(ma, s);\r\n})();\r\n&lt;\/script&gt;\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u8fd9\u91cc\u6211\u542f\u7528\u4e86\u4e8c\u7ea7\u57df\u540danalytics.codinglabs.org\uff0c\u7edf\u8ba1\u811a\u672c\u7684\u540d\u79f0\u4e3ama.js\u3002\u5f53\u7136\u8fd9\u91cc\u6709\u4e00\u70b9\u5c0f\u95ee\u9898\uff0c\u56e0\u4e3a\u6211\u5e76\u6ca1\u6709https\u7684\u670d\u52a1\u5668\uff0c\u6240\u4ee5\u5982\u679c\u4e00\u4e2ahttps\u7ad9\u70b9\u90e8\u7f72\u4e86\u4ee3\u7801\u4f1a\u6709\u95ee\u9898\uff0c\u4e0d\u8fc7\u8fd9\u91cc\u6211\u4eec\u5148\u5ffd\u7565\u5427\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u524d\u7aef\u7edf\u8ba1\u811a\u672c<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6211\u5199\u4e86\u4e00\u4e2a\u4e0d\u662f\u5f88\u5b8c\u5584\u4f46\u80fd\u5b8c\u6210\u57fa\u672c\u5de5\u4f5c\u7684\u7edf\u8ba1\u811a\u672cma.js\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n(function () {\r\n    var params = {};\r\n    \/\/Document\u5bf9\u8c61\u6570\u636e\r\n    if(document) {\r\n        params.domain = document.domain || '';\r\n        params.url = document.URL || '';\r\n        params.title = document.title || '';\r\n        params.referrer = document.referrer || '';\r\n    }\r\n    \/\/Window\u5bf9\u8c61\u6570\u636e\r\n    if(window &amp;&amp; window.screen) {\r\n        params.sh = window.screen.height || 0;\r\n        params.sw = window.screen.width || 0;\r\n        params.cd = window.screen.colorDepth || 0;\r\n    }\r\n    \/\/navigator\u5bf9\u8c61\u6570\u636e\r\n    if(navigator) {\r\n        params.lang = navigator.language || '';\r\n    }\r\n    \/\/\u89e3\u6790_maq\u914d\u7f6e\r\n    if(_maq) {\r\n        for(var i in _maq) {\r\n            switch(_maq&#x5B;i]&#x5B;0]) {\r\n                case '_setAccount':\r\n                    params.account = _maq&#x5B;i]&#x5B;1];\r\n                    break;\r\n                default:\r\n                    break;\r\n            }\r\n        }\r\n    }\r\n    \/\/\u62fc\u63a5\u53c2\u6570\u4e32\r\n    var args = '';\r\n    for(var i in params) {\r\n        if(args != '') {\r\n            args += '&amp;';\r\n        }\r\n        args += i + '=' + encodeURIComponent(params&#x5B;i]);\r\n    }\r\n\r\n    \/\/\u901a\u8fc7Image\u5bf9\u8c61\u8bf7\u6c42\u540e\u7aef\u811a\u672c\r\n    var img = new Image(1, 1);\r\n    img.src = 'http:\/\/analytics.codinglabs.org\/1.gif?' + args;\r\n})();\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u6574\u4e2a\u811a\u672c\u653e\u5728\u533f\u540d\u51fd\u6570\u91cc\uff0c\u786e\u4fdd\u4e0d\u4f1a\u6c61\u67d3\u5168\u5c40\u73af\u5883\u3002\u529f\u80fd\u5728\u539f\u7406\u4e00\u8282\u5df2\u7ecf\u8bf4\u660e\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002\u5176\u4e2d1.gif\u662f\u540e\u7aef\u811a\u672c\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u65e5\u5fd7\u683c\u5f0f<\/span><\/p>\n<p><span style=\"font-size: small;\">\u65e5\u5fd7\u91c7\u7528\u6bcf\u884c\u4e00\u6761\u8bb0\u5f55\u7684\u65b9\u5f0f\uff0c\u91c7\u7528\u4e0d\u53ef\u89c1\u5b57\u7b26^A\uff08ascii\u78010x01\uff0cLinux\u4e0b\u53ef\u901a\u8fc7ctrl + v ctrl + a\u8f93\u5165\uff0c\u4e0b\u6587\u5747\u7528\u201c^A\u201d\u8868\u793a\u4e0d\u53ef\u89c1\u5b57\u7b260x01\uff09\uff0c\u5177\u4f53\u683c\u5f0f\u5982\u4e0b\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">\u65f6\u95f4^AIP^A\u57df\u540d^AURL^A\u9875\u9762\u6807\u9898^AReferrer^A\u5206\u8fa8\u7387\u9ad8^A\u5206\u8fa8\u7387\u5bbd^A\u989c\u8272\u6df1\u5ea6^A\u8bed\u8a00^A\u5ba2\u6237\u7aef\u4fe1\u606f^A\u7528\u6237\u6807\u8bc6^A\u7f51\u7ad9\u6807\u8bc6<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u540e\u7aef\u811a\u672c<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e3a\u4e86\u7b80\u5355\u548c\u6548\u7387\u8003\u8651\uff0c\u6211\u6253\u7b97\u76f4\u63a5\u4f7f\u7528nginx\u7684access_log\u505a\u65e5\u5fd7\u6536\u96c6\uff0c\u4e0d\u8fc7\u6709\u4e2a\u95ee\u9898\u5c31\u662fnginx\u914d\u7f6e\u672c\u8eab\u7684\u903b\u8f91\u8868\u8fbe\u80fd\u529b\u6709\u9650\uff0c\u6240\u4ee5\u6211\u9009\u7528\u4e86OpenResty\u505a\u8fd9\u4e2a\u4e8b\u60c5\u3002OpenResty\u662f\u4e00\u4e2a\u57fa\u4e8eNginx\u6269\u5c55\u51fa\u7684\u9ad8\u6027\u80fd\u5e94\u7528\u5f00\u53d1\u5e73\u53f0\uff0c\u5185\u90e8\u96c6\u6210\u4e86\u8bf8\u591a\u6709\u7528\u7684\u6a21\u5757\uff0c\u5176\u4e2d\u7684\u6838\u5fc3\u662f\u901a\u8fc7ngx_lua\u6a21\u5757\u96c6\u6210\u4e86Lua\uff0c\u4ece\u800c\u5728nginx\u914d\u7f6e\u6587\u4ef6\u4e2d\u53ef\u4ee5\u901a\u8fc7Lua\u6765\u8868\u8ff0\u4e1a\u52a1\u3002\u5173\u4e8e\u8fd9\u4e2a\u5e73\u53f0\u6211\u8fd9\u91cc\u4e0d\u505a\u8fc7\u591a\u4ecb\u7ecd\uff0c\u611f\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u53c2\u8003\u5176\u5b98\u65b9\u7f51\u7ad9http:\/\/openresty.org\/\uff0c\u6216\u8005\u8fd9\u91cc\u6709\u5176\u4f5c\u8005\u7ae0\u4ea6\u6625\uff08agentzh\uff09\u505a\u7684\u4e00\u4e2a\u975e\u5e38\u6709\u7231\u7684\u4ecb\u7ecdOpenResty\u7684slide\uff1ahttp:\/\/agentzh.org\/misc\/slides\/ngx-openresty-ecosystem\/\uff0c\u5173\u4e8engx_lua\u53ef\u4ee5\u53c2\u8003\uff1ahttps:\/\/github.com\/chaoslawful\/lua-nginx-module\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u9996\u5148\uff0c\u9700\u8981\u5728nginx\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u5b9a\u4e49\u65e5\u5fd7\u683c\u5f0f\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nlog_format tick &quot;$msec^A$remote_addr^A$u_domain^A$u_url^A$u_title^A$u_referrer^A$u_sh^A$u_sw^A$u_cd^A$u_lang^A$http_user_agent^A$u_utrace^A$u_account&quot;;\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u6ce8\u610f\u8fd9\u91cc\u4ee5u_\u5f00\u5934\u7684\u662f\u6211\u4eec\u5f85\u4f1a\u4f1a\u81ea\u5df1\u5b9a\u4e49\u7684\u53d8\u91cf\uff0c\u5176\u5b83\u7684\u662fnginx\u5185\u7f6e\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7136\u540e\u662f\u6838\u5fc3\u7684\u4e24\u4e2alocation\uff1a<\/span><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nlocation \/1.gif {\r\n    #\u4f2a\u88c5\u6210gif\u6587\u4ef6\r\n    default_type image\/gif;\r\n    #\u672c\u8eab\u5173\u95edaccess_log\uff0c\u901a\u8fc7subrequest\u8bb0\u5f55log\r\n    access_log off;\r\n\r\n    access_by_lua &quot;\r\n        -- \u7528\u6237\u8ddf\u8e2acookie\u540d\u4e3a__utrace\r\n        local uid = ngx.var.cookie___utrace\r\n        if not uid then\r\n            -- \u5982\u679c\u6ca1\u6709\u5219\u751f\u6210\u4e00\u4e2a\u8ddf\u8e2acookie\uff0c\u7b97\u6cd5\u4e3amd5(\u65f6\u95f4\u6233+IP+\u5ba2\u6237\u7aef\u4fe1\u606f)\r\n            uid = ngx.md5(ngx.now() .. ngx.var.remote_addr .. ngx.var.http_user_agent)\r\n        end\r\n        ngx.header&#x5B;'Set-Cookie'] = {'__utrace=' .. uid .. '; path=\/'}\r\n        if ngx.var.arg_domain then\r\n            -- \u901a\u8fc7subrequest\u5230\/i-log\u8bb0\u5f55\u65e5\u5fd7\uff0c\u5c06\u53c2\u6570\u548c\u7528\u6237\u8ddf\u8e2acookie\u5e26\u8fc7\u53bb\r\n            ngx.location.capture('\/i-log?' .. ngx.var.args .. '&amp;utrace=' .. uid)\r\n        end\r\n    &quot;;\r\n\r\n    #\u6b64\u8bf7\u6c42\u4e0d\u7f13\u5b58\r\n    add_header Expires &quot;Fri, 01 Jan 1980 00:00:00 GMT&quot;;\r\n    add_header Pragma &quot;no-cache&quot;;\r\n    add_header Cache-Control &quot;no-cache, max-age=0, must-revalidate&quot;;\r\n\r\n    #\u8fd4\u56de\u4e00\u4e2a1\u00d71\u7684\u7a7agif\u56fe\u7247\r\n    empty_gif;\r\n}\r\n\r\nlocation \/i-log {\r\n    #\u5185\u90e8location\uff0c\u4e0d\u5141\u8bb8\u5916\u90e8\u76f4\u63a5\u8bbf\u95ee\r\n    internal;\r\n\r\n    #\u8bbe\u7f6e\u53d8\u91cf\uff0c\u6ce8\u610f\u9700\u8981unescape\r\n    set_unescape_uri $u_domain $arg_domain;\r\n    set_unescape_uri $u_url $arg_url;\r\n    set_unescape_uri $u_title $arg_title;\r\n    set_unescape_uri $u_referrer $arg_referrer;\r\n    set_unescape_uri $u_sh $arg_sh;\r\n    set_unescape_uri $u_sw $arg_sw;\r\n    set_unescape_uri $u_cd $arg_cd;\r\n    set_unescape_uri $u_lang $arg_lang;\r\n    set_unescape_uri $u_utrace $arg_utrace;\r\n    set_unescape_uri $u_account $arg_account;\r\n\r\n    #\u6253\u5f00\u65e5\u5fd7\r\n    log_subrequest on;\r\n    #\u8bb0\u5f55\u65e5\u5fd7\u5230ma.log\uff0c\u5b9e\u9645\u5e94\u7528\u4e2d\u6700\u597d\u52a0buffer\uff0c\u683c\u5f0f\u4e3atick\r\n    access_log \/path\/to\/logs\/directory\/ma.log tick;\r\n\r\n    #\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\r\n    echo '';\r\n}\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u8981\u5b8c\u5168\u89e3\u91ca\u8fd9\u6bb5\u811a\u672c\u7684\u6bcf\u4e00\u4e2a\u7ec6\u8282\u6709\u70b9\u8d85\u51fa\u672c\u6587\u7684\u8303\u56f4\uff0c\u800c\u4e14\u7528\u5230\u4e86\u8bf8\u591a\u7b2c\u4e09\u65b9ngxin\u6a21\u5757\uff08\u5168\u90fd\u5305\u542b\u5728OpenResty\u4e2d\u4e86\uff09\uff0c\u91cd\u70b9\u7684\u5730\u65b9\u6211\u90fd\u7528\u6ce8\u91ca\u6807\u51fa\u6765\u4e86\uff0c\u53ef\u4ee5\u4e0d\u7528\u5b8c\u5168\u7406\u89e3\u6bcf\u4e00\u884c\u7684\u610f\u4e49\uff0c\u53ea\u8981\u5927\u7ea6\u77e5\u9053\u8fd9\u4e2a\u914d\u7f6e\u5b8c\u6210\u4e86\u6211\u4eec\u5728\u539f\u7406\u4e00\u8282\u63d0\u5230\u7684\u540e\u7aef\u903b\u8f91\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u65e5\u5fd7\u8f6e\u8f6c<\/span><\/p>\n<p><span style=\"font-size: small;\">\u771f\u6b63\u7684\u65e5\u5fd7\u6536\u96c6\u7cfb\u7edf\u8bbf\u95ee\u65e5\u5fd7\u4f1a\u975e\u5e38\u591a\uff0c\u65f6\u95f4\u4e00\u957f\u6587\u4ef6\u53d8\u5f97\u5f88\u5927\uff0c\u800c\u4e14\u65e5\u5fd7\u653e\u5728\u4e00\u4e2a\u6587\u4ef6\u4e0d\u4fbf\u4e8e\u7ba1\u7406\u3002\u6240\u4ee5\u901a\u5e38\u8981\u6309\u65f6\u95f4\u6bb5\u5c06\u65e5\u5fd7\u5207\u5206\uff0c\u4f8b\u5982\u6bcf\u5929\u6216\u6bcf\u5c0f\u65f6\u5207\u5206\u4e00\u4e2a\u65e5\u5fd7\u3002\u6211\u8fd9\u91cc\u4e3a\u4e86\u6548\u679c\u660e\u663e\uff0c\u6bcf\u4e00\u5c0f\u65f6\u5207\u5206\u4e00\u4e2a\u65e5\u5fd7\u3002\u6211\u662f\u901a\u8fc7crontab\u5b9a\u65f6\u8c03\u7528\u4e00\u4e2ashell\u811a\u672c\u5b9e\u73b0\u7684\uff0cshell\u811a\u672c\u5982\u4e0b\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n_prefix=&quot;\/path\/to\/nginx&quot;\r\ntime=`date +%Y%m%d%H`\r\n\r\nmv ${_prefix}\/logs\/ma.log ${_prefix}\/logs\/ma\/ma-${time}.log\r\nkill -USR1 `cat ${_prefix}\/logs\/nginx.pid`\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u8fd9\u4e2a\u811a\u672c\u5c06ma.log\u79fb\u52a8\u5230\u6307\u5b9a\u6587\u4ef6\u5939\u5e76\u91cd\u547d\u540d\u4e3ama-{yyyymmddhh}.log\uff0c\u7136\u540e\u5411nginx\u53d1\u9001USR1\u4fe1\u53f7\u4ee4\u5176\u91cd\u65b0\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7136\u540e\u518d\/etc\/crontab\u91cc\u52a0\u5165\u4e00\u884c\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n59  *  *  *  * root \/path\/to\/directory\/rotatelog.sh\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u5728\u6bcf\u4e2a\u5c0f\u65f6\u768459\u5206\u542f\u52a8\u8fd9\u4e2a\u811a\u672c\u8fdb\u884c\u65e5\u5fd7\u8f6e\u8f6c\u64cd\u4f5c\u3002<\/span><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u6d4b\u8bd5<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e0b\u9762\u53ef\u4ee5\u6d4b\u8bd5\u8fd9\u4e2a\u7cfb\u7edf\u662f\u5426\u80fd\u6b63\u5e38\u8fd0\u884c\u4e86\u3002\u6211\u6628\u5929\u5c31\u5728\u6211\u7684\u535a\u5ba2\u4e2d\u57cb\u4e86\u76f8\u5173\u7684\u70b9\uff0c\u901a\u8fc7http\u6293\u5305\u53ef\u4ee5\u770b\u5230ma.js\u548c1.gif\u5df2\u7ecf\u88ab\u6b63\u786e\u8bf7\u6c42\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2200\" title=\"6\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/6.png\" alt=\"\" width=\"482\" height=\"208\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/6.png 482w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/6-300x129.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/6-250x107.png 250w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe6. http\u5305\u5206\u6790ma.js\u548c1.gif\u7684\u8bf7\u6c42<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u540c\u65f6\u53ef\u4ee5\u770b\u4e00\u4e0b1.gif\u7684\u8bf7\u6c42\u53c2\u6570\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2201\" title=\"7\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/7.png\" alt=\"\" width=\"365\" height=\"166\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/7.png 365w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/7-300x136.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/7-250x113.png 250w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe7. 1.gif\u7684\u8bf7\u6c42\u53c2\u6570<\/span><\/strong><\/p>\n<p><span style=\"font-size: small;\">\u76f8\u5173\u4fe1\u606f\u786e\u5b9e\u4e5f\u653e\u5728\u4e86\u8bf7\u6c42\u53c2\u6570\u4e2d\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u7136\u540e\u6211tail\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6\uff0c\u7136\u540e\u5237\u65b0\u4e00\u4e0b\u9875\u9762\uff0c\u56e0\u4e3a\u6ca1\u6709\u8bbeaccess log buffer\uff0c \u6211\u7acb\u5373\u5f97\u5230\u4e86\u4e00\u6761\u65b0\u65e5\u5fd7\uff1a<\/span><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n1351060731.360^A0.0.0.0^Awww.codinglabs.org^Ahttp:\/\/www.codinglabs.org\/^ACodingLabs^A^A1024^A1280^A24^Azh-CN^AMozilla\/5.0 (Macintosh; Intel Mac OS X 10_8_2)\r\nAppleWebKit\/537.4 (KHTML, like Gecko) Chrome\/22.0.1229.94 Safari\/537.4^A4d612be64366768d32e623d594e82678^AU-1-1\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u6ce8\u610f\u5b9e\u9645\u4e0a\u539f\u65e5\u5fd7\u4e2d\u7684^A\u662f\u4e0d\u53ef\u89c1\u7684\uff0c\u8fd9\u91cc\u6211\u7528\u53ef\u89c1\u7684^A\u66ff\u6362\u4e3a\u65b9\u4fbf\u9605\u8bfb\uff0c\u53e6\u5916IP\u7531\u4e8e\u6d89\u53ca\u9690\u79c1\u6211\u66ff\u6362\u4e3a\u4e860.0.0.0\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u770b\u4e00\u773c\u65e5\u5fd7\u8f6e\u8f6c\u76ee\u5f55\uff0c\u7531\u4e8e\u6211\u4e4b\u524d\u5df2\u7ecf\u57cb\u4e86\u70b9\uff0c\u6240\u4ee5\u5df2\u7ecf\u751f\u6210\u4e86\u5f88\u591a\u8f6e\u8f6c\u6587\u4ef6\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2202\" title=\"8\" src=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/8.png\" alt=\"\" width=\"456\" height=\"78\" srcset=\"https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/8.png 456w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/8-300x51.png 300w, https:\/\/kyle.ai\/blog\/wp-content\/uploads\/2012\/10\/8-250x42.png 250w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/a><\/p>\n<p><strong><span style=\"font-size: small;\">\u56fe8. \u8f6e\u8f6c\u65e5\u5fd7<\/span><\/strong><\/p>\n<p><span style=\"color: #ff0000; font-size: small;\">\u5173\u4e8e\u5206\u6790<\/span><br \/>\n<span style=\"font-size: small;\"> \u901a\u8fc7\u4e0a\u9762\u7684\u5206\u6790\u548c\u5f00\u53d1\u53ef\u4ee5\u5927\u81f4\u7406\u89e3\u4e00\u4e2a\u7f51\u7ad9\u7edf\u8ba1\u7684\u65e5\u5fd7\u6536\u96c6\u7cfb\u7edf\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u3002\u6709\u4e86\u8fd9\u4e9b\u65e5\u5fd7\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u540e\u7eed\u7684\u5206\u6790\u4e86\u3002\u672c\u6587\u53ea\u6ce8\u91cd\u65e5\u5fd7\u6536\u96c6\uff0c\u6240\u4ee5\u4e0d\u4f1a\u5199\u592a\u591a\u5173\u4e8e\u5206\u6790\u7684\u4e1c\u897f\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6ce8\u610f\uff0c\u539f\u59cb\u65e5\u5fd7\u6700\u597d\u5c3d\u91cf\u591a\u7684\u4fdd\u7559\u4fe1\u606f\u800c\u4e0d\u8981\u505a\u8fc7\u591a\u8fc7\u6ee4\u548c\u5904\u7406\u3002\u4f8b\u5982\u4e0a\u9762\u7684MyAnalytics\u4fdd\u7559\u4e86\u6beb\u79d2\u7ea7\u65f6\u95f4\u6233\u800c\u4e0d\u662f\u683c\u5f0f\u5316\u540e\u7684\u65f6\u95f4\uff0c\u65f6\u95f4\u7684\u683c\u5f0f\u5316\u662f\u540e\u9762\u7684\u7cfb\u7edf\u505a\u7684\u4e8b\u800c\u4e0d\u662f\u65e5\u5fd7\u6536\u96c6\u7cfb\u7edf\u7684\u8d23\u4efb\u3002\u540e\u9762\u7684\u7cfb\u7edf\u6839\u636e\u539f\u59cb\u65e5\u5fd7\u53ef\u4ee5\u5206\u6790\u51fa\u5f88\u591a\u4e1c\u897f\uff0c\u4f8b\u5982\u901a\u8fc7IP\u5e93\u53ef\u4ee5\u5b9a\u4f4d\u8bbf\u95ee\u8005\u7684\u5730\u57df\u3001user agent\u4e2d\u53ef\u4ee5\u5f97\u5230\u8bbf\u95ee\u8005\u7684\u64cd\u4f5c\u7cfb\u7edf\u3001\u6d4f\u89c8\u5668\u7b49\u4fe1\u606f\uff0c\u518d\u7ed3\u5408\u590d\u6742\u7684\u5206\u6790\u6a21\u578b\uff0c\u5c31\u53ef\u4ee5\u505a\u6d41\u91cf\u3001\u6765\u6e90\u3001\u8bbf\u5ba2\u3001\u5730\u57df\u3001\u8def\u5f84\u7b49\u5206\u6790\u4e86\u3002\u5f53\u7136\uff0c\u4e00\u822c\u4e0d\u4f1a\u76f4\u63a5\u5bf9\u539f\u59cb\u65e5\u5fd7\u5206\u6790\uff0c\u800c\u662f\u4f1a\u5c06\u5176\u6e05\u6d17\u683c\u5f0f\u5316\u540e\u8f6c\u5b58\u5230\u5176\u5b83\u5730\u65b9\uff0c\u5982MySQL\u6216HBase\u4e2d\u518d\u505a\u5206\u6790\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5206\u6790\u90e8\u5206\u7684\u5de5\u4f5c\u6709\u5f88\u591a\u5f00\u6e90\u7684\u57fa\u7840\u8bbe\u65bd\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f8b\u5982\u5b9e\u65f6\u5206\u6790\u53ef\u4ee5\u4f7f\u7528Storm\uff0c\u800c\u79bb\u7ebf\u5206\u6790\u53ef\u4ee5\u4f7f\u7528Hadoop\u3002\u5f53\u7136\uff0c\u5728\u65e5\u5fd7\u6bd4\u8f83\u5c0f\u7684\u60c5\u51b5\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7shell\u547d\u4ee4\u505a\u4e00\u4e9b\u7b80\u5355\u7684\u5206\u6790\uff0c\u4f8b\u5982\uff0c\u4e0b\u9762\u4e09\u6761\u547d\u4ee4\u53ef\u4ee5\u5206\u522b\u5f97\u51fa\u6211\u7684\u535a\u5ba2\u5728\u4eca\u5929\u4e0a\u53488\u70b9\u52309\u70b9\u7684\u8bbf\u95ee\u91cf\uff08PV\uff09\uff0c\u8bbf\u5ba2\u6570\uff08UV\uff09\u548c\u72ec\u7acbIP\u6570\uff08IP\uff09\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nawk -F^A '{print $1}' ma-2012102409.log | wc -l\r\nawk -F^A '{print $12}' ma-2012102409.log | uniq | wc -l\r\nawk -F^A '{print $2}' ma-2012102409.log | uniq | wc -l\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u5176\u5b83\u597d\u73a9\u7684\u4e1c\u897f\u670b\u53cb\u4eec\u53ef\u4ee5\u6162\u6162\u6316\u6398\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #ff0000;\">\u53c2\u8003<\/span><br \/>\n<span style=\"font-size: small;\"> GA\u7684\u5f00\u53d1\u8005\u6587\u6863\uff1ahttps:\/\/developers.google.com\/analytics\/devguides\/collection\/gajs\/<\/span><\/p>\n<p><span style=\"font-size: small;\">\u4e00\u7bc7\u5173\u4e8e\u5b9e\u73b0nginx\u6536\u65e5\u5fd7\u7684\u6587\u7ae0\uff1ahttp:\/\/blog.linezing.com\/2011\/11\/%E4%BD%BF%E7%94%A8nginx%E8%AE%B0%E6%97%A5%E5%BF%97<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5173\u4e8eNginx\u53ef\u4ee5\u53c2\u8003\uff1ahttp:\/\/wiki.nginx.org\/Main<\/span><\/p>\n<p><span style=\"font-size: small;\">OpenResty\u7684\u5b98\u65b9\u7f51\u7ad9\u4e3a\uff1ahttp:\/\/openresty.org<\/span><\/p>\n<p><span style=\"font-size: small;\">ngx_lua\u6a21\u5757\u53ef\u53c2\u8003\uff1ahttps:\/\/github.com\/chaoslawful\/lua-nginx-module<\/span><\/p>\n<p><span style=\"font-size: small;\">\u672c\u6587http\u6293\u5305\u4f7f\u7528Chrome\u6d4f\u89c8\u5668\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u7ed8\u5236\u601d\u7ef4\u5bfc\u56fe\u4f7f\u7528Xmind\uff0c\u6d41\u7a0b\u548c\u7ed3\u6784\u56fe\u4f7f\u7528Tikz PGF<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\uff1ahttp:\/\/www.codinglabs.org\/html\/how-web-analytics-dat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2192","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=2192"}],"version-history":[{"count":5,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2192\/revisions"}],"predecessor-version":[{"id":2194,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2192\/revisions\/2194"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=2192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=2192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=2192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}