Quantcast
Channel: Katz Web Services » WordPress
Viewing all articles
Browse latest Browse all 17

How to Hard-Code a UA String for the Google Analytics for WordPress Plugin

$
0
0

If you want to define a Google Analytics “UA String” while using Yoast Google Analytics plugin for WordPress.

Add the following to your theme’s functions.php file:

add_filter( 'option_Yoast_Google_Analytics', 'custom_ua_string_filter');

function custom_ua_string_filter($options = array()) {
	$options['uastring'] = 'UA-########-#';
	$options['manual_uastring'] = true;
	return $options;

For users of WordPress Multisite, this will allow you to pre-configure new blogs with the same UA string.

The post How to Hard-Code a UA String for the Google Analytics for WordPress Plugin appeared first on KWS Blog.


Viewing all articles
Browse latest Browse all 17

Trending Articles