I have never used Google Adwords on the site, so if I am mistaken about "lingo", do not hesitate to correct me.
Iβm working on a site that has a landing page for one of its campaigns on Google AdWord. On this page there is a form that, when processing, takes you to another page to say "Thank you for your request ...". I deleted this and rewrote it in PHP and Javascript to prevent the page from refreshing or redirecting.
The problem is that on the thank you page, the Google code is a little different and runs when the page loads. My question is, how can I re-execute the conversion code with different variables without reloading the page? Is there a google script for this?
Deletes a script tag and then re-places it again to re-script?
This is the code I have (before submitting the form):
<script type="text/javascript"> var google_conversion_id = 000000; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "abcdefg"; 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/000000/?label=abcdefg&guid=ON&script=0"/> </div> </noscript>
What you need to change after submitting the form:
var google_conversion_id = 111111; var google_conversion_label = "gfedcba"; "http://www.googleadservices.com/pagead/conversion/gfedcba/?label=111111&guid=ON&script=0
Changing variables is easy! The hard part is restarting the script with the new variables.
Any help is much appreciated!
UPDATE
The answer to the post here probably solves this question, however I would like to know how I can represent other variables with the variables mentioned in this answer. They are pretty clear, but I can't be sure that they are right!
Also, does anyone know where on Google I can really see instructions for this?
Ben carey
source share