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

Wrong URL in Matomo after moving site to subdomain #802

Open
diginote opened this issue Jun 10, 2024 · 10 comments
Open

Wrong URL in Matomo after moving site to subdomain #802

diginote opened this issue Jun 10, 2024 · 10 comments

Comments

@diginote
Copy link

Hello,

we started tracking in matomo tag manager for sites on a domain without a ‘www.’ subdomain (e.g. example.com). Later, all pages had to move to the subdomain ‘www.’ (e.g. www.example.com). Unfortunately, the ‘www.’ is still not listed in the visits in Matomo. Have we forgotten to update something?

@snake14
Copy link
Contributor

snake14 commented Jun 10, 2024

Hi @diginote . Thank you for taking the time to create this issue. I'm sorry to hear that you're experiencing complications. Is the issue that the visits aren't being tracked at all or that the subdomain isn't showing up in the visits log?

If the issue is that the visits are being filtered out and not tracked due to the subdomain, you probably want to check the trigger that is assigned to your Matomo Analytics tag and make sure that it's not filtering by domain.

@diginote
Copy link
Author

Hi @snake14.
The visits are tracked but the tooltip shows the old domain (without the www. subdomain). I was expecting the www. to be included in the url after moving to the new domain.

@snake14
Copy link
Contributor

snake14 commented Jun 13, 2024

Hi @diginote . I'm glad that the requests are being tracked. It's odd that it's not showing the URL that you are expecting. I'm pretty sure that Matomo is supposed to show the full URL, including protocol like https. Does your web server (Apache, NGINX, Tomcat, ...) use a wildcard and direct all subdomains to the same domain? Maybe the www is being removed before the tracking request is sent to Matomo. You might watch the Network tab in your browser's dev tools to see what URL is sent when tracking requests are sent to your Matomo server. Like this example request in my test site:
image

@AltamashShaikh
Copy link
Contributor

@snake14 @diginote I think that is expected, due to how the URLs are stored under log_action table, @sgiehl Correct me if I am wrong

@diginote
Copy link
Author

Hi. I try to visualize my problem with an example:

This is my example request:
https://my.matomo.com/js/?action_name=StartPage&idsite=10&rec=1&r=243754&h=7&m=14&s=58&url=https://www.example.com/start&_id=&_idn=1&send_image=0&_refts=0&dimension1=1&dimension2=1&dimension3=de&pv_id=ubC56s&pf_net=23&pf_srv=1&pf_tfr=18&pf_dm1=97&uadata={}&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=1878x1149

Before moving to the www. subdomain the url was https://example.com. Now we are moved to the www. sudomain, the new domain is like in the request https://www.example.com. However, I do not see the change of domain in Matomo.

grafik

@AltamashShaikh
Copy link
Contributor

@diginote We checked internally and that's expected all urls with and without www. are handled as same and hence you see it without www.

@diginote
Copy link
Author

OK, but sometimes the »www.« subdomain is present but why? It also confuses our matomo users because we always redirect non www.... calls to the www... calls. Is there somewhere in matomo a way to configure that the "www." sudomain is always displayed when this is called?

@atom-box
Copy link

atom-box commented Jun 26, 2024

Hi @diginote
Maybe check that your domain/subdomain are not listed in
Matomo interface >> ⚙️ >> Measurables >> Manage >> edit-pencil-icon >> "urls"

Matomo uses that setting to remove the domain from the path. If you list nothing there, Matomo usually shows the full path. (If you leave it blank, Matomo seems to repopulate it, so confirm that it saved correctly. My workaround for that: I ended up saving a dummy address there to prevent Matomo from autopopulating that field.)

@diginote
Copy link
Author

diginote commented Jul 2, 2024

@atom-box Thanks for the advice. I have checked the options you mentioned.
The domains were not listed in the measurables.
Although I then add the urls (with and without www subdomain) to the measurables in the UI, only the www subdomain is removed. The following main domain with the path is not removed.
At the moment I don't understand how this works.

@dr2okevin
Copy link

I have the problem the other way around. For the Startpage Matomo always shows a www subdomain, even tho the page dosen't have a www subdomain. (More technical, the www subdomain is a different vhost with a 301 redirect to the variant without www)

Furthermore, www is a subdomain like any other, and should never be treated the same as no subdomain. I could serve completely different content over the www subdomain.

And in my case it is already the subdomain of a subdomain. So a visitor to https://subdomain.example.org/ gets logged as https://www.subdomain.example.org but a visit to https://subdomain.example.org/subpage.html gets correctly logged as https://subdomain.example.org/subpage.html

I have nowhere configured anything with www

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

5 participants