Iam using Google Tag manager==GTM as well as Visual Website Optimizer==VWO. All the script tags for both application are implemented accordingly.
In order to be able to track revenue we have to save the transactionTotal of an order into a variable that VWO uses to count the conversion rates on a specific test. The VWO clicks and visits are counted correctly but not the conversion.
I have created a macro in GTM ({transactionTotal}) based on fetching the data.
First I get all the meta tags where we have the ecommerce values.
var metaObj = {}, m = document.getElementsByTagName('meta'), i = m.length; //scope expanded from only .head while (i--) { // looping down will result in the same behaviour as stopping @ 1st metaObj[m[i].name] = m[i].content; }Then push the meta value in the dataLayer
dataLayer.push({'transactionId': metaObj['WT.tx_i']});
In GTM I created a macro
in the confirmation page:
//should be the value of the order total var _vis_opt_revenue = ({transactionTotal});
This returns an error and no value is save in this variable.
Any ideas or help is much appreciated.