Please see the page from this link https://genuineemailmarketing.formstack.com/forms/done this ordering from is generated by formstack.com. In the page there is a field named "Total" which is the total amount of ordering. When anyone submit the order they are redirect in a thank-you.php page. In that thank you page i have a javascript google Conversion coding. The coding is given below-
Google Code for Purchase-NEW Conversion Page:
var google_conversion_id = 1000063495;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EsxZCN3fmWt9mf3s4AM";
var google_conversion_value = 50.00;
var google_conversion_currency = "USD";
var google_remarketing_only = false;
Now in the 6th line "var google_conversion_value = 50.00;" here i need the dynamic value which will be replace in the place of 50.00 and the dynamic value will come from the formstack form's field named "total" which is the total amount of ordering. 50.00 will be dynamic variable.
If anyone know the process how can i do it please give me the solution. And if anyone need any other information or have any confusion about my problem, just ask. THank You
I'm assuming that you are redirecting your users to http://www.genuineemailmarketing.com/thank-you.php after they fill out the form.
You will need to do the following:
function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); }
Then you can populate your variable google_conversion_value as followed:
var google_conversion_value = getParameterByName('Total');
I hope this helps!