I can grab the google conversion code using php. The header can send "?gcode=123456" I then want to get the conversion code "123456" to replace "xxxxxxxxxxxx" below. I tried putting <?php echo $gcode;?> in place of xxxxxxxxxxxx but obviously that is not going to work. But it explains what I'm trying to achieve. Any ideas anyone? Thanks in advance <script language="JavaScript" type="text/javascript"> <!-- var google_conversion_id = xxxxxxxxxxxx; var google_conversion_language = "en_GB"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "YQ4tCI-kjhgytfytgg"; //--> </script> <script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/1053595815/?label=YQ4tCI-kjhgytfytgg&guid=ON&script=0"/> </noscript> Code (markup):
I can help you. Create a Form on the page and put a Hidden field in it. Assign your PHP variable value to the hidden field. Close the form. Then after under that form you can write your javascript and use that hidden field ( where you had variable value) using Document.Form.formname.fieldname.value....... I hope this helps.
So I made the form: <form action="" method="post" name="gcode"> <input name="gcode" type="hidden" value="<?php echo $vargcode;?>"> </form> Code (markup): On viewing the source I now see ?gcode as a form value Still trying to figure out how to mash these together: Document.Form.formname.fieldname.value....... var google_conversion_id = xxxxxxxxxxxx; I just cant see how I get the javascript part to display the new form value. Would appreciate your help again. Thank you Mike
After 40 minutes I'm getting nowhere fast When I send the header through the url and I view my source page I see that this value="<?php echo $vargcode;?>" is updated with what I sent, cool. But I just cannot see how to replace "xxxxxxxxxxxxx" below with this new form value. <form action="" method="post" name="form1"> <input name="value1" type="hidden" value="<?php echo $vargcode;?>"> </form> <!-- Google Code for Sale of HowtoManifestAffiliateWealth Conversion Page --> <script language="JavaScript" type="text/javascript"> <!-- var google_conversion_id = xxxxxxxxxxxxx; var google_conversion_language = "en_GB"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "YQ4tCI-jgfy6rytfug"; //--> </script> Code (markup):