Last active
February 19, 2023 04:42
-
-
Save nschaeferhoff/e7fe59a1d59a9e1f303dcde95bb363ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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 add_googleanalytics() { ?> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXX-X"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'XX-XXXXXXXX-X'); | |
</script> | |
<?php | |
} | |
add_action('wp_head', 'add_googleanalytics'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you