AgilityWeb
11/3/2018 - 5:20 PM

Google Analytics functions php

#-----------------------------------------------------------------#
# GOOGLE ANALYTICS
#-----------------------------------------------------------------#

add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-UA-1042546-3"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-1042546-3');
</script>


<?php } ?>