Created
March 8, 2017 11:52
-
-
Save ScarletPonytail/fba3eee9a3b40a75cb8bb4d010a14762 to your computer and use it in GitHub Desktop.
Wordpress - Add Google Analytics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Google Analytics to Footer | |
function 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', 'add_google_analytics'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment