/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Add Google Analytics to Footer * http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/ * **/ function myfunction_add_google_analytics() { echo '<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>'; echo '<script type="text/javascript">'; echo 'var pageTracker = _gat._getTracker("UA-XXXXX-X");'; echo 'pageTracker._trackPageview();'; echo '</script>'; } add_action('wp_footer', 'myfunction_add_google_analytics');
URL: http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/