Title: Need some changes for webmastertools
Last modified: August 20, 2016

---

# Need some changes for webmastertools

 *  [KaiSchultka](https://wordpress.org/support/users/andrenalin/)
 * (@andrenalin)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/need-some-changes-for-webmastertools/)
 * Hey,
 * plugin is working fine, if you want to use it also for webmastertools you need
   to change some lines in output.class.php
 * thanks for this small plugin
 *     ```
       // Génère le code Google Analytics
       		public static function googleCode(array $options) {
   
       			// Ecriture des options
       			$ret  = "\n" ;
       			$ret .= '<!-- Simple Google Analytics Begin -->' . "\n" ;
       			$ret .= '<script type="text/javascript">' . "\n" ;
       			/*$ret .= 'var _gaq = [' ;
       			foreach ($options as $key => $value) {
       				$ret .= is_null($value) ? '[\'' . $key . '\']' : '[\'' . $key . '\',\'' . $value . '\']' ;
       				$ret .= ',' ;
       			}
       			$ret  = rtrim($ret, ',') ;
       			$ret .= '];' ;*/
   
       //changed lines
       			$ret .= 'var _gaq = _gaq || []; _gaq.push(' ;
       			foreach ($options as $key => $value) {
       				$ret .= is_null($value) ? ' _gaq.push([\'' . $key . '\']' : '[\'' . $key . '\',\'' . $value . '\']' ;
       				$ret .= ');' ;
       			}
       			$ret  = rtrim($ret, ');') ;
       			$ret .= ');' ;
       //changes ends
       			// Code Google
       			$ret .= '(function() {' . "\n" ;
       			$ret .= 'var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . "\n" ;
       			$ret .= 'ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . "\n" ;
       			$ret .= 'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . "\n" ;
       			$ret .= '})();' . "\n" ;
       			$ret .= '</script>' ;
       			$ret .= "\n" . '<!-- Simple Google Analytics End -->' ;
       			$ret .= "\n" ;
   
       			return $ret ;
       		}
       ```
   
 * [http://wordpress.org/extend/plugins/simple-google-analytics/](http://wordpress.org/extend/plugins/simple-google-analytics/)

The topic ‘Need some changes for webmastertools’ is closed to new replies.

 * ![](https://ps.w.org/simple-google-analytics/assets/icon-256x256.jpg?rev=1886236)
 * [Local Google Analytics for Wordpress - caches external requests](https://wordpress.org/plugins/simple-google-analytics/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-google-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-google-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-google-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-google-analytics/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [KaiSchultka](https://wordpress.org/support/users/andrenalin/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/need-some-changes-for-webmastertools/)
 * Status: not resolved