Changeset 1517791
- Timestamp:
- 10/19/2016 10:23:38 AM (9 years ago)
- Location:
- easy-google-analytics-tracking/trunk
- Files:
-
- 2 edited
-
easy-google-analytics-tracking.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-google-analytics-tracking/trunk/easy-google-analytics-tracking.php
r1517588 r1517791 3 3 /* 4 4 Plugin Name: Easy Google Analytics Tracking 5 Plugin URI: http://www.selfdesigns.co.uk5 Plugin URI: www.selfdesigns.co.uk 6 6 Description: Add google analytics script without theme modification 7 7 License: GPL 8 Version: 1.2. 08 Version: 1.2.1 9 9 Author: Lewis Self 10 Author URI: http://www.selfdesigns.co.uk10 Author URI: www.selfdesigns.co.uk 11 11 */ 12 12 … … 16 16 } 17 17 18 $google_analytics_enabled = get_option('google_analytics_enabled'); 19 $google_analytics_tracking_id = get_option('google_analytics_tracking_id'); 20 $google_analytics_placement = get_option('google_analytics_placement'); 21 $google_site_verification_enabled = get_option('google_site_verification_enabled'); 22 $google_site_verification_id = get_option('google_site_verification_id'); 23 24 if($google_analytics_enabled) 18 if(get_option('google_analytics_enabled')) 25 19 { 26 if( $google_analytics_tracking_id)20 if(get_option('google_analytics_tracking_id')) 27 21 { 28 22 function egat_add_google_analytics_script() // Add Google Analytics code to theme file … … 36 30 })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 37 31 38 ga('create', '<?php echo esc_attr( $google_analytics_tracking_id); ?>', 'auto');32 ga('create', '<?php echo esc_attr(get_option('google_analytics_tracking_id')); ?>', 'auto'); 39 33 ga('send', 'pageview'); 40 34 </script> 41 35 42 <?php36 <?php 43 37 } 44 38 45 if( $google_analytics_placement== '2')39 if(get_option('google_analytics_placement') == '2') 46 40 { 47 41 add_action('wp_footer', 'egat_add_google_analytics_script'); 48 42 } 49 43 50 if( $google_analytics_placement== '1')44 if(get_option('google_analytics_placement') == '1') 51 45 { 52 46 add_action('wp_head', 'egat_add_google_analytics_script'); … … 57 51 function egat_add_google_site_verification() 58 52 { 59 if( $google_site_verification_enabled)53 if(get_option('google_site_verification_enabled')) 60 54 { 61 if( $google_site_verification_id)55 if(get_option('google_site_verification_id')) 62 56 { 63 57 ?> 64 58 65 <meta name="google-site-verification" content="<?php echo esc_attr( $google_site_verification_id); ?>" />59 <meta name="google-site-verification" content="<?php echo esc_attr(get_option('google_site_verification_id')); ?>" /> 66 60 67 61 <?php … … 119 113 <label class="google-ids"> 120 114 <span class="title text-field-titles">Google Analytics Tracking ID:</span> 121 <input name="google_analytics_tracking_id" value="<?php echo esc_attr( $google_analytics_tracking_id); ?>" />115 <input name="google_analytics_tracking_id" value="<?php echo esc_attr(get_option('google_analytics_tracking_id')); ?>" /> 122 116 </label> 123 117 <label class="google-ids"> 124 118 <span class="title text-field-titles">Google Site Verification Code:</span> 125 <input name="google_site_verification_id" value="<?php echo esc_attr( $google_site_verification_id); ?>" />119 <input name="google_site_verification_id" value="<?php echo esc_attr(get_option('google_site_verification_id')); ?>" /> 126 120 </label> 127 121 <label class="checkbox-options"> 128 122 <span class="title">Enable Google Analytics:</span> 129 <input type="checkbox" name="google_analytics_enabled" value="1" <?php checked(1, $google_analytics_enabled, true); ?> />123 <input type="checkbox" name="google_analytics_enabled" value="1" <?php checked(1, get_option('google_analytics_enabled'), true); ?> /> 130 124 </label> 131 125 <label class="checkbox-options"> 132 126 <span class="title">Enable Google Site Verification:</span> 133 <input type="checkbox" name="google_site_verification_enabled" value="1" <?php checked(1, $google_analytics_enabled, true); ?> />127 <input type="checkbox" name="google_site_verification_enabled" value="1" <?php checked(1, get_option('google_analytics_enabled'), true); ?> /> 134 128 </label> 135 129 <div class="script-placement"> -
easy-google-analytics-tracking/trunk/readme.txt
r1517588 r1517791 8 8 Stable tag: Trunk 9 9 License: GPLv2 10 Version: 1.2. 010 Version: 1.2.1 11 11 12 12 == Description == … … 46 46 * Responsive admin settings: 16/06/2016 47 47 48 = 1.2.0 48 = 1.2.0 = 49 49 * Functionality to add tracking code to top or bottom of website source code: 18/10/2016 50 50 * Google site verification added: 18/10/2016 51 51 * Option to choose where google analytics code is outputted on website 52 53 = 1.2.1 = 54 * textfield & Checkbox bug fix
Note: See TracChangeset
for help on using the changeset viewer.