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

Referrer detection does not recognize subdomains when wildcards used in site URLs #17299

Open
utrautmann opened this issue Mar 3, 2021 · 7 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@utrautmann
Copy link

In some individual Matomo websites that I maintain the transitions report shows the own website as traffic source in category "Website". I mean with "own website" the measurable URL that was set up that the visitors use to access this website.

However, the number of accesses "From Website" is significantly lower than in the incoming traffic for internal pages (see screenshot please), so I assume that only very specific pageviews with my domain are counted under the category "From Websites" .

As URL was set up http://mydomain.com and (!) https://www.mydomain.com because as a workaround of Page Overlay bug #12418

grafik

The acquisition report does not show the "own website", correctly.

The expectation is that only external websites will be listed in the transitions report.

Is here a relationship to #15039 ?

  • Matomo version: 4.1, 4.2.1
@utrautmann utrautmann added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Mar 3, 2021
@utrautmann utrautmann changed the title Transitions report shows own website as traffic source in category "Website" Transitions report shows own website as traffic source in category "From Websites" Mar 3, 2021
@diosmosis
Copy link
Member

Hi @utrautmann, sorry you're experiencing this. If your website URL is being listed as an external website here, then that must mean for one or more visits, that website URL is treated as the referrer URL. Would you be able to check if this is the case in the Acquisition > Websites report? Would you also be able to try and find a visit that has this as a referrer in the Visits Log (maybe by using the referrerUrl segment)?

I can think of one case where this might happen:

  • visitor visits a site for a while then stops w/o closing their browser
  • a couple hours later, the clicks a link in the website that goes to another page in the same site. this is treated as a new visit, w/ the same website as the referrer.

Finding a visit in the visits log would help determine if this is the case.

@utrautmann
Copy link
Author

Hi @diosmosis ,
I tried to analyze it more closely.

In addition to the www domain, I also track a subdomain on the Matomo website.
The configured URL is http://domain.de, so that I also include the subdomain in addition to www (sub.domain.de).
I also track one other domain so that enableCrossDomainLinking is switched on.

_paq.push(["setDomains", ["*.domain.de", "*.seconddomain.de"]]);
_paq.push(["enableCrossDomainLinking"]);

Here are the results of my research that I have done.

  1. My www-domain is never being listed in the Acquisition > Websites report.
  2. But my subdomain is being listed in the Acquisition > Websites report.
  3. And my www-domain and my subdomain are being showed in the Visitor Log and in the Transitions report

I exported the visits in question to Excel. If the visitor now jumps back and forth between pages on www and the subdomain, different referrer entries are created in the visitor profile.

I found at least 4 different combinations of datas. There is even another external URL included (that has nothing to do with my Matomo or my mentioned seconddomain.de - see Profile 3) .

grafik

In Profile 1 the transition report looks so:
grafik

I am sorry, unfortunately I have no precise identification of what happens when and at what point in time.

@diosmosis
Copy link
Member

diosmosis commented Apr 11, 2021

Hi @utrautmann, apologies for another late reply. From looking at the code it seems like the referrer is being set incorrectly when the Referer header is set to sub.domain.de. It should be recognized as part of the same site (if it's listed in the URLs portion of the site's settings). Can you tell me if your website is configured like this in Matomo:

image

? Or is sub.domain.de explicitly set?

I can definitely confirm that *.subdomain.de is not handled correctly in the tracker.

@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Apr 11, 2021
@diosmosis diosmosis changed the title Transitions report shows own website as traffic source in category "From Websites" Referrer detection does not recognize subdomains when wildcards used in site URLs Apr 11, 2021
@utrautmann
Copy link
Author

utrautmann commented Apr 12, 2021

Hi @diosmosis , my website is configured im Matomo like this

The explicit www entry is configured because as a workarround for #12418
The tracking snippet contains following script:

<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq = window._paq || [];
  _paq.push(["setCookieDomain", "*.mydomain.com"]);
  _paq.push(["setDomains", ["*.mydomain.com","*.seconddomain.com"]]);
  _paq.push(["enableCrossDomainLinking"]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
...
<!-- End Matomo Code -->




@diosmosis
Copy link
Member

@utrautmann Are you able to add the sub.domain.com URL that appears as a referrer? I believe that might workaround the problem.

@utrautmann
Copy link
Author

@diosmosis : Where should I exactly add the subdomain-URL? In the backend configuration or/and in the tracking script ("setDomains..."-method)? Thank you.

@diosmosis
Copy link
Member

@utrautmann in the backend configuration. This is what's used when detecting whether a referrer URL is from a the same site or somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants