I have WPML multiple domain website. sk,at,eu,hu in 4 languages.
I am really struggling how to setup Google Tag manager for each separate GA account for every domain.
I tried to google but didn't find nice solutions or guide. Here in this video tutorial he is saying that Cross Domain Tracking is not for 4 different GA accounts.
What is the best way to do this? I want to use also remarketing and FB pixel same way. Or any beer solution with WPML? Thanks
Thank you for contacting us. You must use the ICL_LANGUAGE_CODE constant to add a code for each language. For example, in your theme's footer.php you could use:
<?php if( ICL_LANGUAGE_CODE == 'sk' ): ?>
<!-- Insert the SK code (Google, Facebook, etc) -->
<?php elseif( ICL_LANGUAGE_CODE == 'at' ): ?>
<!-- Insert the AT code (Google, Facebook, etc) -->
<?php elseif( ICL_LANGUAGE_CODE == 'eu' ): ?>
<!-- Insert the EU code (Google, Facebook, etc) -->
<?php elseif( ICL_LANGUAGE_CODE == 'hu' ): ?>
<!-- Insert the HU code (Google, Facebook, etc) -->
<?php else: ?>
<!-- Insert the "global" code (Google, Facebook, etc) -->
<?php endif; ?>
If you are using a cache plugin, clear your site cache. This way, when the user accesses the URL in "sk", only the code defined within the "sk" block will be displayed.
Please, let me know if I can help with any other questions you may have about it. I'll be happy to help.