Hi,
Just came across the same issue, some additional information:
When adding
_gaq.push([‘_setSiteSpeedSampleRate’, 100]);
to the custom code section,
_gaq.push([\’_setSiteSpeedSampleRate\’, 100]);
is stored in the database and this is reflected by looking at this option again after adding it for the first time. The result when loading the page however is
_gaq.push([‘_setSiteSpeedSampleRate’, 100]);
and that is working well.
Now when you just hit save on the analytics settings page for the second time, the following will be stored in the database:
_gaq.push([\\\’_setSiteSpeedSampleRate\\\’, 100]);
When loading the page again
_gaq.push([\’_setSiteSpeedSampleRate\’, 100]);
will be the result and that’s where the analytic code breaks and stops recording.
So there seems to be an issue with escaping special characters when storing this value. The first time the '
will get escaped to \'
and that just seems to be fine. But on a subsequent save both the escaping character as well as the original ones will be escaped again, resulting in the \\\'
which breaks it. Assuming that each subsequent save will add a lot of backslashes.
So current workaround is to remove any backslashes from the custom code setting whenever you are saving the settings.