Title: [Plugin: Google Analytics for WordPress] Custom code
Last modified: August 20, 2016

---

# [Plugin: Google Analytics for WordPress] Custom code

 *  [mykro](https://wordpress.org/support/users/mykro/)
 * (@mykro)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/)
 * Version 4.2.2
 * If I add custom code in the admin menu, the code single quote characters are 
   being escaped, when the code is being written to the database.
 * Consequential, the code does not work.
 * Regards
    mykro
 * [http://wordpress.org/extend/plugins/google-analytics-for-wordpress/](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [xe](https://wordpress.org/support/users/xe/)
 * (@xe)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2545762)
 * Version 4.2.2 / WordPress 3.3.1/3.3.0
 * I can confirm that problem – same for double quotes.
 * I would recommend better hook-support to configure GA/plugin dynamically/manually
   or maybe just a text-field instead of an input field for custom code and the 
   quotes issues fixed.
 * Beside this it is a great plugin.
 * Thanks,
    Matt
 *  [jsruok](https://wordpress.org/support/users/jsruok/)
 * (@jsruok)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2545995)
 * v 4.2.4 / WP 3.3.1
 * Problem still exists.
 * And while we’re at it, like Matt, I too would like to see an input field for 
   custom code. 🙂
 *  [julcasa](https://wordpress.org/support/users/julcasa/)
 * (@julcasa)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546001)
 * Yep, add the same problem and this broke my stats for 1 day.
 * Here is the quick dirty fix, waiting for Yoast to update the code 😉
 * In yst_plugin_tools.php, line 99, replace
    `$val = $options[$id];` with `$val
   = stripslashes($options[$id]);`
 * That should fix it.
 * Thanks for the great plugin anyway.
    Best
 *  [wolfy_](https://wordpress.org/support/users/wolfy_/)
 * (@wolfy_)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546015)
 * I still have this problem, do you still see yhis problema?
 *  [ssawyersj](https://wordpress.org/support/users/ssawyersj/)
 * (@ssawyersj)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546019)
 * Yep, just verified today this is broken for me. It’d be nice to have it fixed.
 *  [lovebigisland](https://wordpress.org/support/users/lovebigisland/)
 * (@lovebigisland)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546041)
 * bump for this topic. I’d like to implement an [adjusted bouncerate](http://analytics.blogspot.com/2012/07/tracking-adjusted-bounce-rate-in-google.html),
   and for that I need the custom code to work..
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546042)
 * Try posting your own topic instead of posting to an 11 month old one.
    [http://wordpress.org/extend/plugins/google-analytics-for-wordpress/](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/)
 *  [lovebigisland](https://wordpress.org/support/users/lovebigisland/)
 * (@lovebigisland)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546043)
 * Hi Esmi,
 * the reason I put it here was that this post came up very high on a search on 
   my topic. I am guessing more people will be coming here through that channel.
 * In any case, thanks for the advice. I am trying a couple of things myself on 
   this subject and will get back if it works out.
 *  [P T](https://wordpress.org/support/users/pthomson87/)
 * (@pthomson87)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546044)
 * Agree with lovebigisland on this one…
 * just because a thread is old, if it’s unresolved and there are useful suggestions,
   no reason why it should be written off… guess old threads are being treated like
   the old age pensioners these days.
 * I would like to see a fix here to add support for page load time:
    `_gaq.push(['
   _setSiteSpeedSampleRate', 10]);`
 * regards,
    Paul

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Plugin: Google Analytics for WordPress] Custom code’ 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/)

 * 9 replies
 * 9 participants
 * Last reply from: [P T](https://wordpress.org/support/users/pthomson87/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code/#post-2546044)
 * Status: not resolved