Originally posted by kayakbabe
View Post
Code:
<mvt:comment>Begin Google Tracking Code</mvt:comment> <mvt:if expr="g.Secure EQ 1"> <script src="https://ssl.google-analytics.com/ga.js" type="text/javascript"></script> <mvt:else> <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> </mvt:if> <script type="text/javascript"> <mvt:if expr="g.Screen EQ 'PROD'"> var productCode = "&mvte:product:code;"; <mvt:elseif expr="g.Screen EQ 'CTGY'"> var categoryCode = "&mvte:category:code;"; <mvt:elseif expr="g.Screen EQ 'SRCH'"> var searchQuery = "&mvte:global:Search;"; <mvt:else> var screenCode = "&mvte:global:screen;"; </mvt:if> var pageTracker = _gat._getTracker("UA-XXXXXX-X"); <mvt:if expr="g.Screen EQ 'PROD'"> pageTracker._trackPageview('/product/' + productCode + '.html'); <mvt:elseif expr="g.Screen EQ 'CTGY'"> pageTracker._trackPageview('/category/' + categoryCode + '.html'); <mvt:elseif expr="g.Screen EQ 'SRCH'"> pageTracker._trackPageview('/search.html?srch=' + searchQuery); <mvt:elseif expr="(g.screen EQ 'BASK')"> pageTracker._trackPageview('/checkout/basket.html'); <mvt:elseif expr="(g.screen EQ 'ORDL')"> pageTracker._trackPageview('/checkout/login.html'); <mvt:elseif expr="(g.screen EQ 'OCST')"> pageTracker._trackPageview('/checkout/address.html'); <mvt:elseif expr="(g.screen EQ 'OSEL')"> pageTracker._trackPageview('/checkout/shipping.html'); <mvt:elseif expr="(g.screen EQ 'OPAY')"> pageTracker._trackPageview('/checkout/payment.html'); <mvt:elseif expr="(g.screen EQ 'POSTACTION_OSEL')"> pageTracker._trackPageview('/checkout/pre_shipping.html'); <mvt:elseif expr="(g.screen EQ 'OINF')"> pageTracker._trackPageview('/checkout/begin_checkout.html'); <mvt:elseif expr="(g.screen EQ 'ACAD')"> pageTracker._trackPageview('/store/customer_create.html'); <mvt:elseif expr="(g.screen EQ 'SFNT')"> pageTracker._trackPageview('/store/storefront.html'); <mvt:elseif expr="(g.screen EQ 'SMAP')"> pageTracker._trackPageview('/store/sitemap.html'); <mvt:elseif expr="(g.screen EQ 'ACED')"> pageTracker._trackPageview('/store/customer_edit.html'); <mvt:elseif expr="(g.screen EQ 'BSKE')"> pageTracker._trackPageview('/store/basket_empty.html'); <mvt:elseif expr="(g.screen EQ 'LOGN')"> pageTracker._trackPageview('/store/customer_login.html'); <mvt:elseif expr="(g.screen EQ 'INVC')"> pageTracker._trackPageview('/checkout/invoice.html'); pageTracker._addTrans( "&mvte:order:id;", "", "&mvte:order:total;", <mvt:if expr="l.settings:order:charges"><mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'TAX'">"&mvte:charge:amount;",</mvt:if></mvt:foreach><mvt:else>"0.00",</mvt:if> <mvt:if expr="l.settings:order:charges"><mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">"&mvte:charge:amount;",</mvt:if></mvt:foreach><mvt:else>"0.00",</mvt:if> "&mvte:order:ship_city;", "&mvte:order:ship_state;", "&mvte:order:ship_cntry;" ); <mvt:foreach iterator="item" array="order:items"> pageTracker._addItem( "&mvte:order:id;", "&mvte:item:code;", "&mvte:item:name;", "", "&mvte:item:price;", "&mvte:item:quantity;" ); <mvt:foreach iterator="option" array="item:options"> </mvt:foreach> </mvt:foreach> pageTracker._trackTrans(); <mvt:else> pageTracker._trackPageview('/page/' + screenCode + '.html'); </mvt:if> </script> <mvt:comment>End Google Tracking Code</mvt:comment>
Leave a comment: