Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
4 replies
Jai

Analytics w/ RSC

Trying out the App Router for my blogsite.

My blogsite is mostly a static website and is a perfect candidate for RSC. However, I do a lot of tracking about interactions on my blog page - e.g. if you click a link to another blog post, I send an analytics event for a BUNCH of data. These events are sent on the onClick event handler of the <a> tag. Now the blog link is a completely static component that is perfect for RSC, but I also would have to send JS to do that tracking. How should I build this ? I hate to convert this to a client side component.

It feels weird to send Javascript w/ a component for purely tracking purposes that does nothing to the UX. A static link, on paper, should be the perfect candidate to send 0 JS w/ it.

P.S. I dont own the web server that receives the <a> requests so I cant do the tracking there. Plus this question is more around general tracking that happens on client side on various components.
Was this page helpful?