WPML

Overview of the Issue

In Google Analytics for WordPress by MonsterInsights, the Popular Posts lists on a translated page show posts in other languages. For example, visitors of a Spanish page see links to English posts.

Workaround

Until MonsterInsights fixes it, add the code below to your theme’s functions.php file, or with a code snippets plugin. Popular Posts then lists the posts of the current language.

add_filter( 'monsterinsights_popular_posts_query_args', function ( $args ) {
	$args['suppress_filters'] = false;
	$args['lang']             = apply_filters( 'wpml_current_language', null );
	return $args;
} );

All known issues

Need Help with This Issue?

Ask a support question and we’ll look into it with you.