MonsterInsights_Tracking_Disabled

The Google Analytics for WordPress by MonsterInsights MonsterInsights Tracking Disabled class.

Defined (1)

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

/includes/frontend/tracking/class-tracking-disabled.php  
  1. class MonsterInsights_Tracking_Disabled extends MonsterInsights_Tracking_Abstract { 
  2.  
  3. /** 
  4. * Holds the base class object. 
  5. * @since 6.0.0 
  6. * @access public 
  7. * @var object $base Base class object. 
  8. */ 
  9. public $base; 
  10.  
  11. /** 
  12. * Holds the name of the tracking type. 
  13. * @since 6.0.0 
  14. * @access public 
  15. * @var string $name Name of the tracking type. 
  16. */ 
  17. public $name = 'disabled'; 
  18.  
  19. /** 
  20. * Version of the tracking class. 
  21. * @since 6.0.0 
  22. * @access public 
  23. * @var string $version Version of the tracking class. 
  24. */ 
  25. public $version = '1.0.0'; 
  26.  
  27. /** 
  28. * Primary class constructor. 
  29. * @since 6.0.0 
  30. * @access public 
  31. */ 
  32. public function __construct() { 
  33. $this->base = MonsterInsights(); 
  34.  
  35. /** 
  36. * Get frontend tracking options. 
  37. * This function is used to return an array of parameters 
  38. * for the frontend_output() function to output. These are  
  39. * generally dimensions and turned on GA features. 
  40. * @since 6.0.0 
  41. * @access public 
  42. * @return array Array of the options to use. 
  43. */ 
  44. public function frontend_tracking_options( ) { 
  45. return array(); 
  46.  
  47. /** 
  48. * Get frontend output. 
  49. * This function is used to return the Javascript 
  50. * to output in the head of the page for the given 
  51. * tracking method. 
  52. * @since 6.0.0 
  53. * @access public 
  54. * @return string Javascript to output. 
  55. */ 
  56. public function frontend_output( ) { 
  57. $output = PHP_EOL . '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->' . PHP_EOL; 
  58.  
  59. if ( current_user_can( 'monsterinsights_save_settings' ) ) { 
  60. $output .= '<!-- ' . sprintf( esc_html__( '@Webmaster, normally you will find the Google Analytics tracking code here, but you are in the disabled user groups. To change this, navigate to Insights %1$s Settings %1$s Ignore Users', 'google-analytics-for-wordpress' ), '->' ) . ' -->' . PHP_EOL; 
  61. } else { 
  62. $output .= '<!-- ' . esc_html__( 'Normally you will find the Google Analytics tracking code here, but the webmaster disabled your user group.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL; 
  63. $output .= '<!-- / Google Analytics by MonsterInsights -->' . PHP_EOL . PHP_EOL; 
  64. return $output;