fbpx

1. Plugins Method (Recommended)

There are tons of plugins available to add Google Analytics to your site. However, it is probably best to just use a simple light-weight plugin like:
Insert Header and Footer

Paste the Google Analytics code in the plugin’s setting page.

2. Direct Paste Method

Copy the code that you received, and paste it in your theme’s header.php right after the <body> tag.

3. Functions.php Method

Add the following code in your theme’s functions.php file

add_action('wp_footer', 'add_googleanalytics');
function add_googleanalytics() { ?&gt;
// Paste your Google Analytics code
&lt;?php }