Conversation
| <meta charSet="utf-8" /> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
| <script defer data-domain="getalby.com" src="https://squirrel.getalby.com/js/plausible.js"></script> | ||
| <script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script> |
There was a problem hiding this comment.
we can not use window here because of remix (rendering things on the server)
I don't know yet how this would be done in the remix context
| function Install({ style }) { | ||
|
|
||
| function trackDownload() { | ||
| plausible('Download'); |
There was a problem hiding this comment.
this is not defined here because of the remix context. need to see how to define a window.plausible function.
There was a problem hiding this comment.
here's an example where they detect whether they're on the server and set an empty function as a fallback:
https://remix.run/docs/en/v1/guides/constraints#uselayouteffect
There was a problem hiding this comment.
This example also looks relevant, they fix a localstorage call (which has the same problem as window on the server): https://remix.run/docs/en/v1/guides/constraints#rendering-with-browser-only-apis
|
@bumi do you still want to track this in the Rails app? |
https://plausible.io/docs/custom-event-goals