Closed jan-dh closed 9 years ago
Yes, that already exists, inside the starter plugin companion: plugin/lib/analytics.php.
And the reason is because that sort of functionality escapes the scope of the theme. As it happens with custom post types and taxonomies and shortcodes also.
The code is inserted at the end of the head. Since it's async doesn't interfere with the page loading process. That's what Google recommends.
I think the Google Analytics script should be standard at the bottom in the footer.php so the users only have to replace the XXX with their own code.