andamira / medula

Starter Theme & Plugin for WordPress
MIT License
8 stars 0 forks source link

Add Google Analytics to Footer #45

Closed jan-dh closed 9 years ago

jan-dh commented 9 years ago

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.

joseluis commented 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.