rossow_b
01-05-07, 08:37 PM
Hi all - I'm Working on fine tuning the Google Analytics code so that I can track my sales. I have it working, and it's posting the tranactions to Google, however, some of the order data is not populating the hidden google form that you place on the invoice/receipt page.
Here is the code that I found in the forums that I'm using on the invoice page:
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|<mvt:if expr="NOT ISNULL l.settings:order:id">&mvt:order:id;</mvt:if>|&mvt:global:affiliate;|&mvt:order:total;|<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'TAX'">&mvt:charge:amount;</mvt:if></mvt:foreach>|<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">&mvt:charge:amount;</mvt:if></mvt:foreach>|&mvt:global:customer:ship_city;|&mvt:global:customer:ship_state;|&mvt:global:customer:ship_cntry;
<mvt:foreach iterator="item" array="order:items">
UTM:I|<mvt:if expr="NOT ISNULL l.settings:order:id">&mvt:order:id;</mvt:if>|&mvt:item:code;|&mvt:item:name;|category|&mvt:item:price;|&mvt:item:quantity;
</mvt:foreach>
</textarea>
</form>
Here is what miva spits out when I place a test order (source code on invoice/receipt page):
<!--google analytics tranaction form-->
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|1136||38.93|0.000|13.930|||
UTM:I|1136|BLT|Ebony and Coffee Bean Belt|category|&mvt:item:price;|1
</textarea>
</form>
<!--call function to submit tracking form-->
<script type="text/javascript">
__utmSetTrans();
Note the following variables didn't populate in the form:
- &mvt:global:customer:ship_city; - blank
- &mvt:global:customer:ship_state; - blank
- &mvt:global:customer:ship_cntry; - blank
- &mvt:item:price; - show miva variable, not data
- category isn't a variable ... anyone know if you can actually input the category that the product belongs to?
Any help would be appreciated! Thanks!!!
- Brian
Here is the code that I found in the forums that I'm using on the invoice page:
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|<mvt:if expr="NOT ISNULL l.settings:order:id">&mvt:order:id;</mvt:if>|&mvt:global:affiliate;|&mvt:order:total;|<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'TAX'">&mvt:charge:amount;</mvt:if></mvt:foreach>|<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">&mvt:charge:amount;</mvt:if></mvt:foreach>|&mvt:global:customer:ship_city;|&mvt:global:customer:ship_state;|&mvt:global:customer:ship_cntry;
<mvt:foreach iterator="item" array="order:items">
UTM:I|<mvt:if expr="NOT ISNULL l.settings:order:id">&mvt:order:id;</mvt:if>|&mvt:item:code;|&mvt:item:name;|category|&mvt:item:price;|&mvt:item:quantity;
</mvt:foreach>
</textarea>
</form>
Here is what miva spits out when I place a test order (source code on invoice/receipt page):
<!--google analytics tranaction form-->
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|1136||38.93|0.000|13.930|||
UTM:I|1136|BLT|Ebony and Coffee Bean Belt|category|&mvt:item:price;|1
</textarea>
</form>
<!--call function to submit tracking form-->
<script type="text/javascript">
__utmSetTrans();
Note the following variables didn't populate in the form:
- &mvt:global:customer:ship_city; - blank
- &mvt:global:customer:ship_state; - blank
- &mvt:global:customer:ship_cntry; - blank
- &mvt:item:price; - show miva variable, not data
- category isn't a variable ... anyone know if you can actually input the category that the product belongs to?
Any help would be appreciated! Thanks!!!
- Brian