Advertisement
jegtheme

website-analytic.php

Nov 4th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2.     $gacode = vp_option('joption.google_analytic_code');
  3.     if(!empty($gacode)) {
  4. ?>
  5.     <script>
  6.         (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  7.                 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  8.             m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  9.         })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  10.  
  11.         ga('create', '<?php echo esc_js( $gacode ); ?>', 'auto');
  12.         ga('send', 'pageview');
  13.     </script>
  14. <?php
  15.     }
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement