Title: Google Analytics &quot;unexpected T_String
Last modified: August 20, 2016

---

# Google Analytics "unexpected T_String

 *  [tristanjmartin](https://wordpress.org/support/users/tristanjmartin/)
 * (@tristanjmartin)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/google-analytics-unexpected-t_string-1/)
 * I’m actually not entirely sure what version of wordpress I’m using, as I’m editing
   it from a different computer to the one that it is installed on, and I can’t 
   access the admin at all right now. Basically, I updated a whole load of plugins
   that looked pretty out of date. One of them was google analytics, and as soon
   as it said it had successfully updated I went somewhere else in the admin site
   and was met with just this message, in red:
 * Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION
   or T_VAR or ‘}’ in /usr/local/pem/vhosts/263636/webspace/siteapps/137538/htdocs/
   wp-content/plugins/google-analytics-for-wordpress/wp-gdata/wp-gdata.php on line
   14
 * The code it is talking about is this:
 *     ```
       <script type="text/javascript">//<![CDATA[
       	// Google Analytics for WordPress by Yoast v4.2.3 | http://yoast.com/wordpress/google-analytics/
       	var _gaq = _gaq || [];
       	_gaq.push(['_setAccount','UA-23884067-1']);
       	_gaq.push(['_trackPageview']);
       	(function() {
       		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
       		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
       		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
       	})();
       	//]]></script>
       ```
   
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button.]_
 * I have very limited programming knowledge, and so really don’t know what has 
   happened. But it seems plausible that it has been hacked? Also, I didn’t set 
   up the website or install any of the plugins, I’m just updating it for someone
   else, so I don’t know what was on there in the first place that could have resulted
   in this. Any suggestions would be much appreciated

The topic ‘Google Analytics "unexpected T_String’ is closed to new replies.

## Tags

 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * 0 replies
 * 1 participant
 * Last reply from: [tristanjmartin](https://wordpress.org/support/users/tristanjmartin/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/google-analytics-unexpected-t_string-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
