Open jacob-v-dam opened 1 year ago
I was thinking on this several times.
What would be the purpose to enter a different GTM container ID for each language domain if the site structure is the same? In GTM, you can use Lookup Table variable to fire different account/measurement IDs on each domain. Are there any circumstances where you need a different tracking setup (besides proper IDs)?
Hi in wp-config.php after
/* Sets up WordPress vars and included files. / require_once ABSPATH . 'wp-settings.php';
add this:
$current_language = apply_filters( 'wpml_current_language', null );
if ( $current_language === "lt" ) {
define( 'GTM4WP_HARDCODED_GTM_ID', 'GTM-xxxxxxx' );
} elseif ( $current_language === "lv" ) {
define( 'GTM4WP_HARDCODED_GTM_ID', 'GTM-yyyyyyy' );
} elseif ( $current_language === "fi" ) {
define( 'GTM4WP_HARDCODED_GTM_ID', 'GTM-ccccccc' );
} else {
define( 'GTM4WP_HARDCODED_GTM_ID', 'GTM-hhhhhhh' );
}
I still struggle to understand the use case here. What do you want to track differently on a website that has the same content but in different languages?
Hello,
I noticed it is possible to use the WP multisite option. But how to enable WPML multisite?
We have a website running on different domain for each language. We would like to set a tag per domain.