gglnltcs_past_tracking_code

The BestWebSoft Google Analytics gglnltcs past tracking code function.

Description

gglnltcs_past_tracking_code(); 

Usage

  1. if ( !function_exists( 'gglnltcs_past_tracking_code' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bestwebsoft-google-analytics/bws-google-analytics.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gglnltcs_past_tracking_code(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bws-google-analytics.php  
  1. function gglnltcs_past_tracking_code() { 
  2. global $gglnltcs_options; 
  3. if ( isset( $gglnltcs_options['tracking_id'] ) && '' != $gglnltcs_options['tracking_id'] && isset( $gglnltcs_options['add_tracking_code'] ) && 1 == $gglnltcs_options['add_tracking_code'] ) { 
  4. $tracking_id = json_encode( $gglnltcs_options['tracking_id'] );  
  5. /** Google tracking code */ ?> 
  6. <script id="gglnltcs-tracking-script" type="text/javascript"> 
  7. (function(i, s, o, g, r, a, m) {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function() { 
  8. (i[r].q=i[r].q||[]).push(arguments)}, i[r].l=1*new Date();a=s.createElement(o),  
  9. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a, m) 
  10. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 
  11. /* Put our tracking id here */ 
  12. ga( 'create', '<?php echo $gglnltcs_options['tracking_id']; ?>', 'auto' ); 
  13. ga( 'send', 'pageview' ); 
  14. </script><?php 
  15. } else { 
  16. return;