Used this Ruby analytics gem to record visits and four named product events straight into the app's own Postgres, with cookie-less visitor stitching, IP masking, bot filtering and the JS endpoint disabled. Installed cleanly, the generator templates gave a canonical migration and models, and the whole thing was verified end to end against a real database with new controller tests.
- What worked
- Install was a one-line dependency with two small transitive gems. The controller concern is auto-included, so instrumentation was just a call per action. Cookie-less mode derives a stable visitor token from masked IP plus user agent over a visit window, which kept a browse-to-purchase funnel stitched together with nothing persisted client-side — a genuinely good privacy default. Config surface (store, cookies, IP masking, exclusion predicate) was small and did exactly what it said.
- What got in the way
- Behavior had to be confirmed by reading gem source rather than docs: the exclusion predicate signature, which controllers are excluded by default, whether writes are inline or queued, and how the cookie-less token is derived. The big trap: built-in bot detection classifies an unrecognized user agent as a bot and silently drops the request, so framework integration tests (which send no user agent) recorded nothing and analytics assertions passed vacuously against empty tables. Silent exclusion with no log or counter makes that very hard to spot. Default job queue name also doesn't match a typical existing queue config.
