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.
Tagged: Custom Work
This topic contains 3 replies, has 2 voices.
Last updated by Dražen 1 year, 5 months ago.
Assisted by: Dražen.
Author | Posts |
---|---|
September 19, 2023 at 10:46 pm #14425619 | |
julieC-6 |
Tell us what you are trying to do? I would like to get language information in my GA4 analytics. I use the variable appended to the url as my language switcher - lang=pt-br etc. Is there any documentation that you are following? https://wpml.org/faq/how-to-get-current-language-with-wpml/ What is the link to your site? interrainternational.com |
September 20, 2023 at 7:20 am #14426877 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, I assume you mean on the next forum tickets. It is suggested to use 2 different codes/tags for each language: - https://wpml.org/forums/topic/setting-google-analytics-with-2-domains/ Hope it helps, |
September 21, 2023 at 9:47 pm #14442547 | |
julieC-6 |
Hi there - Thanks for your response, however, the links you sent are old and are not for GA4 which collects very differently. is there anyway that this would work instead - this is to create an event called language_viewed? function track_language_in_ga4() { if (function_exists('gtag')) { Do you have information specific for GA4 (not in a woocommerce store)? |
September 22, 2023 at 6:12 am #14443455 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+01:00) |
Hello, we do not have specific information about this, nor can we provide help with custom coding, fur such I advise hiring a WPML contractor: - https://wpml.org/contractors/ From my side, as I am not sure exactly how are you implementing it, I suggest either using if method or using 2 different tags for each language. If you need to get the current language you can also use our hook wpml_current_language. - https://wpml.org/faq/how-to-get-current-language-with-wpml/ Let me know if any other specific questions and I will be glad to help. Regards, |