Skip Navigation

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

Last updated by Mohamed Sayed 1 year, 9 months ago.

Assisted by: Mohamed Sayed.

Author Posts
August 31, 2023 at 9:23 am #14318619

rickH-9

Hi there,

I've been looking for an answer for this, but can''t find the solution for me.

I have a website with two domains; .nl and .com and I want to analyse the data from these domains in Google Analytics 4.0. I've setup GA4 and added the tracking code to the website.

The two domains share one WordPress installation and one GA4 tag. But I'm unable to track these domains individually. Ideally I want to make reports for each of the domains.

For example, I want to track all organic traffic for the .com domain. How can I setup WPML and GA4 in order to achieve this?

August 31, 2023 at 11:40 am #14320283

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for contacting us.

You will need to create 2 different GA tags/codes to track different domains/languages and then insert these codes in your website via custom code.

You can use an if filter like if(ICL_LANGUAGE_CODE=='en') or get the current WPML language and output different code depending on that.

More info:
- https://wpml.org/forums/topic/setting-google-analytics-with-2-domains/
- https://wpml.org/faq/how-to-get-current-language-with-wpml/

Hope this helps.

Regards,
Drazen

September 1, 2023 at 8:22 am #14325011

rickH-9

Hi Drazen,

Thanks for the quick response. Ideally I only want one GA4 tracking for all domains. Is there a workaround for this?

Let me know!

September 3, 2023 at 12:38 pm #14331877

Mohamed Sayed

Hi,
Sorry for the late reply due to the weekend.

I think this can be achieved by using the Google Analytics cross-domain measurement. Please check this article for more details: hidden link