12 ms·
How Bear does analytics with CSS
- victorbjorklund 3y agoThis does make sense! Might try it for my own analytics solution. Anyone can think of a downside of this vs js?
- berkes 3y agoI can think of many "downsides" but whether those matter or are actually upsides really depends on your use-case and perspective. * You cannot (easily) track interaction events (esp. relevant for SPAs, but also things like "user highlighted x" or "user typed Y, then backspaced then typed Z)" * You cannot track timings between events (e.g. how long a user is on the page) * You cannot track data such as screen-sizes, agents, etc. * You cannot track errors and exceptions.
- user20231101 3y agoSmart approach!
- nannal 3y ago> And not just the bad ones, like Google Analytics. Even Fathom and Plausible analytics struggle with logging activity on adblocked browsers. I believe that's as they're trying to live in what amounts to a toxic wasteland. Users like us are done with the whole concept and as such I assume if CSS analytics becomes popular, then attempts will be made to bypass that too.
- account-5 3y agoMakes me reminiscent of uMatrix which could block the loading of CSS too.
- momentary 3y agoIs uMatrix not in vogue any more? It's still my go to tool!
- account-5 3y agoIt's not actively developed anymore so I've been using ublocks advanced options which are good but not as good as uMatrix was.
- its-summertime 3y ago||somesite.example^$css would work in ublock
- account-5 3y agoI didn't know this. But with uMatrix you could default to all websites and then whitelist those you wanted it for. At least that's the way I used it and uBlock advanced user features.
- berkes 3y agoWhy? I manually unblocked Piwik/Matomo, Plausible and and Fathom from ublock. I don't see any harm in what and how these track. And they do give the people behind the site valuable information "to improve the service". e.g. Plausible collects less information on me than the common nginx or Apache logs do. For me, as blogger, it's important to see when a post gets on HN, is linked from somewhere and what kinds of content are valued and which are ignored. So that I can blog about stuff you actually want to read and spread it through channels so that you are actually aware of it.
- morelisp 3y agoYou're just saying a smaller-scale version of "as a publisher it's important for me to collect data on my audience to optimize my advertising revenue." The adtech companies take the shit for being the visible 10% but publishers are consistently the ones pressuring for more collection.
- ordersofmag 3y agoI'm a website 'publisher' for a non-profit that has zero advertising on our site. Our entire purpose for collecting analytics is to make the site work better for our users. Really. Folks like us may not be in the majority but it's worth keeping in mind that "analytics = ad revenue optimization" is over-generalizing.
- morelisp 3y agoI'm sure your stated 13 years of data is absolutely critical to optimize your page load times.
- ordersofmag 3y agoOf course analytics from 13 years ago doesn't help us optimize page load times. But it is extremely useful to notice that content that has gotten deep use steadily for a decade suddenly doesn't. Then you know to take a closer look at the specific content. Perhaps you see that the external resource that it depended on went offline and so you can fix it. Or perhaps you realize that you need to reprioritize navigation features on the site so that folks can better find the stuff they are digging for which should no longer include that resource. We have users that engage over decades and content use patterns that play out over years (not months). And understanding those things informs changes we make to our site that make it better for users. Perhaps this is outside your world of experience, but that doesn't mean it isn't true. And we also gather data to help optimize page load times.....
- marban 3y agoPlausible still works if you reverse-proxy the script and the event url through your own /randompath.
- chrismorgan 3y agoThis approach is no harder to block than the JavaScript approaches: you’re just blocking requests to certain URL patterns.
- nannal 3y agoThat approach would work until analytics gets mixed in with actual styles and then you're trying to use a website without CSS.
- chrismorgan 3y agoYou’re blocking the image, not the CSS. Here’s a rule to catch it at present: ||bearblog.dev/hit/ This is the shortest it can be written with certainty of no false positives, but you can do things like making the URL pattern more specific (e.g. /hit/*/) or adding the image option (append $image) or just removing the ||bearblog.dev domain filter if it spread to other domains as well (there probably aren’t enough false positives to worry about). I find it also worth noting that all of these techniques are pretty easily circumventable by technical means, by blending content and tracking/ads/whatever. In case of all-out war, content blockers will lose. It’s just that no one has seen fit to escalate that far (and in some cases there are legal limitations, potentially on both sides of the fight).
- macNchz 3y ago> In case of all-out war, content blockers will lose. It’s just that no one has seen fit to escalate that far (and in some cases there are legal limitations, potentially on both sides of the fight). The Chrome Manifest v3 and Web Environment Integrity proposals are arguably some of the clearest steps in that direction, a long term strategy being slow-played to limit pushback.
- ben_w 3y agoThe bit of the web that feels to me like a toxic wasteland is all the adverts; the tracking is a much more subtle issue, where the damage is the long-term potential of having a digital twin that can be experimented on to find how best to manipulate me. I'm not sure how many people actually fear that. Might get responses from "yes, and it's creepy" to "don't be daft that's just SciFi".
- input_sh 3y agoNothing's gonna block your webserver's access.log fed into an analytics service. If anything, you're gonna get numbers that are inflated because it's a bit impossible to dismiss all of the bot traffic just by looking at user agents.
- mcny 3y agoOn the topic of analytics, how do you store them? Let's say I have an e-commerce website, with products I want to sell. In addition to analytics, I decide to log a select few actions myself such as visits to product detail page while logged in. So I want to store things like user id, product id, timestamp, etc. How do I actually store this? My naive approach is to stick it in a table. The DBA yelled at me and asked how long I need data. I said at least a month. They said ok and I think they moved all older data to a different table (set up a job for it?) How do real people store these logs? How long do you keep them?
- ludwigvan 3y agoClickHouse
- jon-wood 3y agoUnless you’re at huge volume you can totally do this in a Postgres table. Even if you are you can partition that table by date (or whatever other attributes make sense) so that you don’t have to deal with massive indexes. I once did this, and we didn’t need to even think about partitioning until we hit a billion rows or so. (But partition sooner than that, it wasn’t a pleasant experience)
- n_e 3y agoAn analytics database is better (clickhouse, bigquery...). They can do aggregations much faster and can deal with sparse/many columns (the "paid" event has an "amount" attribute, the "page_view" event has an "url" attribute...)
- ordersofmag 3y agoWe've got 13 years worth of data stored in mysql (5 million visitor/year). It's a pain to query there so we keep a copy in clickhouse as well (which is a joy to query).
- mcny 3y agoI only track visits to a product detail page so far. Basically, some basic metadata about the user (logged in only), some metadata about the product, and basic "auditing" columns -- created by, created date, modified by, modified date (although why I have modified by and modified date makes no sense to me, I don't anticipate to ever edit these, they're only there for "standardization". I don't like it but I can only fight so many battles at a time). I am approaching 1.5 million rows in under two months. Thankfully, my DBA is kind, generous, and infinitely patient. Clickhouse looks like a good approach. I'll have to look into that. > select count(*) from trackproductview; > 1498745 > select top 1 createddate from TrackProductView order by createddate asc; > 2023-08-18 11:31:04.000 what is the maximum number of rows in clickhouse table? Is there such a limit?
- Wouter33 3y agoNice implementation! Just a heads-up, hashing the ip like that is still considered tracking under GDPR and requires a privacy banner in the EU.
- thih9 3y agoCan you explain why or link a source? I’d like to learn the details.
- fizzbuzz-rs 3y agoLikely because the hash of an IP can easily be reversed as there are only ~2^32 IPv4 addresses.
- openplatypus 3y agoIt is not just that. Having user IP and such a hashing approach you can re-identify past sessions.
- thih9 3y agoWhat if my hashing function has high likelihood of collisions?
- firtoz 3y agoThen you cannot trust the analytics
- thih9 3y agoDo you trust analytics that doesn’t use JS? Or relies on mobile users to scroll the page before counting a hit? It’s all a heuristic and even with high collision hashing, analytics would provide some additional insight.
- rjmunro 3y agoYou can estimate the actual numbers based on the collision rate. Analytics is not about absolute accuracy, it's about measuring differences; things like which pages are most popular, did traffic grow when you ran a PR campaign etc.
- p4bl0 3y agoThe :hover pseudo-class could be applied and unapplied multiple times for a single page load. This can certainly be mitigated using cache related http headers but then if the same page is visited by the same person a second time coming from the same referrer, the analytics endpoint won't be loaded. But maybe I'm not aware that browsers guarantee that "images" loaded using url() in CSS will be (re)loaded exactly once per page?
- kevincox 3y agoI'm not sure about `url()` in CSS but `<img>` tags are guaranteed to only be loaded once per URL per page. I would assume that `url()` works the same. This bit me when I tried to make a page that reload an image as a form of monitoring. However URL interestingly includes the fragment (after the #) even though it isn't set to the server. So I managed to work around this by appending #1, #2, #3... to the image URL. https://gitlab.com/kevincox/image-monitor/-/blob/e916fcf2f9ab1aabce13088f89c0ca0b798f5c8c/lib/index.js#L37 https://gitlab.com/kevincox/image-monitor/-/blob/e916fcf2f9a...
- alabhyajindal 3y agoWow, I didn't know you could trigger a URL endpoint with CSS!
- dontlaugh 3y agoWhy not just get this info from the HTTP server?
- victorbjorklund 3y agoHard if you run serverless
- dontlaugh 3y agoThere's still a server somewhere and it can log URLs and IPs.
- tmikaeld 3y agoNot if it's static generated html/css. And the real benefit of this trick is separating users from bots.
- throwaway290 3y agoStatically generated HTML+CSS doesn't mean a server is not required, learn basic networking.
- berkes 3y agoAnd even if there are many servers (a CDN or distributed caching) you can collect and merge these.
- victorbjorklund 3y agoTell me how to collect the logs for static sites on Cloudflare Pages (not functions. The Pages sites)
- berkes 3y agoCloudflare Pages are running on servers. These servers (can, quite certainly will) have logs. That you cannot access the logs because you don't own the servers doesn't mean there aren't any servers that have logs.
- jackjeff 3y agoThe whole anonymization of IP addresses by just hashing the date and IP is just security theater. Cryptographic hashes are designed to be fast. You can do 6 billion md5 hashes in a second on an MacBook (m1 pro) via hashcat and there’s only 4 billion ipv4 addresses. So you can brute force the entire range and find the IP address. Basically reverse the hash. And that’s true even if they used something secure like SHA-256 instead of broken MD5
- berkes 3y agoMaybe they use a secret salt or rotating salt? The example code doesn't, so I'm afraid you are right. But one addition and it can be made reasonable secure. I am afraid, however, that this security theater is enough to pass many laws, regulations and such on PII.
- ktta 3y agoNot if they use a password hash like Argon2 or scrypt
- freitasm 3y ago"The only downside to this method is if there are multiple reads from the same IP address but on separate devices, it will still only be seen as one read. And I'm okay with that since it constitutes such a minor fragment of traffic." Many ISPs are now using CG-NAT so this approach would miscount thousands of visitors seemingly coming from a single IP address.
- colesantiago 3y agoHow would one block this from tracking you? I think we would either need to send fake data to these analytics tools deliberately like https://adnauseam.io/ https://adnauseam.io/ Or now include CSS as a spy tracker that needs to be blocked.
- Kiro 3y agoI don't see how this is more intrusive for privacy than what you can already get from access logs.
- colesantiago 3y agoIt is still tracking you so it needs to be blocked.
- Kiro 3y agoSo are access logs. How are you going to block those?
- colesantiago 3y agoI never said anything about access logs, I specifically mentioned this CSS trick that will become popular for ad companies to track people. For this, this would need to block the endpoint or send obfuscated data deliberately in protest of this. Should you want to cover access logs also, then forms of tracking then sending excessive, random obfuscation data with adnauseam would also help here. https://adnauseam.io/ https://adnauseam.io/
- jokethrowaway 3y agoI sure hope you're being sarcastic here and illustrating the ridiculousness of privacy extremists (who, btw, ruined the web, thanks to a few idiot politicians in the EU). If not, what's wrong with a service knowing you're accessing it? How can they serve a page without knowing you're getting a page?
- meiraleal 3y agoInteresting approach but what about mobile users?
- welpo 3y agoFrom the article: > Now, when a person hovers their cursor over the page (or scrolls on mobile) it triggers body:hover which calls the URL for the post hit
- cantSpellSober 3y agoIt doesn't do that though. > The :hover pseudo-class is problematic on touchscreens. Depending on the browser, the :hover pseudo-class might never match https://developer.mozilla.org/en-US/docs/Web/CSS/:hover https://developer.mozilla.org/en-US/docs/Web/CSS/:hover Don't take my word for it. Trying it in mobile emulators will have the same result.
- rzmmm 3y ago> Now, when a person hovers their cursor over the page (or scrolls on mobile)... I can imagine many cases where real human user doesn't scroll the page on mobile platform. I like the CSS approach but I'm not sure it's better than doing some bot filtering with the server logs.
- deleted 3y ago[deleted]
- freitzzz 3y agoI attempted to do this back at the start of this year, but lost motivation building the web ui. My trick is not CSS but simply loading fake images with <img> tags: https://github.com/nolytics https://github.com/nolytics
- openplatypus 3y agoThe CSS tracker is as useful as server log-based analytics. If that is the information you need, cool. But JS trackers are so much more. Time spent on the website, scroll depth, screen sizes, some limited and compliant and yet useful unique sessions, those things cannot be achieved without some (simple) JS. Server side, JS, CSS... No one size fits all. Wide Angle Analytics has strong privacy, DNT support, an opt-out mechanism, EU cloud, compliance documentation, and full process adherence. Employs non-reversible short-lived sessions that still give you good tracking. Combine it with custom domain or first-party API calls and you get near 100% data accuracy.
- croes 3y agoIf it's an US company then EU cloud doesn't matter regarding data protection for EU citizens. The Cloud Act rendered that worthless.
- openplatypus 3y agoWide Angle Analytics is German company operating everything on EU cloud (EU owners, EU location).
- EspressoGPT 3y agoYou probably even could analyze screen sizes by doing the same thing but with CSS media queries.
- TekMol 3y agoThe CSS tracker is as useful as server log-based analytics. It is not. Have you read the article? The whole point of the CSS approach is to weed out user agents which are not doing mouse hover on the body events. You can't see that from server logs.
- jokethrowaway 3y agoLovely technique and probably more than adequate for most uses. My scraping bots use an instance of chrome and therefore trigger hover as well, but you'll cut out the less sophisticated bots. This is because of protection systems, if I try to scrape my target website with just code I just get insta banned / "captched".
- jerbear4328 3y agoAre you sure? Even if you run a headless browser, you might not be triggering the hover event, unless you specifically tell it to or your framework simulates a virtual mouse that triggers mouse events and CSS. You totally could be triggering it, but not every bot will, even the fancy ones.
- fatih-erikli 3y agoThis is known as "pixel tracker" for decades.
- cantSpellSober 3y agoUsed in emails as well. Loading a 1x1 transparent <img> is a more sure thing than triggering a hover event, but ad-blockers often block those
- t0astbread 3y agoOccasionally I've seen people fail and add the pixel as an attachment instead.
- blacksmith_tb 3y agoTrue, though doing it in CSS does have a couple of interesting aspects, using :hover would filter out bots that didn't use a full-on webdriver (most bots, that is). I would think that using an @import with 'supports' for an empty-ish .css file would be better in some ways (since adblockers are awfully good at spotting 1px transparent tracking pixels, but less likely to block .css files to avoid breaking layouts), but that wouldn't have the clever :hover benefits.
- chrismorgan 3y agoI’d like to see a comparison of the server log information with the hit endpoint information: my feeling is that the reasons for separating it don’t really hold water, and that the initial request server logs could fairly easily be filtered to acceptable quality levels, obviating the subsequent request. The basic server logs include declared bots, undeclared bots pretending to use browsers, undeclared bots actually using browsers, and humans. The hit endpoint logs will exclude almost all declared bots, almost all undeclared bots pretending to use browsers, and some humans, but will retain a few undeclared bots that search for and load subresources, and almost all humans. About undeclared bots that actually use browsers, I’m uncertain as I haven’t inspected how they are typically driven and what their initial mouse cursor state is: if it’s placed within the document it’ll trigger, but if it’s not controlled it’ll probably be outside the document. (Edit: actually, I hadn’t considered that bearblog caps the body element’s width and uses margin, so if the mouse cursor is not in the main column it won’t trigger. My feeling is that this will get rid of almost all undeclared bots using browsers, but significantly undercount users with large screens.) But my experience is that reasonably simple heuristics do a pretty good job of filtering out the bots the hit endpoint also excludes. • Declared bots: the filtration technique can be ported as-is. • Undeclared bots pretending to use browsers: that’s a behavioural matter, but when I did a little probing of this some years ago, I found that a great many of them were using unrealistic user-agent strings, either visibly wonky or impossible or just corresponding to browsers more than a year old (which almost no real users are using). I suspect you could get rid of the vast majority of them reasonably easily, though it might require occasional maintenance (you could do things like estimate the browser’s age based on their current version number and release cadence, with the caveat that it may slowly drift and should be checked every few years) and will certainly exclude a very few humans. • Undeclared bots actually using browsers: this depends on the unknown I declared, whether they position their mice in the document area. But my suspicion is that these simply aren’t worth worrying about because they’re not enough to notably skew things. Actually using browsers is expensive, people avoid it where possible. And on the matter of humans, it’s worth clarifying that the hit endpoint is worse in some ways, and honestly quite risky: • Some humans will use environments that can’t trigger the extra hit request (e.g. text-mode browsers, or using some service that fetches and presents content in a different way); • Some humans will behave in ways that don’t trigger the extra hit request (e.g. keyboard-only with no mouse movement, or loading then going offline); • Some humans will block the extra hit request; and if you upset the wrong people or potentially even become too popular, it’ll make its way into a popular content blocker list and significant fractions of your human base will block it. This, in my opinion, is the biggest risk. • There’s also the risk that at some point browsers might prefetch such resources to minimise the privacy leak. (Some email clients have done this at times, and browsers have wrestled from time to time with related privacy leaks, which have led to the hobbling of what properties :visited can affect, and other mitigations of clickjacking. I think it conceivable that such a thing could be changed, though I doubt it will happen and there would be plenty of notice if it ever did.) But there’s a deeper question to it: if you don’t exclude some bots; or if the URL pattern gets on a popular content filter list: does it matter? Does it skew the ratios of your results significantly? (Absolute numbers have never been particularly meaningful or comparable between services or sources: you can only meaningfully compare numbers from within a source.) My feeling is that after filtering out most of the bots in fairly straightforward ways, the data that remains is likely to be of similar enough quality to the hit endpoint technique: both will be overcounting in some areas and undercounting in others, but I expect both to be Good Enough, at which point I prefer the simplicity of not having a separate endpoint. (I think I’ve presented a fairly balanced view of the facts and the risks of both approaches, and invite correction in any point. Understand also that I’ve never tried doing this kind of analysis in any detail, and what examination and such I have done was almost all 5–8 years ago, so there’s a distinct possibility that my feelings are just way off base.)
- p4bl0 3y agoI have a genuine question that I fear might be interpreted as a dismissive opinion but I'm actually interested in the answer: what's the goal of collecting analytics data in the case of personal blogs in a non-commercial context such as what Bearblog seems to be?
- Veen 3y agoCuriosity? I like to know if anyone is reading what I write. It's also useful to know what people are interested in. Even personal bloggers may want to tailor content to their audience. It's good to know that 500 people have read an article about one topic, but only 3 people read one about a different topic.
- mrweasel 3y agoFor the curiosity, one solution I've been pondering, but never gotten around to implementing is just logging the country of origin for a request, rather than the entire IP. IPs are useful in case of attack, but you could limit yourself to simply logging subnets. It's a little more aggressive block a subnet, or an entire ISP, but it seems like a good tradeoff.
- taurusnoises 3y agoI can speak to this from the writer's perspective as someone who has been actively blogging since c. 2000 and has been consistently (very) interested in my "stats" the entire time. The primary reason I care about analytics is to see if posts are getting read, which on the surface (and in some ways) is for reasons of vanity, but is actually about writer-reader engagement. I'm genuinely interested in what my readers resonate with, because I want to give them more of that. The "that" could be topical, tonal, length, who knows. It helps me hone my material specifically for my readers. Ultimately, I could write about a dozen different things in two dozen different ways. Obviously, I do what I like, but I refine it to resonate with my audience. In this sense, analytics are kind of a way for me to get to know my audience. With blogs that had high engagement, analytics gave me a sort of fuzzy character description of who my readers were. As with above, I got to see what they liked, but also when they liked it. Were they reading first thing in the morning? Were they lunch time readers? Were they late at night readers. This helped me choose (or feel better about) posting at certain times. Of course, all of this was fuzzy intel, but I found it really helped me engage with my readership more actively.
- colesantiago 3y agoIf you want to send obfuscated data on purpose to prevent this dark pattern behaviour from spreading I recommend Adnauseam. (not the creator, just a regular user of this great tool) We need more tools that send random, fake data to analytics providers which renders the analytics useless to them in protest of tracking. If there are any more like Adnauseam, I would love to know. https://adnauseam.io/ https://adnauseam.io/
- myfonj 3y agoSeems clever and all, but `body:hover` will most probably completely miss all "keyboard-only" users and users with user agents (assistive technologies) that do not use pointer devices. Yes, these are marginal groups perhaps, but it is always super bad sign seeing them excluded in any way. I am not sure (I doubt) there is a 100 % reliable way to detect that "real user is reading this article (and issue HTTP request)" from baseline CSS in every single user agent out there (some of them might not support CSS at all, after all, or have loading of any kind of decorative images from CSS disabled). There are modern selectors that could help, like :root:focus-within (requiring that user would actually focus something interactive there, what again is not guaranteed for al agents to trigger such selector), and/or bleeding edge scroll-linked animations (`@scroll-timeline`). But again, braille readers will probably remain left out.
- deleted 3y ago[deleted]
- demondemidi 3y agoKeyboard only users? All 10 of them? ;)
- myfonj 3y agoI think there might be more than ten [1] blind folks using computers out there, most of them not using pointing devices at all or not in a way that would produce "hover". [1] was it base ten, right?
- bayindirh 3y agoWell with me, it's probably 11. Joking aside, I love to read websites with keybaords, esp. if I'm reading blogs. So, it's possible that sometimes my pointer is out there somewhere to prevent distraction.
- zichy 3y agoThink about screen readers.
- vivekd 3y ago
- gizmo 3y ago> Even Fathom and Plausible analytics struggle with logging activity on adblocked browsers. The simple solution is to respect the basic wishes of those who do not want to be tracked. This is a "struggle" only because website operators don't want to hear no.
- reustle 3y agoAs much I agree with respecting folks wishes to not be tracked, most of these cases are not about "tracking". It's usually website hosts just wanting to know how many folks are passing through. If a visitor doesn't even want to contribute to incrementing a private visit counter by +1, then maybe don't bother visiting.
- deleted 3y ago[deleted]
- gizmo 3y agoIf it was just about a simple count the host could just `wc -l access.log`. Clearly website hosts are not satisfied with that, and so they ignore DO_NOT_TRACK and disrespectfully try to circumvent privacy extensions.
- jakelazaroff 3y agoIs there a meaningful difference between recording "this IP address made a request on this date" and "this IP address made a request on this date after hovering their cursor over the page body"? How is your suggestion more acceptable than what the blog describes?
- fdaslkjlkjklj 3y agoLooks like a clever way to do analytics. Would be neat to see how it compares with just munging the server logs since you're only looking at page views basically. re the hashing issue, it looks interesting but adding more entropy with other client headers and using a stronger hash algo should be fine.
- deleted 3y ago[deleted]
- HermanMartinus 3y agoHey, author here. For a bit of clarity around IP addresses hashes. The only use they have in this context is preventing duplicate hits in a day (making each page view unique by default). At the end of each day there is a worker job that empties them out while retaining the hit info. I've added an edit to the essay for clarity.
- dantiberian 3y agoYou should add this as a reply to the top comment as well.
- bosch_mind 3y agoIf 10 users share an IP on a shared VPN around the globe and hit your site, you only count that as 1? What about corporate networks, etc? IP is a bad indicator
- Culonavirus 3y agoIt's a bad indicator especially since people who would otherwise not use VPN apparently started using this: https://support.apple.com/en-us/102602 https://support.apple.com/en-us/102602
- Galanwe 3y agoNot even mentioning CGNAT.
- HermanMartinus 3y agoYep, this is covered in the writeup. Results are accurate enough to gauge whether your post is doing well or not (keep in mind that this is a simple analytics system for a small blogging platform). I also tested it in parallel with some other analytics platforms and it actually performed better due to the fact that adblockers are more prevalent than IP sharing per reader in this context.
- victorbjorklund 3y agoAnalytics doesnt need to be accurate. The important thing isnt really exact how many visitors etc. The important thing is trends. Do we have more users now than last week? Do we get more traffic from X than Y? If it is 1000 or 1034 isnt so important.
- scblock 3y ago[flagged]
- fishtoaster 3y agoThe idea of using CSS-triggered requests for analytics was really cool to me when I first encountered it. One guy on twitter (no longer available) used it for mouse tracking: overlay an invisible grid of squares on the page, each with a unique background image triggered on hover. Each background image sends a specific request to the server, which interprets it! For fun one summer, I extended that idea to create a JS-free "css only async web chat": https://github.com/kkuchta/css-only-chat https://github.com/kkuchta/css-only-chat
- willio58 3y agoNice implementation!
- joewils 3y agoThis is really clever and fun. I'm curious how the results compare to something "old school" like AWStats? https://github.com/eldy/awstats https://github.com/eldy/awstats
- stmblast 3y agoBearblog is AWESOME!! I use it for my personal stuff and it's great. No hassle, just paste your markdown in and you're good to go.
- swingingFlyFish 3y agoThis is a pretty clever use of CSS. Thanks for sharing.
- biermic 3y ago2 things to add: - I'd decouple the database writes with a message queue. - Make sure that table is partitioned if you haven't. TimescaleDB's hyper tables are a good compromise here if you are already using Postgres..
- rlnorthcutt 3y agoOh - that is freakin' amazing. - Using CSS to load an endpoint - clever - Hashing ip + date for anon tracking - thoughtful - Using :hover to ensure its a real user - genius