Google Analytics in your WP

24.Aug.2010

Recently, on website wprecipes.com, I have stumbled upon an interesting script displaying how to integrate your Google Analytics code into your WordPress theme by modifying only functions.php. To do so, just copy and paste following snippet into your functions.php in your current WordPress theme.

1
2
3
4
5
add_action('wp_header', 'ga');
 
function ga() {
    // Paste your Google Analytics code here
}