[{"data":1,"prerenderedAt":423},["ShallowReactive",2],{"project-18673928":3},{"id":4,"name":5,"line":5,"line_source":6,"title":7,"url":8,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":34,"aspects":35,"strip":43,"post_text":45,"what":46,"said":76,"maker_in_thread":179,"shape":190,"grid":194,"attempts":385,"same_week":386,"maker_shows":32,"maker_hidden":415,"reader_version":416,"card":417},"18673928","Minimal Google Analytics Snippet","title","Show HN: Minimal Google Analytics Snippet","https:\u002F\u002Fminimalanalytics.com","minimalanalytics.com","davidkuennen",1544720979,2018,171,70,223,2155,11,"notable","web_saas","web analytics snippet","library",[23,24,25,26],"google analytics","analytics snippet","page views","lightweight tracking","curious",-0.115,{"positive":30,"neutral":31,"mixed":32,"critical":33},2,27,1,7,37,{"performance":36,"idea":38,"execution":39,"privacy":40,"docs":42},{"positive":37,"critical":30},0,{"positive":32,"critical":32},{"positive":32,"critical":32},{"positive":37,"critical":41},3,{"positive":37,"critical":37},[37,37,41,41,41,41,41,41,41,32,32,37,37,44,37,37,32,32,41,41,41,41,41,41,41,32,41,37,41,32,41,44,37,41,37,41,41,32,41,41],5,null,{"problem":47,"audience":54,"pricing":45,"motivation":59,"time_to_build":45,"stack":63,"openness":74,"stage":75,"team_size":74},{"value":48,"source":49,"evidence":50},"Google Tag Manager and Analytics libraries are too heavy to slow sites down just to track basic page views","maker",[51],{"id":52,"by":10,"text":53},"18674160","Created this, cause I hated having to slow down my websites by adding the gigantic Google Tag Manager and Analytics libraries, combined with their randomly slow CDN, just to…",{"value":55,"source":56,"evidence":57},"Website owners who want basic page view tracking","inferred",[58],{"id":52,"by":10,"text":53},{"value":60,"source":49,"evidence":61},"Hated slowing websites down with the large Google Tag Manager and Analytics libraries",[62],{"id":52,"by":10,"text":53},[64],{"value":65,"source":56,"evidence":66},"JavaScript",[67,71],{"id":68,"by":69,"text":70},"18680290","latchkey","Could you make it a tiny bit smaller by aliasing `window` and `document` and `localStorage` to remove the duplicated calls? `var w=window;var d=document;var l=localStorage;`…",{"id":72,"by":10,"text":73},"18693893","Thank you all for your great feedback. I made some improvements based on that. Now using navigator.sendBeacon if available (not even GA does that by default yet), ability to…","unknown","launched",{"praise":77,"objections":97,"requests":124,"questions":145,"alternatives":160},[78,90],{"value":79,"source":80,"evidence":81},"Clever and tiny approach to analytics","commenter",[82,86],{"id":83,"by":84,"text":85},"18682357","shift8","Really good point and I agree. This was intriguing at first glance because who doesn't want less JS on their site?! Of course! However, missing out on other events being tracked,…",{"id":87,"by":88,"text":89},"18679304","LolNoGenerics","Now I am intrigued to make a minimal snippet that creates a histogram of loading times.",{"value":91,"source":80,"evidence":92},"Works with SPA frameworks",[93],{"id":94,"by":95,"text":96},"18679383","gobengo","It's cool that in also works with SPA frameworks. Thanks for sharing. In other surveilance news, I've been adding Matomo[1] for web analytics to my site for the first time. Used…",[98,102,117],{"value":99,"source":80,"evidence":100},"Loses events and advanced features Google Analytics provides, hurting Google Ads linkage",[101],{"id":83,"by":84,"text":85},{"value":103,"source":80,"evidence":104},"Caching makes the size concern less important than claimed",[105,109,113],{"id":106,"by":107,"text":108},"18680507","jopsen","I'm not an expert, just curious... But aren't these files cached on most users computers?",{"id":110,"by":111,"text":112},"18680815","onion2k","Both of Google's recommended methods of adding Analytics to a website load Google's JS library asynchronously[1]. Including it has no meaningful impact a site's time to first…",{"id":114,"by":115,"text":116},"18680093","jrockway","Isn't the tag manager and analytics library likely to be cached, thus using zero bytes on average versus the non-zero number of bytes for this library?",{"value":118,"source":80,"evidence":119},"Bypasses Google's opt-out add-on, a privacy concern",[120],{"id":121,"by":122,"text":123},"18681081","nwellnhof","The snippet seems to circumvent the Google Analytics Opt-out Browser Add-on which many sites mention as a way to disable GA tracking in their privacy policy. So if you use the…",[125,131,138],{"value":126,"source":49,"evidence":127},"Expose an event tracking function",[128],{"id":129,"by":10,"text":130},"18680361","Will add an option for that as soon as I'm home. Also got many feature requests for exposing an event function. Both of these things shouldn't add any significant size to the…",{"value":132,"source":80,"evidence":133},"Option to anonymize IPs",[134],{"id":135,"by":136,"text":137},"18680343","largehotcoffee","Can you include this? ga('set', 'anonymizeIp', true);",{"value":139,"source":80,"evidence":140},"Configurable tracked fields",[141],{"id":142,"by":143,"text":144},"18681272","RodgerTheGreat","While you're at it, why not be less invasive and neuter some of the data you send across? Does Google need to know about screen colordepth, language settings and text encodings,…",[146,153],{"value":147,"source":80,"evidence":148},"Will the Google collect endpoint change over time",[149],{"id":150,"by":151,"text":152},"18679337","FoxInBoxers","Very cool, thank you! Would you expect Google's API to change often? My biggest concern with something like this is their \u002Fcollect endpoint changing and analytics data stops…",{"value":154,"source":80,"evidence":155},"Is it a GitHub repo",[156],{"id":157,"by":158,"text":159},"18680581","ieq8","could you create github repo?",[161,165,172],{"value":162,"source":80,"evidence":163},"Matomo \u002F Piwik",[164],{"id":94,"by":95,"text":96},{"value":166,"source":80,"evidence":167},"Fathom",[168],{"id":169,"by":170,"text":171},"18679740","siddhant","For the surveillance conscious I can also recommend using Fathom (https:\u002F\u002Fusefathom.com). I’ve been using it for a few weeks now and have only good things to say.",{"value":173,"source":80,"evidence":174},"Ahoy for Rails",[175],{"id":176,"by":177,"text":178},"18679924","masa331","I can recommend https:\u002F\u002Fgithub.com\u002Fankane\u002Fahoy for Rails",{"comments":180,"answered":181,"key":182},16,8,[183,184,187],{"id":52,"text":53},{"id":185,"text":186},"18682056","Added options for the information you want to track.",{"id":188,"text":189},"18681283","Are you sure it circumvents it? My uBlock Origin is still properly blocking the API call to google analytics. But since the Add-on is from Google itself it could work in…",{"commenters":191,"max_depth":44,"maker_replies":180,"first_comment_mins":192,"lifespan_hours":193},48,22,86,[195,197,201,204,206,208,211,214,217,220,224,227,230,232,235,238,242,245,248,250,254,257,260,262,263,266,268,269,272,274,276,278,279,282,284,287,288,291,294,297,300,301,303,306,308,312,315,317,320,322,326,328,331,333,336,338,341,345,349,351,353,356,359,362,365,369,373,375,378,382],[52,37,37,196,10,32],"project\u002Fneutral\u002Fidea",[198,37,37,199,200,37],"18680232","commenter\u002Fneutral\u002Fnone","C1sc0cat",[202,37,37,199,203,37],"18680355","spiderfarmer",[205,37,37,199,200,37],"18681051",[106,37,41,207,107,37],"project\u002Fneutral\u002Fperformance",[209,37,41,207,210,37],"18680540","niel",[212,37,37,199,213,37],"18680625","yayana",[215,37,41,207,216,37],"18680546","jasonkester",[218,37,41,207,219,37],"18680902","jefftk",[221,37,37,222,223,37],"18681990","other\u002Fneutral\u002Fperformance","reaperducer",[225,37,41,207,226,37],"18681239","bzbarsky",[228,37,41,207,229,37],"18681872","onlyrealcuzzo",[110,37,41,231,111,37],"project\u002Fmixed\u002Fperformance",[233,37,41,207,234,37],"18681327","awirth",[236,37,41,207,237,37],"18681463","scratchnsniff",[239,37,32,240,241,37],"18681780","project\u002Fcritical\u002Fperformance","dwild",[243,37,37,222,244,37],"18683462","dorgo",[246,37,41,207,247,37],"18697464","tuananh",[83,37,32,249,84,37],"project\u002Fcritical\u002Fidea",[251,32,37,252,253,37],"18679384","other\u002Fneutral\u002Fnone","denormalfloat",[255,32,37,252,256,37],"18680166","louismerlin",[258,32,37,252,259,37],"18680390","knewter",[94,30,44,261,95,37],"project\u002Fpositive\u002Fexecution",[169,30,37,252,170,37],[264,30,37,252,265,37],"18680158","Cenk",[267,30,37,252,170,37],"18688000",[176,30,37,252,177,37],[270,30,37,252,271,37],"18680831","napsterbr",[142,41,32,273,143,37],"project\u002Fcritical\u002Fprivacy",[185,41,37,275,10,32],"maker\u002Fneutral\u002Fprivacy",[121,277,32,273,122,37],4,[188,277,37,275,10,32],[280,277,41,281,122,37],"18681767","project\u002Fneutral\u002Fprivacy",[283,277,37,275,10,32],"18682114",[285,277,41,281,286,37],"18685854","gorhill",[68,44,41,207,69,37],[289,44,41,207,290,37],"18680759","moviuro",[292,44,41,207,293,37],"18681226","s_y_n_t_a_x",[150,295,41,296,151,37],6,"project\u002Fneutral\u002Fnone",[298,295,37,299,10,32],"18679401","maker\u002Fneutral\u002Fdocs",[135,33,41,196,136,37],[129,33,37,302,10,32],"maker\u002Fneutral\u002Fidea",[304,33,41,305,122,37],"18680878","project\u002Fneutral\u002Fexecution",[307,33,37,275,10,32],"18682061",[309,181,32,310,311,37],"18680806","project\u002Fcritical\u002Fexecution","franciscop",[313,181,37,314,10,32],"18680811","maker\u002Fneutral\u002Fexecution",[316,181,41,305,311,37],"18680845",[318,181,37,319,10,32],"18680876","maker\u002Fpositive\u002Fnone",[321,181,37,314,10,32],"18682051",[323,324,41,281,325,37],"18682127",9,"microcolonel",[114,327,32,240,115,37],10,[329,327,41,207,330,37],"18680137","rovr138",[332,327,37,252,213,37],"18680274",[334,327,41,207,335,37],"18680684","seanwilson",[87,17,44,337,88,37],"project\u002Fpositive\u002Fidea",[72,339,37,340,10,32],12,"maker\u002Fpositive\u002Fexecution",[342,343,37,344,223,37],"18682015",13,"other\u002Fneutral\u002Fprivacy",[346,347,37,252,348,37],"18683679",14,"tootie",[157,350,41,299,158,37],15,[352,350,37,299,10,32],"18680619",[354,350,37,355,10,32],"18682262","project\u002Fneutral\u002Fdocs",[357,180,41,305,358,37],"18681343","pspeter3",[360,180,37,361,10,32],"18681458","maker\u002Fpositive\u002Fidea",[363,180,41,305,364,37],"18683123","lmkg",[366,367,41,207,368,37],"18682611",17,"revskill",[370,371,32,273,372,37],"18679878",18,"zyx321",[374,371,37,337,10,32],"18679938",[376,371,41,196,377,37],"18680149","sudhirj",[379,380,41,355,381,37],"18677663",19,"ApolloRising",[383,380,37,384,10,32],"18678620","maker\u002Fpositive\u002Fdocs",[],[387,392,396,400,405,410],{"id":388,"name":389,"points":390,"category":391},"18697601","remove.bg",640,"creative",{"id":393,"name":394,"points":395,"category":391},"18701772","Fancy fonts (Beautiful Dingbats)",247,{"id":397,"name":398,"points":399,"category":19},"18710094","DPAGE",161,{"id":401,"name":402,"points":403,"category":404},"18705661","Goldpinger",158,"infrastructure",{"id":406,"name":407,"points":408,"category":409},"18704436","Bubblin",138,"productivity",{"id":411,"name":412,"points":413,"category":414},"18670786","Vaex",126,"data",false,"v2",{"id":418,"name":5,"line":5,"ai":415,"cat":19,"year":12,"points":13,"comments":14,"rec":27,"s":419,"top":17,"kw":420,"maker":10,"domain":9,"tier":18,"attempts":37,"strip":421,"url":8,"mix":422,"praise":79,"objection":99,"sub":20},18673928,-0.11,[23,24,25,26],"0033333331100500113333333130313503033133",[30,31,32,33],1794036572697]