Jose & Jenny:
You can do that with some JavaScript! Eric Hollebone wrote about it
here. On that page, you want to use the third method: using Marketo's pre-submit.
You can either put this code in the template or the individual landing pages under "Landing Page Actions > Edit Page Meta Tags." Then you can paste this code into the "Custom HEAD HTML:" section.
Depending on whether or not your template calls jQuery before, you might not need the first line of Javascript.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><script type="text/javascript"> jQuery(document).ready(function($){
// bind to the form submit
$(&
#039;
#mktFrmSubmit&
#039;).submit(function(event) {
// test to see if at least one of the fields is filled in ...
// inject the google adword conversion code
var google_conversion_id=
... your google adwords id ...,
google_conversion_language="en",
google_conversion_format="3",
google_conversion_color="ffffff",
google_conversion_label='
... your google conversion label ...",
google_conversion_value=0;
$.getScript( "http://www.googleadservices.com/pagead/conversion.js" );
});
});
</script>
The commented "// test to see if at least one of the fields is filled in ..." is where you can add in simple validation to make sure the form is filled before counting it as an AdWords conversion. This can be as simple or detailed as you want.
This form still works (when replacing the appropriate fields) without field validation, but using the code without validation means that users hitting the "submit" button will be counted as conversions even if the form throws an error at them. So if you're using this without validation, just be wary of having a higher amount of AdWords conversions than actual leads in your database. Doing validation might be overkill, depending on your specific use!
Best Regards,
Edward Unthank
SEO/Web Specialist