Browse Source

analytics

windhamdavid 11 months ago
parent
commit
de83ad0610
1 changed files with 12 additions and 0 deletions
  1. 12 0
      functions.php

+ 12 - 0
functions.php

@@ -412,6 +412,18 @@ function gwp24_favicon() {
 	echo '<link rel="icon" href="' . esc_url( get_stylesheet_directory_uri() . '/img/_gwp_icon.svg' ) . '" type="image/svg+xml">';
 	echo '<link rel="icon" href="' . esc_url( get_stylesheet_directory_uri() . '/img/_gwp_icon.svg' ) . '" type="image/svg+xml">';
 }
 }
 
 
+add_action('wp_head', 'gwp24_add_analytics');
+function gwp24_add_analytics() { ?>
+
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-53FCS3FYTN"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag(){dataLayer.push(arguments);}
+  gtag('js', new Date());
+  gtag('config', 'G-53FCS3FYTN');
+</script>
+
+<?php }
 
 
 /***********************************************************
 /***********************************************************
 ####################### Comments ###########################
 ####################### Comments ###########################