Created
November 1, 2017 17:25
-
-
Save mbrughi/32e1505dbdba194b8274d49a0203fc23 to your computer and use it in GitHub Desktop.
Wordpress: insert Google Analytics code.
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
function my_google_analytics() { | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-69841290-2"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'UA-69841290-2'); | |
</script> | |
} | |
add_action( 'wp_footer', 'my_google_analytics' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment