This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 16 replies, has 2 voices.

Last updated by Raja Mohammed 1 month, 3 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
August 19, 2019 at 11:37 am #4415595

khalidA-27

Hi
I need Alejandro to help me with this please and no one else. I believe he will fix it without wasting time.

"/ar" suffix has been added automatically to the end of most of my site URLs in G-Analytics, even English ones,
Example:
Normal URL hidden link
affected URL: hidden link
Also, The new URL gives 404 error And this only appears in G Analytics. And there you can find for some URLs overs 1000 visits. All of them 404 and I redirected them to correct pages and they still appear like that in G Analytics.
Resaving permalinks doesn't do anything
Have a look here
hidden link

I have the same issue opened for more than three weeks now and still not resolved.
You can check it here
https://wpml.org/forums/topic/adding-ar-suffix-to-all-urls/

Thanks

August 20, 2019 at 7:12 am #4421001

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello Khalid.

Alejandro is off for a couple of days, Would you mind me answering your ticket or if you prefer to wait for him to return I can keep this on hold.

I have gone through your issue and the discussion in detail I think you already have a solution but let me try to explain it a bit.

1) Directory per language should have a root page - Since you don't have a root page the site URL is automatically redirected to your default language Arabic so there is already a redirect happening here

2) Considering Point 1 I would suggest adding Root page and add a 301 redirect as mentioned in the previous ticket by Riffaz, So you are not adding an extra redirect you are actually streamlining the redirect and no additional redirect happening.

Since WPML redirects to the default language when directory for language is setup without root page we are suspecting the missing root page might be an issue.

3) Once you have made this set up right, this will help us eliminate the possible issue arising out of point 2

I have tried to access the Google Analytics to get more info but its access protected, Would you mind adding temporarily adding my email id (raja.m@onthegosystems.com) to your google analytics profile with view-only access to get more info about the issue.

I hope your issue will be resolved soon.

Kind regards
Raja

August 20, 2019 at 9:09 am #4421957

khalidA-27

Hi Raja
Thanks for reply
Mail added to G_Analytics

Fro what he said in the other ticket by doing solution he suggested, my visitors have to do an extra step by choosing a language. I don't want that.

August 20, 2019 at 9:12 am #4421979

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks, Khalid, I am analyzing the issue now. This is very strange behavior.

Once you add a redirect to root page it is skipped automatically and lands in the default language page. So the language selection step is also skipped user gets the same flow again. I hope this is clear now. Let me know if you can handle this.

I will update you with the finding soon.

August 20, 2019 at 9:18 am #4422059

khalidA-27

It is not clear and I can't handle it. Also redirections will make site slower

August 20, 2019 at 9:25 am #4422103

khalidA-27

Will we have the same issue if we set different subdomains to each language? With no redirections of course

August 20, 2019 at 9:40 am #4422197

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Different domains per language is handled differently there is no need for the root page in that case. However it would have a great impact on your indexing if you consider changing to different domains (sub domains) per language.

I would request your permisison to perform the addition of root page and add a redirect to test this issue. Let me know if it is okay with you

August 20, 2019 at 9:54 am #4422317

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sure that's the better plan, please let me know the place where you have added the Google Analytics code on your site. I could not find it in the theme options.

August 20, 2019 at 10:00 am #4422327

khalidA-27

It is added through Google tag manager for original site
And it is effective on test site

August 20, 2019 at 12:37 pm #4423671

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I suppose even with google tag manager the codes to be added to your site, isn't it?

I would suggest we better test this scenario with Google Analytics code added to theme options.

I have added the root page to the test site without a redirect, hidden link.
Please check the analytics for the test site since I don't have access to them, please let me know the results. I will add the redirects based on the GA results.

Also please grant me access to test site analytics that would be effective in case we want to test this further.

Update: Please clear the cache to test the issue or load the site in a new browser.

Regards
Raja

August 20, 2019 at 2:24 pm #4424367

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yeah, I can understand that.

I can access the test site on google analytics.

I have checked the tags and the collect URL everything seems to be fine. The recorded URL doesn't have a /ar/ appended to it but when displayed on the google analytics dashboard it is displayed with /ar/ which is quite strange.

Please check my recording for more clarity hidden link

Even if I change the Language URL format to parameters in WPML settings in the test site, instead of the directory format the same issue persists.

I would suggest adding the google analytics code directly to the theme options instead of adding it through tag manager, Please remove google analytics code from the tag manager for the test site hidden link to avoid duplication.

You can share the analytics code in your next reply which I have marked it as private. I will try to add the code and check if the issue happens with it.

August 20, 2019 at 2:36 pm #4424481

khalidA-27

I removed tag manager code and added GA code in header from insert headers and footers plugin

Situation is the same

August 21, 2019 at 4:50 am #4428037

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately, I don't have access to header and footer settings page to check the inserted GA script, I am not sure why the access the restricted.

Furthermore, I have temporarily disabled WPML the issue still persists, Which explains the issue might not be due to WPML. Inspecting the GA code might give some clarity.

August 21, 2019 at 10:47 am #4430447

khalidA-27

Hi
Account now is administrator
Please check again

August 21, 2019 at 12:24 pm #4431233

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the access, To eliminate the guesswork I have used a new GA code created from my account, Everything seems to work fine. I am unable to reproduce the issue with the new GA code
please refer the screencast hidden link

While typing your reply I just found something interesting while I readded your Google Analytics code to the site.

1) Once I access the site without your google analytics code the site load the Root page no redirection happening here - This is the expected behavior

2) Now I pasted your google analytics code and when I access the site home page this now load the Arabic default page - This is not the expected behavior it seems like with the Google analytics code there is a redirection happening bypassing the root page and hence its getting /ar in all the google analytics code.

This happens only when I use the google analytics code that you supplied for your site.

Please refer to the video: hidden link

I hope this gives you more clarity about the issue.

Please check the Google Analytics settings again, Is there any additional parameter added while creating the analytics account. Also, check if you can reproduce the same issue with a new Google Analytics code.

Kind regards
Raja