Thanks Eric, seems to have done the trick.
The only thing I noticed, and I don't know if this is the expected behaviour, is that I have to re-encode it on the web page where it is delivered.
For example:
<?php echo str_replace("|", "&#124;",$row_rsconfig['analyticscode']); ?>
Also, if this problem is addressed in Data Assist will I have to readdress all of this (i.e remove the code that fixed it?)
Cheers
Ian