Title: Fatal error: Cannot use string offset as an array
Last modified: August 20, 2016

---

# Fatal error: Cannot use string offset as an array

 *  [Erik Harris](https://wordpress.org/support/users/eharris/)
 * (@eharris)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/)
 * This is strange… I’ve got this plugin installed on two sites installed on the
   same server. On my wife’s site, it works fine. I had trouble with another Analytics
   plugin not working, so I nuked it and installed this one, since it’s working 
   for my wife. However, when I go to the plugin’s config page, I get this error:
 * `Fatal error: Cannot use string offset as an array in /(wp_content_path)/plugins/
   google-analytics-for-wordpress/admin/class-admin.php on line 323`
 * Even more strange – when I log into my FTP server and look at my wife’s site,
   her “google-analytics-for-wordpress” directory contains only two subdirectories(
   images and wp-data) and nine files. My site’s non-functional “google-analytics-
   for-wordpress” directory, on the other hand, has **SIX** subdirectories (admin,
   frontend, images, inc, js, and languages) and only four files.
 * Version 4.3.1 is installed on both sites (and both sites are using WP 3.5.1) 
   though they have completely different sets of files, and only one of them works.
   Why the very different sets of files, and what might be causing the problem on
   my site?
 * Possibly relevant: my site’s 4.3.1 is a fresh install of the plugin. My wife 
   has been using the plugin for awhile, so hers is an upgrade from a prior version
   of the plugin.
 * [http://wordpress.org/extend/plugins/google-analytics-for-wordpress/](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/)

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/2/?output_format=md)

 *  [dieselops](https://wordpress.org/support/users/dieselops/)
 * (@dieselops)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3551980)
 * I am having the exact same issue. I hope to see a solution.
 *  [le.gentleman](https://wordpress.org/support/users/legentleman/)
 * (@legentleman)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3551985)
 * I have the same issue after I upgraded to 4.31 . Of course the rest of wordpress
   is all up to date.
    : Fatal error: Cannot use string offset as an array in …/
   wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line
   332
 *  [BigEfromDaBx](https://wordpress.org/support/users/bigefromdabx/)
 * (@bigefromdabx)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552002)
 * I have the same error and I think its affecting my WP to twitter plugin.
 * Fatal error: Cannot use string offset as an array in /home/fu2clan/public_html/
   wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line
   332
 *  [xxsemmiexx](https://wordpress.org/support/users/xxsemmiexx/)
 * (@xxsemmiexx)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552042)
 * Same issue
 *  [Yannick](https://wordpress.org/support/users/yjaquier/)
 * (@yjaquier)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552078)
 * Same issue after upgrade from 4.2.8…
 *  [clubmango](https://wordpress.org/support/users/clubmango/)
 * (@clubmango)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552094)
 * I’m also getting the very same error.
 *  [tmusbach](https://wordpress.org/support/users/tmusbach/)
 * (@tmusbach)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552096)
 * I believe I may have the same issue, but I’m not sure. I tried to install 3 plugin“
   updates” last night, including Google Analytics and social sharing (but I didn’t
   write down the exact version IDs).
 * But now I’m getting **a blank screen** when I try to login to my blog! So I can’t
   even find if there’s an “undo” button.
 * My blog is [http://thecareerbeat.com](http://thecareerbeat.com) and the site 
   appears to show up. But when you click on an actual headline to get to the post,
   it goes blank.
 * I’ve had this site for years and never had this kind of problem. Any suggestions
   of what I can do to get basic admin functions back?
 * Thanks for any help!
 *  [le.gentleman](https://wordpress.org/support/users/legentleman/)
 * (@legentleman)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552114)
 * After the update to 4.32 I still get this message. It seems like just the line
   of the error changed.
    Fatal error: Cannot use string offset as an array in …/
   wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line
   344
 *  [othanash](https://wordpress.org/support/users/othanash/)
 * (@othanash)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552122)
 * Same here: `Fatal error: Cannot use string offset as an array in /homepages/.../
   htdocs/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php
   on line 344`
 *  [Eric Liddon](https://wordpress.org/support/users/eliddon/)
 * (@eliddon)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552126)
 * So I had a similar issue. Everything worked fine on 4.2.8 Then I upgraded PHP
   to 5.3 (from 5.2.17) and I recieved this error:
 * Warning: Parameter 2 to add_ga_custom_vars() expected to be a reference, value
   given in …/wp-includes/plugin.php on line 173
 * So I tried upgrading to 4.3.2 of the plugin and I received the error:
    Fatal 
   error: Cannot use string offset as an array in …/wp-content/plugins/google-analytics-
   for-wordpress/admin/class-admin.php on line 344
 * I had a custom filter to add custom vars using the following in my functions.
   php in my theme folder:
    add_filter(‘yoast-ga-custom-vars’,’add_ga_custom_vars’,
   10,2);
 * (I didn’t include function yet).
 * Once I disabled this filter I had neither error mentioned above…
 *  [Eric Liddon](https://wordpress.org/support/users/eliddon/)
 * (@eliddon)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552127)
 * So figured my issue, In my filter:
 * add_filter(‘yoast-ga-custom-vars’,’add_ga_custom_vars’,10,2);
 * I had the following for my function declaration:
    function add_ga_custom_vars(
   $push, &$customvarslot) {
 * Passing by reference was depreciated in php 5.3 and removed in 5.4 (see [Here](http://php.net/manual/en/language.references.pass.php)
 *  [BigEfromDaBx](https://wordpress.org/support/users/bigefromdabx/)
 * (@bigefromdabx)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552129)
 * got message of new update today. When I updated I still have issues. Getting 
   the following error.
 * > Cannot use string offset as an array in /home/fu2clan/public_html/wp-content/
   > plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344
 *  [Kerry Adams](https://wordpress.org/support/users/kerry-adams/)
 * (@kerry-adams)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552136)
 * Same error here. 🙁
 *  [mikaelhm](https://wordpress.org/support/users/mikaelhm/)
 * (@mikaelhm)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552139)
 * I have the same error, on some of my client sites, but others not. They run on
   the same server with same PHP 5.3.10 and WP 3.5.1
 * – mikaelhm
 *  [odysseyschool](https://wordpress.org/support/users/odysseyschool/)
 * (@odysseyschool)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/#post-3552143)
 * Also having the same issue. Does anyone know if and what earlier versions are
   working?

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/2/?output_format=md)

The topic ‘Fatal error: Cannot use string offset as an array’ is closed to new replies.

 * ![](https://ps.w.org/google-analytics-for-wordpress/assets/icon.svg?rev=2976619)
 * [MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/)

## Tags

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

 * 32 replies
 * 24 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-2/page/3/#post-3552258)
 * Status: not resolved