Welcome to WebmasterWorld Guest from 18.104.22.168
As I want to track the sub total of the sale I tried adding $sub_total, which is the variable, to the tracking code.
So, I thought the dollar sign could be causing a problem, so I removed, but go the same error.
The thing is that the variable $sub_total is used right above on the receipt page with no problems at all. It shows the sub total ammount of the sale.
But on the conversion code it generates a js error and says it's undefined.
Is it common? Should I use the $sub_total or just sub_total?
Am i forgetting something?
Thanks a lot for helping.
This should do the trick...
var google_conversion_value = <%= $sub_total %>;
If using PHP, add this:
var google_conversion_value = <? $sub_total ?>;