I m trying to echo out the Javascript for the Google AdWords conversion tracking code within a PHP if statement. I ve done a bunch of googling but can t seem to find a definitive list of what characters I d need to escape to have the code execute properly. Anybody have suggestions?
This first bit of code is the beginning of the if statement that calls an include with the conversion code snippet:
if ( @mailit ) {
include ("conversioncodes.php");
This is the contents of conversioncodes.php that includes the code snippet that I m trying to figure out how to escape properly. The goal is to have the conversion code track the conversion when the conditions of the if statement is met.
echo "<!-- Google Code for Homepage Form Submit Conversion Page -->
<script type="text/javascript">
<!--
var google_conversion_id = XXXXXXXXXX;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "XXXXXXXXXXXXXXX";
var google_conversion_value = 0;
//-->
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/?label=XXXXXXXXXXXXXXXXXXX&guid=ON&script=0"/>
</div>
</noscript>";