Closed fxmb closed 1 year ago
Hi,
the most likely reason is that the script is executed before the elements have been rendered by react. The extended script looks for any elements on the page that have the pirsch-event
attribute and attaches an event listener to it. It takes a while until react has rendered the page, and since the script is only executed once, no handlers will be added.
I would recommend using the SDK for SPAs: https://github.com/pirsch-analytics/pirsch-js-sdk
This way you can send events from react and don't run into any weird timing issues.
@fxmb did you find a solution to your issue?
No this still does not work... the JS client also does not work. Pretty frustrating since we are paying customers and just follow the docs... Plausible just works out of the box...
I tried the JS SDK Client Side but also does not work for me unfortunately: #https://github.com/pirsch-analytics/pirsch-js-sdk/issues/23 is the issue I opened.
@fxmb can you please try upgrading to 2.4.1? npm i pirsch-sdk@2.4.1
. Also, please note that working with the SDK locally isn't really supported, in case that's what you're trying currently. On localhost, we recommend just logging events instead of calling pirsch.event(...)
and pirsch.hit(...)
.
In case you still don't see the data appearing on your dashboard, please ensure that your domain matches the one configured on the Pirsch dashboard. www.example.com and example.com are different domains to us, and we check the domain + identification code to ensure nobody sends data to your dashboard from a different domain.
You can also find a new SDK web demo here: https://github.com/pirsch-analytics/demo/tree/master/js-sdk-web
Ok,
npm i pirsch-sdk@2.4.1
. Identification code not found. Make sure it is correct and you're sending requests for the right domain or subdomain.
The hostname can be used to rewrite the URL, which has to match the domain configured on the Pirsch dashboard. Otherwise, it's optional.
See: https://github.com/pirsch-analytics/pirsch-js-sdk/issues/23#issuecomment-1745204331
Closing this. Let me know if you need further help. We can do a quick call if needed :+1:
pirsch-extended.js
script to my head like so:=> I get nothing in the local console => Nothing arrives in prod => I can see that the extended script loads correctly because we see customer download in production (which is only possible with the extend script according to the docs).
What are we missing?
Stack: React Nextjs Tailwind