PHP Conversion Tracking On The Same Page

Giarc86

Expert Member
Joined
May 28, 2008
Messages
1,243
Reaction score
4
Hi there

I have a PHP form that once filled in and submit is clicked it goes to the current page again, an if statement is run and the data is sent to the required email addresses.
What I am needing to do now though is install conversion tracking on the page but only after it has been submitted should it count towards the tracking.

If the form looks like this:
PHP:
<form id="form1" name="form1" method="post" action="<?php echo curPageURL(); ?>#applyform">

and the tracking code like this:
HTML:
<!-- Google Code for Purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = 1234567890;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "666666";
var google_conversion_label = "Purchase";
//-->
if (<? echo $applyform ?>) {
var google_conversion_value = <? echo $applyform ?>
}
</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/1234567890/?value=<? echo
$totalValue ?>&label=Purchase&script=0">
</noscript>
</body>

Would it work?
Or should the variables be different?

Thanks
 
Top
Sign up to the MyBroadband newsletter
X