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 2 voices.

Last updated by Alejandro 6 months, 2 weeks ago.

Assigned support staff: Alejandro.

Author Posts
March 11, 2022 at 1:38 am #10764137

tonyD-4

Hi,

What is the best way to integrate Google Analytics via Google Tag Manager for WPML subdomains

March 12, 2022 at 11:37 am #10774569

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

I'm not sure what you'd like to achieve, so it all depends.

When you add the code to your functions.php code, it will likely be active for your subdomains as well, because they are still part of your site, the same one that has the code.

If you want to have a different code by languages then, you might need custom coding or maybe a plugin that can do this (although i'm not currently aware of any that could do so, even for a NON WPML site with multiple google analytics tag).

If you let me know what's the problem you're having and what you're currently doing + what you'd like to achieve, i might be able to offer a better support.

March 13, 2022 at 7:50 pm #10779115

tonyD-4

Hi,

Correct, I have added the code to the website header and body. But the GTM tag is not firing on subdomain. It is firing on the English (Default) one.

I can see the GTM code exist on the page source for all the translations.

hidden link

March 14, 2022 at 2:28 pm #10785443

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Ok, so the problem here might be different. the code is firing in all the languages which means the problem is not really on your website's end but on google's.

I can only suspect that google is only searching for "site.com" and not "subdomain.site.com" so they are ignoring your subdomains.

I'd suggest you try to contact google about this, if possible or maybe check this article out: hidden link

I'm not sure if it's your case, but if the code is being fired in all languages then the problem is not on WPML's end nor on your website.

Regards.

The topic ‘GA4 and GTM Set Up’ is closed to new replies.