Bug #88264

Epic #89797: HrefLang / Canonical issues

Canonical and hreflang with tracking params

Added by Marc Hirdes 7 months ago. Updated 2 days ago.

Status:
Needs Feedback
Priority:
Should have
Category:
SEO
Target version:
-
Start date:
2019-05-03
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,

I currently struggle with hreflang and tracking params. They will not be shown in the hreflang, but then they will have a lost connection. hreflang should allways refer to each other. Otherwise there will be shown an error in the Google Search Console.

my question is, if we have page like for example /home/.

The canonical is
https://www.domain.org/home/

The href-lang is
<link rel="alternate" hreflang="de" href="https://www.domain.org/de/start/"/>

Everything is ok. On https://www.domain.org/de/start/

the canonical would be
https://www.domain.org/de/start/
and the hreflang
<link rel="alternate" hreflang="en" href="https://www.domain.org/home/"/>

If my page is in the Google index with
https://www.domain.org/home/?my_tracking_parameter=xy

Then also the canonical and href lang would be the same as above, so without the parameter. For the canonical this works, but for the hreflang not. There would be a missing conection from https://www.domain.org/de/start/ to https://www.domain.org/home/?my_tracking_parameter=xy

Therefore the hreflang sould not be set if the canonical is a different than the current URL. But then we have the challange with the page cache. So https://www.domain.org/home/?myparameter=xy would have the same cached page as https://www.domain.org/home/.

My only solution for this problem would be to use the sitemap.xml for hreflang instead of the HTML head, as it is shown here https://support.google.com/webmasters/answer/189077#sitemap

What do you think about?


Related issues

Related to TYPO3 Core - Bug #89878: Hreflang links not using canonical urls New 2019-12-06

History

#1 Updated by Richard Haeser about 2 months ago

Do I get it correctly that you want to pass your tracking params to the other languages by adding them to the hreflang? Why do you want that? That information is not relevant for a search engine isn't it?

#2 Updated by Richard Haeser about 2 months ago

  • Status changed from New to Needs Feedback

#3 Updated by Marc Hirdes about 2 months ago

No, I don't want to show the hreflang, if the canonical is different than the current URL.

#4 Updated by Richard Haeser about 2 months ago

Why do you want that? I can't get the reason why you would like to hide the hreflang while it is showing the right URL. Hreflang and canonical will be using the canonicalized url's, just like they are needed for the search engine. Maybe I don't understand your issue. Can you clarify?

#5 Updated by Marc Hirdes about 2 months ago

Maybe you can get the point here better https://www.searchviu.com/en/hreflang-canonical/ but I also descriped it in the description of this ticket.

Another example.

mypage.com/page/ => canoncical mypage.com/page/ => hreflang mypage.com/de/page/
mypage.com/de/page/ => canoncical mypage.com/de/page/ => hreflang mypage.com/page/
is ok.

mypage.com/page/?param=xyz => canoncical mypage.com/page/ => hreflang mypage.com/de/page/
mypage.com/de/page/ => canoncical mypage.com/page/ => hreflang mypage.com/de/page/
missing the way back to mypage.com/page/?param=xyz - every hreflang has to point to itself

mypage.com/page/?param=xyz => canoncical mypage.com/page/ => hreflang mypage.com/de/page/?param=xyz
would be even more worse.

#6 Updated by iam li about 2 months ago

So sorry to hijack your post but where do you put this in Typo3?

hreflang
<link rel="alternate" hreflang="en" href="https://www.domain.org/home/"/>

Thank you,

Marc Hirdes wrote:

Hi,

I currently struggle with hreflang and tracking params. They will not be shown in the hreflang, but then they will have a lost connection. hreflang should allways refer to each other. Otherwise there will be shown an error in the Google Search Console.

my question is, if we have page like for example /home/.

The canonical is
https://www.domain.org/home/

The href-lang is
<link rel="alternate" hreflang="de" href="https://www.domain.org/de/start/"/>

Everything is ok. On https://www.domain.org/de/start/

the canonical would be
https://www.domain.org/de/start/
and the hreflang
<link rel="alternate" hreflang="en" href="https://www.domain.org/home/"/>

If my page is in the Google index with
https://www.domain.org/home/?my_tracking_parameter=xy

Then also the canonical and href lang would be the same as above, so without the parameter. For the canonical this works, but for the hreflang not. There would be a missing conection from https://www.domain.org/de/start/ to https://www.domain.org/home/?my_tracking_parameter=xy

Therefore the hreflang sould not be set if the canonical is a different than the current URL. But then we have the challange with the page cache. So https://www.domain.org/home/?myparameter=xy would have the same cached page as https://www.domain.org/home/.

My only solution for this problem would be to use the sitemap.xml for hreflang instead of the HTML head, as it is shown here https://support.google.com/webmasters/answer/189077#sitemap

What do you think about?

#7 Updated by Richard Haeser 10 days ago

  • Parent task set to #89797

#8 Updated by Richard Haeser 2 days ago

  • Tracker changed from Task to Bug

The tracking params, I don't get it: you don't want to add a hreflang nor canonical including your tracking params if it does not change your content because you will tell google to index 2 URL's with the same content.

If you are talking about the combination of canonical url in combination with hreflang, than we have a bug indeed.

<link rel="alternate" hreflang="en-US" href="https://core.ddev.site/canonicals/canonical-to-external-and-having-translations"/>
<link rel="alternate" hreflang="en-US" href="https://core.ddev.site/nl/canonicals/canonical-naar-externe-site-en-met-vertalingen"/>
<link rel="alternate" hreflang="x-default" href="https://core.ddev.site/canonicals/canonical-to-external-and-having-translations"/>

<link rel="canonical" href="https://www.richardhaeser.com"/>

This is not correct indeed, but has nothing to do with tracking params. I have created #89878 for this.

#9 Updated by Richard Haeser 2 days ago

  • Related to Bug #89878: Hreflang links not using canonical urls added

Also available in: Atom PDF