0

We have a Sitecore 9.1.1 site with SXA 1.8.1. We're getting duplicate results in analytics because the urls will appear there with and without the \en part. We only have 1 language in the site.

I have since patched the Sitecore link provider and our custom one to have languageEmbedding="never".

We have the always strip language set to true - and the description to me sounds like it should be stripping out the language code from the url.

<setting name="Languages.AlwaysStripLanguage" value="true"/>

We also have a canonical url now dynamically generated for each page.

Should this be sufficient for analytics to stop showing the duplicate /en entries? Or is further action required?

It seems like someone could go to the site url with /en and it will be logged to analytics as that duplicate - although all the internal links should never have that language code.

  • 1
    Wait for Google cache update for your website. – Anton Jul 9 at 6:25
  • 1
    And if someone has bookmarked a page? – Jen Jul 9 at 6:45
1

First of all, make sure that all internal links are generated correctly, without /en/

What about external links(someone added your page to bookmarks, google cached URL, etc.): You can create rewrite rule that will remove en language from your URL:

<rule name="Remove en from URL" stopProcessing="true">
  <match url="^(en)/(.*)$" />
  <action type="Redirect" url="/{R:2}" />
</rule>

It will avoid duplication in analytics. But be aware of side effects: redirects are often not too good for SEO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.