Do you want to add any code such as Google Analytics within head tag in your WordPress website or blog? You can easily add codes in the header of your WordPress website without editing the header.php file and by adding the same in the functions.php file of the theme.
Do you want to add any code or HTML to the footer of your WordPress website without editing the theme file? You can easily add Google Analytics or other code in the WordPress footer by editing the functions.php file of the theme.
Each time you preview your blog post in WordPress to ensure that everything is in order, your page view goes up in Google Analytics or other analytics service. This messes up your Google Analytics stats by increasing the pageviews. You can easily prevent this with a conditional tag called is_preview().