Last active
March 24, 2020 16:04
-
-
Save samkent/1df2429b6505c272c7a6bf5799844840 to your computer and use it in GitHub Desktop.
Add Google Analytics to WordPress head (header.php)
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
<?php | |
/** | |
* Add Google Analytics | |
* Add this to your theme functions.php file | |
* @link https://gist.github.com/samkent/1df2429b6505c272c7a6bf5799844840 | |
*/ | |
add_action('wp_head', 'google_analytics'); | |
function google_analytics() { | |
?> | |
<!-- Paste your Google Analytics JS Tracking Code here --> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment