littlelink-server icon indicating copy to clipboard operation
littlelink-server copied to clipboard

[BUG REPORT] Button event tracking for Umami does not show up in dashboard

Open jhademcconnell opened this issue 1 year ago • 4 comments

Buttons Relation

All buttons, including custom buttons

Bug Description

When including the 3 environment variables for Umami in the Dockerfile, the "name-button" events do not show up in the Umami dashboard:

  • ENV UMAMI_WEBSITE_ID removed
  • ENV UMAMI_APP_URL removed
  • ENV UMAMI_SCRIPT_NAME script.js

Umami is set up since I am able to see stats come through. Event tracking is missing for buttons though.

Expected Result

Event tracking for the buttons should show up in the events tab when providing the UMAMI_WEBSITE_ID and the UMAMI_APP_URL.

Additional Information

No response

Images

No response

jhademcconnell avatar Dec 26 '23 23:12 jhademcconnell

I've got the same issue - setup umami and normal tracking is working fine, but no event data is being tracked. Any update on this please? Thanks.

jgibbarduk avatar Jan 16 '24 11:01 jgibbarduk

Sorry, I don't run umami so it's going to be up to someone who does to help with this one. One thing to check and verify is which events are getting sent (if any) in your browsers dev tools. It would help if someone could post the URL endpoint that event is calling along with the JSON payload and response. That might help others understand where the issue lies.

timothystewart6 avatar Jan 16 '24 15:01 timothystewart6

This exception is raised when clicking a button if you're using Umami:

Uncaught TypeError: window.umami is not a function
    at onClick (umami.js:2:10)
    at Object.Ec (react-dom.production.min.js:54:317)
    at Fc (react-dom.production.min.js:54:471)
    at react-dom.production.min.js:55:35
    at kn (react-dom.production.min.js:105:68)
    at An (react-dom.production.min.js:106:380)
    at react-dom.production.min.js:117:104
    at Jo (react-dom.production.min.js:274:42)
    at wc (react-dom.production.min.js:52:375)
    at _n (react-dom.production.min.js:109:469)
onClick @ umami.js:2
Ec @ react-dom.production.min.js:54
Fc @ react-dom.production.min.js:54
(anonymous) @ react-dom.production.min.js:55
kn @ react-dom.production.min.js:105
An @ react-dom.production.min.js:106
(anonymous) @ react-dom.production.min.js:117
Jo @ react-dom.production.min.js:274
wc @ react-dom.production.min.js:52
_n @ react-dom.production.min.js:109
Ge @ react-dom.production.min.js:74
Ue @ react-dom.production.min.js:73
Show 11 more frames
Show less

jhademcconnell avatar Jan 19 '24 00:01 jhademcconnell

Thank you! This is helpful!

timothystewart6 avatar Jan 19 '24 00:01 timothystewart6

Doing some necro here. I've probaly found the issue.

In littlelink-server/src/analytics/umamis.js , you should change window.umami(e) by umami.track(e)

EkielZan avatar Apr 15 '24 21:04 EkielZan

@timothystewart6, I can fork and do the change though if you don't have time. Although I'm not a nodejs dev so it may require some confirmation

EkielZan avatar Apr 15 '24 21:04 EkielZan

Tested it locally and on production umami, everything working flawlessly https://github.com/techno-tim/littlelink-server/pull/603

kdurek avatar Apr 16 '24 14:04 kdurek

closed by https://github.com/techno-tim/littlelink-server/pull/603

timothystewart6 avatar Apr 16 '24 22:04 timothystewart6