Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not working for me #6

Open
tldev-de opened this issue Jul 9, 2024 · 3 comments
Open

Plugin not working for me #6

tldev-de opened this issue Jul 9, 2024 · 3 comments

Comments

@tldev-de
Copy link

tldev-de commented Jul 9, 2024

Hey there,

thanks for this nice plugin! I love the idea to track activity server-side right in traefik with umami :)

I installed the plugin using cli parameters:

      - "--experimental.plugins.traefik-umami-plugin.modulename=github.com/1cedsoda/traefik-umami-plugin"
      - "--experimental.plugins.traefik-umami-plugin.version=v1.0.3"

Unfortunately I can't get it to work! This if my configuration:

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.xyz.rule=(Host(`xyz.blog`) || Host(`www.xyz.blog`))"
      - "traefik.http.routers.xyz.tls=true"
      - "traefik.http.routers.xyz.tls.certresolver=letsencrypt"
      - "traefik.http.routers.xyz.middlewares=xyz_tracking"
      - "traefik.http.services.xyz.loadbalancer.server.port=2368"
      - "traefik.http.middlewares.xyz_tracking.plugin.traefik-umami-plugin.umamiHost=umami:3000"
      - "traefik.http.middlewares.xyz_tracking.plugin.traefik-umami-plugin.websiteId=57529274-67e8-47b9-a9e1-a9fc0b811xyz"
      #- "traefik.http.middlewares.xyz_tracking.plugin.traefik-umami-plugin.serverSideTracking=true"
      #- "traefik.http.middlewares.xyz_tracking.plugin.traefik-umami-plugin.serverSideTrackingMode=notinjected"

It's not working with all four middleware parameters as well as the first two (umamiHost + websiteId).

My traefik logs show only these lines:

time="2024-07-09T13:03:30Z" level=info msg="[traefik-umami-plugin] config: {"forwardPath":"_umami","umamiHost":"umami:3000","websiteId":"57529274-67e8-47b9-a9e1-a9fc0b811671","autoTrack":true,"doNotTrack":false,"cache":false,"domains":[],"evadeGoogleTagManager":false,"scriptInjection":true,"scriptInjectionMode":"tag","serverSideTracking":false,"serverSideTrackingMode":"all"}"
time="2024-07-09T13:03:30Z" level=info msg="[traefik-umami-plugin] script: <script async defer data-host-url='/_umami' src='/_umami/script.js' data-website-id='57529274-67e8-47b9-a9e1-a9fc0b811671' data-auto-track='true'></script>"

but:

  • there is no script tag inserted into the html
  • there is no activity in umami visible (0 views, 0 visitors, ...)

best regards
Tobi

@uuksu
Copy link

uuksu commented Aug 15, 2024

Hey @tldev-de!

I have a identical setup to yours and had exactly the same problem. The problem is that the umamiHost configuration is not actually hostname but a url. It should be in your case http://umami:3000.

This should be fixed either in code to include the protocol or by changing the documentation to correspond to what the value should actually be.

@tldev-de
Copy link
Author

@uuksu I just tried it, but it's not working 🤔 Can you show me some details about your working example?

@uuksu
Copy link

uuksu commented Aug 21, 2024

@tldev-de

Interesting parts from my configuration are this in static configuration:

- "--experimental.plugins.traefik-umami-plugin.moduleName=github.com/1cedsoda/traefik-umami-plugin"
- "--experimental.plugins.traefik-umami-plugin.version=v1.0.3"

and this in dynamic configuration

- "traefik.http.middlewares.umami-middleware.plugin.traefik-umami-plugin.umamiHost=http://umami:3000"
- "traefik.http.middlewares.umami-middleware.plugin.traefik-umami-plugin.websiteId=a904b409-c760-4108-9ae9-85d6e7fb388d"

With this configuration I got the injection working. I also noticed that browser might cache version where the injection has not been made, so ctrl+F5 is your friend.

I'm sorry, but I can't help you more, because I decided to not use the plugin as it's too broken for production use. I wish it would work better as the idea is so good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants