How to Get Product Summary ClickFunnels for Tracking on Facebook Pixel or Google

A Snippet to pass order value to facebook from clickfunnels confirmation screen.

How to get order total of clickfunnel summary at the end of the funnel. This script loops all the elements with the amount class and adds them. It then creates a variable to pass on to the facebook event. We named the variable myOrderTotal

<script>
	 var myOrderTotal = 0;
	$( ".elOrderProductOptinPrice" ).each(function( index ) {

	  var textString = $( this ).text();
	  var myNewText = textString.replace('$', '');
	  myAmount = parseFloat(myNewText); 
	  myOrderTotal = myOrderTotal + +myAmount;
	  
	});
	console.log(myOrderTotal);

	fbq('track', 'Purchase', {currency: "USD", value: myOrderTotal});
</script>