AgilityWeb
6/18/2018 - 6:21 PM

GA in Functions

#-----------------------------------------------------------------#
# ADD GOOGLE ANALYTICS
#-----------------------------------------------------------------#
 
function ga() { ?> 
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-22645700-14"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-22645700-14');
</script>
<?php }
 
add_action('wp_head', 'ga');