Title: Custom code changes after saving plugin settings
Last modified: August 21, 2016

---

# Custom code changes after saving plugin settings

 *  [Rick Sportel](https://wordpress.org/support/users/ricksportel/)
 * (@ricksportel)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/custom-code-changes-after-saving-plugin-settings/)
 * Hi,
 * I use a piece of custom code to increase the Google Analytics sitespeed sampling
   rate. This is a good addition to the standard GA code for measuring page load
   times on websites that do not have a lot of visitors.
 * The piece of code I use for the plugin’s field ‘custom code’ is:
 * _gaq.push([\’_setSiteSpeedSampleRate\’, 100]);
 * When you save the options and open the plugin settings page again and save it
   another time, this code changes to:
 * _gaq.push([\\’_setSiteSpeedSampleRate\\’, 100]);
 * If you keep saving the plugin’s options it changes to:
 * _gaq.push([\\\’_setSiteSpeedSampleRate\\\’, 100]);
    _gaq.push([\\\\’_setSiteSpeedSampleRate\\\\’,
   100]);
 * As a result the custom code isn’t working anymore.
 * Is there a way to solve this?
 * Cheers,
 * Rick
 * [http://wordpress.org/plugins/google-analytics-for-wordpress/](http://wordpress.org/plugins/google-analytics-for-wordpress/)

The topic ‘Custom code changes after saving plugin settings’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [Rick Sportel](https://wordpress.org/support/users/ricksportel/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/custom-code-changes-after-saving-plugin-settings/)
 * Status: not resolved