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 4 replies, has 2 voices.

Last updated by jerryS-5 11 months, 3 weeks ago.

Assigned support staff: Bruno.

Author Posts
October 24, 2018 at 6:23 pm #2847616

jerryS-5

I am trying to:

Add a UTM code to a specific translation of the site URL, where the "language URL format" adds the language name as a parameter, for example, hidden link

Link to a page where the issue can be seen:

hidden link

I expected to see:

The Spanish page and to be able to track the page-view in Google Analytics.

Instead, I got:

The default English page and no page-view in Google Analytics.

October 26, 2018 at 5:26 am #2851949

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

That depends how you are adding the code. At the moment, I see that the problem happens only by accessing the complete URL: /?lang=es&utm_source=abogado.com&utm_medium=topbanner

Accessing only /?lang=es, this works correctly. What code are you using? How are you trying to enter the UTM code?

Also, are you using any caching system on your server? If yes, please could you clean it and check if the problem persists?

Thank you.

October 26, 2018 at 1:18 pm #2853115

jerryS-5

Hi Bruno,

I have figured out the issue. The problem is that existing URL parameters do not work correctly with UTM codes appended unless the UTM is added as a fragment of the URL, or after the hash (#). The problem with putting the UTM in the fragment is that the fragment is not sent to the server; therefore, there is no access to the UTM on the server-side and decision can't be made based on it in the server-side application.

The answer is to change from a parameter-based URL to putting the translations in a directory, and I plan to do that this evening.

If you have a better way, let me know. Thanks!

October 26, 2018 at 3:46 pm #2853602

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you. I'm not sure why using the UTM code as the parameter does not work on your site. I've tested this in my testing environment and it seems to work correctly, both the translation and receipt of the UTM codes.

That way, I think there should be some compatibility issue with your theme or with some other plugin you're using.

If you want to test, you can try with all non-WPML plugins disabled and with the default theme and check the behavior of your site. Then activate the plugins one by one to see if any compatibility issues are happening. If you want me to test your site, please let me know so that I can request the credentials of your site.

Thank you.

October 29, 2018 at 8:27 pm #2859474

jerryS-5

My issue is resolved now. Thank you!