PDA

View Full Version : Google Analytics - Tracking Code on Invoice Page


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

rossow_b
01-16-07, 05:20 PM
Anyone? Anyone have the same problem or have a suggestion? Does an additional "item" need to be checked on the invoice page's items? Possibly "product"? Right now, only the pages default items are checked (only the items that were initially checked upon setup of the store).

Any suggestions would be greatly appreciated!

Thanks!

Brian

Synergee
02-09-07, 08:23 PM
Brian,

Are you seeing ecommerce information in your Analytics reporting? Order Totals, Conversions, etc? I'm seeing a lot of data in my reporting but no values for ecommerce transactions.

I also notice that once my customers begin the checkout process and begin using SSL, the Session_ID is not appended with any Screen info, so its difficult to set up Goals tracking for the invoice page when using SSL.

GCrame5832
02-10-07, 07:53 AM
Not to hijack the thread but real quick question... I know where to place to tracking code but I dont know how. All i know is it goes on the receipt page/invoice confirmation page. I know this page is not static and therefore i dont know where to put it. Any help would be greatly appreciated. Thankyou!

Synergee
02-11-07, 07:56 AM
Not to hijack the thread but real quick question... I know where to place to tracking code but I dont know how. All i know is it goes on the receipt page/invoice confirmation page. I know this page is not static and therefore i dont know where to put it. Any help would be greatly appreciated. Thankyou!
I placed my code in the footer section of the Invc page.

Vic - WolfPaw Computers
02-11-07, 06:01 PM
We have step by step instructions in our knowledge base:
http://www.wpcomp.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=1&nav=0

Not to hijack the thread but real quick question... I know where to place to tracking code but I dont know how. All i know is it goes on the receipt page/invoice confirmation page. I know this page is not static and therefore i dont know where to put it. Any help would be greatly appreciated. Thankyou!

Synergee
02-11-07, 09:03 PM
Please disregard my previous post regarding placing Analytics code in the footer section of the invc page. I actually placed the Google Conversion tracking code there because ecommerce data is not showing in my Analytics reports. I've therefore reverted back to using conversion tracking to obtain that data.

My analytics code was inserted as described in the instructions in the previous posting.

dreamingdigital
03-03-07, 02:50 AM
For some reason miva doesnt like parsing the price tokens when surrounded by |'s. Anyways, I'm going to post what I just got working. I'd suggest using this. I replaced the affiliate part because we don't use that. Also, if you use customer: like the above example it will only work if the customer is logged in. That's why you got those blank parts. Use my example instead. I also put in room for our PST tax (rename to what your 2nd tax is. This will stop you from having a strange looking number with 2 decimals where both taxes are together as one number.


<form name="utmform" style="display:none;">
<textarea id="utmtrans" style="display:none;">
UTM:T|<mvt:if expr="NOT ISNULL l.settings:order:id">&mvt:order:id;</mvt:if>|dreamingdigital| &mvt:order:total; |<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'TAX' "><mvt:if expr="l.settings:charge:descrip EQ 'PST Tax' ">, </mvt:if>&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>|&mvte:order:ship_city;|&mvte:order:ship_state;|&mvte:order: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; |dreamingdigital| &mvt:item:price; |&mvt:item:quantity;
</mvt:foreach>
</textarea>
</form>

<script type="text/javascript">
__utmSetTrans();
</script>

Hope that helps ppl.