electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 351 forks source link

No Data - Fails to track Data. #306

Closed REOLDEV closed 2 years ago

REOLDEV commented 2 years ago

🐞 Describe the bug

So, i Set it up via Docker on an Oracle Cloud Server; Web Webpage seems to work and i can call the tracker.js When i try to test it there is no data logged; I noticed that i dont get a "preflight" and also no api calls.

📚 To Reproduce

Installed Ackee v3.3.0 via Docker on an Ampere (ARM) Based server; Setup DNS via Cloudflare - no proxying; embedded the Tracking code on my Website

💡 Expected behavior

Counters should go up.

🖼️ Screenshots Webaufnahme_26-12-2021_162910_ackee reol dev B0WMEk1

⚙️ Environment

📋 Additional context I also tried it with an external MongoDB Collection - Database connection seems to work. Yes, i did the nginx proxying thing with a "*" Wildcard for CORS

carvalholeo commented 2 years ago

Hello!

Could you show us the code snippet where JS tag it's been called? It seems that tracker is loaded (as you show into your screenshot), but not executed.

REOLDEV commented 2 years ago

I implemented it into a Software called "Woltlab Suite Core";

<script async="" src="https://ackee.reol.dev/tracker.js" data-ackee-server="https://ackee.reol.dev" data-ackee-domain-id="2d140384-c944-44b0-8a75-6c574dee8d75" data-ackee-opts="{ 'ignoreOwnVisits': false, 'detailed': true}"></script>

ChC4ZhD

REOLDEV commented 2 years ago

Okay.. i tried it with an Blank HTML File; Now it loads and i get CORS Errors... i hate cors (Because i dont understand it lol)

"Access to XMLHttpRequest at 'https://ackee.reol.dev/api' from origin 'https://sa-mp.cc/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains the invalid value '1'."

`map $http_origin $origin_allowed { default 0; https://sa-mp.cc 1; .sa-mp.cc 1; reol.dev 2; .reol.dev 2;

... add more allowed origins here

    }

server {

server_name ackee.reol.dev;

location / {

    add_header Access-Control-Allow-Origin "$origin_allowed" always;

`

REOLDEV commented 2 years ago

After several days of ramming my head into the table.. i found the solution...

add_header Access-Control-Allow-Origin "$origin_allowed" always; to add_header Access-Control-Allow-Origin "$http_origin" always;

Now i only have to fix the bug with Woltlab

electerious commented 2 years ago

@REOLDEV Great to hear that you found a solution. I'm closing this issue, because it seems to be a server configuration issue, not an issue of Ackee itself.

Here are a few more related resources: https://github.com/electerious/Ackee/blob/master/docs/CORS%20headers.md https://github.com/electerious/Ackee/blob/master/docs/SSL%20and%20HTTPS.md