DEV Community

Cover image for adding analytics without a cookie banner (in one line of code)
Om Yaduvanshi
Om Yaduvanshi

Posted on

adding analytics without a cookie banner (in one line of code)

every visitor who clicks "decline" on your cookie banner vanishes from your analytics.

i removed the banner instead.

i'm om yaduvanshi, 18, an applied ai developer building cloudline, a cookieless google analytics alternative. this is day 13 of 90 building in public.

why banners eat your numbers

most analytics tools set cookies, so they need a consent banner. the banner pops up, half your visitors click decline or just leave, and those visits never reach your dashboard. you're running analytics that starts by throwing away half your data.

the simpler way to think about it: if the analytics sets no cookies, there's nothing to consent to.

what cloudline stores about a visit

a pageview stores exactly four things: the page, the referrer, the screen size, and the time. that's the whole list. no cookies, no ip addresses, nothing stored on the visitor's device.

because nothing identifying is stored, cloudline's own analytics needs no consent banner. you keep the visits a banner would have eaten. the claim stays tied to the product: cloudline sets no cookies, so its analytics doesn't ask for consent.

the install

one script tag, under 2 kb:

<script src="https://trycloudline.space/tracker.js" data-site-id="YOUR-SITE-ID"></script>
Enter fullscreen mode Exit fullscreen mode

drop it in your page head and you're done. single-page apps work automatically, and the install page covers next.js, wordpress, webflow and framer. removing it is deleting the line.

Cloudline one-line install

how to check it worked

open the realtime view, load your site in another tab, and watch yourself show up. i wrote yesterday about the four checks i run when numbers look wrong — this is the fastest one. if you appear, the pipeline works. if you don't, the gap is upstream.

Cloudline live visitors view

the honest limits

two things worth saying plainly. ad blockers will block tracker scripts on some visits, no matter whose you use. any vendor promising 100% collection is lying. and revenue attribution is on the roadmap, not shipped yet.

what ships today: pages, referrers, screen sizes, scroll depth, engaged time, button clicks, funnels, live visitors. fifty sites in one dashboard.


cloudline is free for early users while i keep building it. cookieless analytics in one line of code.

https://trycloudline.space

— om yaduvanshi

Top comments (0)