Support » Plugin: Google Analytics for WordPress by MonsterInsights » 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?



  • The topic ‘Custom code changes after saving plugin settings’ is closed to new replies.