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

Pass user ip to Matomo (currently Matomo sees the ip 10.1.0.101 from the nginx reverse proxy) #116

Closed
stephanegigandet opened this issue May 9, 2022 · 9 comments · Fixed by #117
Assignees

Comments

@stephanegigandet
Copy link
Contributor

analytics:/var/log/nginx# tail -f access.log | more
10.1.0.101 - - [09/May/2022:14:24:38 +0000] "POST /matomo.php?action_name=ch.openfoodfact
[s.org](http://s.org/)%2FChia%20Samen%20-%20Natur%20aktiv%20-%20250g&idsite=5&rec=1&r=673326&h=16&m=24&s=3
6&url=https%3A%2F%[2Fch.openfoodfacts.org](http://2fch.openfoodfacts.org/)%2Fprodukt%2F24081955%2Fchia-samen-natur-aktiv&ur
lref=https%3A%2F%[2Fwww.google.com](http://2fwww.google.com/)%2F&_id=&_idn=1&_refts=1652106277&_ref=https%3A%2F%2Fwww
.[google.com](http://google.com/)%2F&send_image=0&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=1536x
864&pv_id=eCwIfQ&pf_net=271&pf_srv=135&pf_tfr=36&pf_dm1=394 HTTP/1.0" 204 0 "https://ch.o/
[penfoodfacts.org/](http://penfoodfacts.org/)" "OFF ovh1 proxy"
10.1.0.101 - - [09/May/2022:14:24:38 +0000] "GET /matomo.js HTTP/1.0" 200 64132 "https://
[uk.openfoodfacts.org/](http://uk.openfoodfacts.org/)" "OFF ovh1 proxy"
10.1.0.101 - - [09/May/2022:14:24:38 +0000] "POST /matomo.php?action_name=dz-fr.openfoodf
[acts.org](http://acts.org/)%2Felio%20-%20Cevital%20-%205%C2%A0Litres&idsite=5&rec=1&r=088637&h=15&m=24&s=37&
url=https%3A%2F%[2Fdz-fr.openfoodfacts.org](http://2fdz-fr.openfoodfacts.org/)%2Fproduit%2F6130234001031%2Felio-cevital&_id=&_
idn=1&_refts=0&send_image=0&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=1680x
1050&pv_id=dcyxUZ&pf_net=0&pf_srv=134&pf_tfr=2 HTTP/1.0" 204 0 "https://dz-fr.openfoodfac/
[ts.org/](http://ts.org/)" "OFF ovh1 proxy"
@alexgarel
Copy link
Member

I followed https://matomo.org/faq/how-to-install/faq_98/

And modify matomo config. See #117 for the doc PR.

@alexgarel
Copy link
Member

It seems to me it's fixed, can you confirm @stephanegigandet

@stephanegigandet
Copy link
Contributor Author

@alexgarel It looks fixed, thank you. We now have individual visitors.

We still have a few visitors with thousands of views, I'm guessing they are robots.

e.g. a Russian visitor: "A passé un total de 10 heures 16 min sur le site web, et effectué 4274 actions (500 Vues de page) en 1 visites."

@alexgarel
Copy link
Member

@stephanegigandet for robots, in configuration there is a regexp against which the user agent is matched. If you know this user agent we can block it.

@stephanegigandet
Copy link
Contributor Author

@alexgarel : in Matomo, I can see the robots ip (first 2 bytes), but not the user agent, but maybe I didn't look well enough. For this robot, it says "Unknown browser".

@stephanegigandet
Copy link
Contributor Author

@alexgarel
Copy link
Member

Yep it can be that nginx strips some info…

@alexgarel alexgarel reopened this May 10, 2022
@alexgarel
Copy link
Member

There was a modification of user agent header in nginx proxy !
But that said it does not solve the problem, it seems matomo does not keeps raw user-agent.

@alexgarel
Copy link
Member

I close I verify for the user you say, but on nginx logs in off1, user agent is set to "" …

alexgarel added a commit that referenced this issue May 30, 2022
* docs: matomo is behind a reverse proxy

fixes #116

* fix: fix matomo error by running archival offline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants