Forum Moderators: DixonJones
As I want to track the sub total of the sale I tried adding $sub_total, which is the variable, to the tracking code.
The receipt page loaded with a javascript error, saying "$ sub_total is undefined" .
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...
If using ASP, add this to the javascript:
var google_conversion_value = <%= $sub_total %>;
If using PHP, add this:
var google_conversion_value = <? $sub_total ?>;