For some reason when placing an order and you are brought to the INVC page the url in the browser is reading
/mm5/merchant.mvc?
instead of the short URI
/INVC.html
Here is my INVC page code:
We are using the Miva 9 URI management and we are on the Suivant Readytheme.
I would like to fix this so i don't need to use special code in our analytics tracking for conversion tracking and pageviews on the INVC screen
Below is the current code i am using for google analytics.
Thanks for any help.
-Nick
/mm5/merchant.mvc?
instead of the short URI
/INVC.html
Here is my INVC page code:
Code:
<mvt:item name="html_profile" />
<head>
<mvt:if expr="NOT ISNULL l.settings:page:title">
<title>&mvt:page:title;</title>
<mvt:else>
<title>&mvt:store:name;: &mvt:page:name;</title>
</mvt:if>
<mvt:item name="head" param="head_tag" />
<mvt:if expr="l.settings:payment:capabilities:split">
<script type="text/javascript">
function AmountType_Changed( amounttype ){
var balance_amount, amount, additional;
balance_amount = document.getElementById( 'payment-balance-amount' );
amount = document.getElementById( 'payment-amount' );
additional = document.getElementById( 'payment-additional' );
if ( amounttype === 'total' )
{
amount.disabled = true;
additional.style.display = 'none';
if ( balance_amount )
{
balance_amount.disabled = true;
}
}
else if ( amounttype === 'balance' )
{
amount.disabled = true;
additional.style.display = '';
if ( balance_amount )
{
balance_amount.disabled = false;
}
}
else if ( amounttype === 'partial' )
{
amount.disabled = false;
additional.style.display = '';
if ( balance_amount )
{
balance_amount.disabled = true;
}
}
}
</script>
</mvt:if>
</head>
<body id="js-&mvte:page:code;" class="<mvt:eval expr="tolower(l.settings:page:code)" /> single-column">
<mvt:item name="hdft" param="global_header" />
<mvt:item name="html_profile" />
<div class="row hdft-header">
<mvt:item name="hdft" param="header" />
</div>
<div class="row main-content-row">
<div class="column whole cart-contents">
<form method="post" action="&mvt:payment:url;" id="js-opay-form" class="clearfix">
<input type="hidden" name="Action" value="AUTH" />
<input type="hidden" name="Screen" value="INVC" />
<input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" />
<mvt:item name="payment" />
<input type="hidden" name="PaymentMethod" value="&mvte:global:PaymentMethod;" />
<input type="hidden" name="SplitPaymentData" value="&mvte:global:SplitPaymentData;" />
<input type="hidden" name="PaymentDescription" value="&mvte:payment:desc;" />
<div>
<p class="column whole h4 fields-heading" style="background:#e8e8e8;margin-bottom:0"><span class="icon-icon_lock"></span> Payment Method: &mvt:payment:desc;</p>
</div>
<div class="column whole bg-lt-gray ptp1 pbm1 mbm1-25">
<div class="column whole medium-half">
<mvt:if expr="NOT ISNULL l.settings:payment:desc">
<span class="bold"></span>
</mvt:if>
<mvt:if expr="NOT ISNULL l.settings:payment:message">
<p class="column whole">&mvt:payment:message;</p>
</mvt:if>
<mvt:if expr="l.settings:paymentsettings:mivapay:enabled AND ( l.settings:mivapay:paymentcardtype:id OR l.settings:mivapay:paymentcard:id )">
<div class="form-row">
<mvt:item name="mivapay" />
</div>
<mvt:elseif expr="'brain' CIN g.PaymentMethod">
<mvt:foreach array="payment:fields" iterator="field">
<div class="form-row">
<mvt:item name="payment" param="field:code" />
</div>
</mvt:foreach>
<mvt:else>
<mvt:foreach array="payment:fields" iterator="field">
<div id="js-&mvt:field:code;" class="form-row">
<mvt:if expr="l.settings:field:invalid">
<label class="required error">&mvt:field:prompt;</label>
<mvt:else>
<label class="required">&mvt:field:prompt;</label>
</mvt:if>
<div class="&mvt:field:code;"><mvt:item name="payment" param="field:code" /></div>
</div>
</mvt:foreach>
</mvt:if>
<mvt:if expr="l.settings:payment:capabilities:split">
<div class="form-row">
<mvt:if expr="g.Amount_Invalid">
<label class="required error">Payment Amount:</label>
<mvt:else>
<label class="required">Payment Amount:</label>
</mvt:if>
<div id="payment-amount-fields">
<mvt:if expr="( NOT l.settings:payment:capabilities:balance ) OR ( l.settings:payment:balance GE l.settings:splitpayment:remaining )">
<mvt:if expr="NOT g.UI_Exception">
<mvt:assign name="g.AmountType" value="'total'" />
<mvt:assign name="g.Amount" value="l.settings:splitpayment:remaining ROUND 2" />
</mvt:if>
<mvt:if expr="g.AmountType EQ 'total'">
<input type="radio" name="AmountType" value="total" onclick="AmountType_Changed( this.value );" checked />
<mvt:else>
<input type="radio" name="AmountType" value="total" onclick="AmountType_Changed( this.value );" />
</mvt:if>
<mvt:if expr="NOT ISNULL l.settings:payment:split_data">
Remaining Order Total (&mvt:payment:formatted_remaining;)<br />
<mvt:else>
Entire Order Total (&mvt:basket:formatted_total;)<br />
</mvt:if>
<mvt:else>
<mvt:if expr="NOT g.UI_Exception">
<mvt:assign name="g.AmountType" value="'balance'" />
<mvt:assign name="g.Amount" value="l.settings:payment:balance ROUND 2" />
</mvt:if>
<mvt:if expr="g.AmountType EQ 'balance'">
<input type="radio" name="AmountType" value="balance" onclick="AmountType_Changed( this.value );" checked />
<input type="hidden" id="payment-balance-amount" name="Amount" value="&mvte:payment:balance;" />
<mvt:else>
<input type="radio" name="AmountType" value="balance" onclick="AmountType_Changed( this.value );" />
<input type="hidden" id="payment-balance-amount" name="Amount" value="&mvte:payment:balance;" disabled />
</mvt:if>
Available Balance (&mvt:payment:formatted_balance;)<br />
</mvt:if>
<mvt:if expr="g.AmountType EQ 'partial'">
<input type="radio" name="AmountType" value="partial" onclick="AmountType_Changed( this.value );" checked />
Partial: <input type="text" id="payment-amount" name="Amount" value="&mvte:global:Amount;" />
<mvt:else>
<input type="radio" name="AmountType" value="partial" onclick="AmountType_Changed( this.value );" />
Partial: <input type="text" id="payment-amount" name="Amount" value="&mvte:global:Amount;" disabled />
</mvt:if>
</div>
</div>
<mvt:if expr="g.AmountType EQ 'total'">
<mvt:assign name="g.totalPayment" value="'display: none;'" />
</mvt:if>
<div id="payment-additional" style="&mvt:global:totalPayment;">
<div class="form_row">
<label class="required">Pay Additional Balance With:</label>
<select name="AdditionalPaymentMethod">
<mvt:foreach array="paymentmethods" iterator="method">
<mvt:if expr="(l.settings:method:module NE 'customercredit') OR ((g.PaymentMethod NE 'customercredit:credit') AND (NOT miva_array_search(l.settings:splitpayment:splits, 1, l.split, 'l.split:module:code EQ l.settings:method:module')))">
<mvt:if expr="l.settings:method:paymentcard:id">
<option value="paymentcard:&mvte:method:paymentcard:id;">&mvt:method:name;</option>
<mvt:elseif expr="l.settings:method:paymentcardtype:id">
<option value="paymentcardtype:&mvte:method:paymentcardtype:id;">&mvt:method:name;</option>
<mvt:else>
<option value="&mvte:method:module;:&mvte:method:code;">&mvt:method:name;</option>
</mvt:if>
</mvt:if>
</mvt:foreach>
</select>
</div>
</div>
</mvt:if>
</div>
</div>
<div class="breaker"></div>
<div>
<div class="column whole align-center np">
<mvt:if expr="l.settings:paymentsettings:mivapay:enabled AND ( l.settings:mivapay:paymentcardtype:id OR l.settings:mivapay:paymentcard:id )">
<script>
var onclick_submit = function( event ) {
if ( MivaPay && ( typeof MivaPay.Submit === 'function' ) ) {
MivaPay.Submit( function() {
var form;
form = document.getElementById( 'js-opay-form' );
form.submit();
} );
}
}
</script>
<span onclick="onclick_submit(); return false;">
<mvt:item name="addendum" param="opay" />
<input class="button button-large-font corners bg-sky" type="submit" value="Complete Order" title="Complete Order">
<p class="ptp1"><span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=O77iPdMF08ACXGhM5cEzqTjCiEH72r6dwXCQDC3RAcc0NWC6cK"></script></span></p>
<p><script src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=f6e634926e664239a5a4daf7f9938bee"></script></span></p>
</span>
<mvt:elseif expr="'brain' CIN g.PaymentMethod">
<mvt:item name="addendum" param="opay" />
<input class="button button-large-font corners bg-sky" type="submit" value="Complete Order" title="Complete Order">
<p class="ptp1"><span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=O77iPdMF08ACXGhM5cEzqTjCiEH72r6dwXCQDC3RAcc0NWC6cK"></script></span></p>
<p><script src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=f6e634926e664239a5a4daf7f9938bee"></script></span></p>
<mvt:else>
<mvt:item name="addendum" param="opay" />
<input class="button button-large-font corners bg-sky" type="submit" value="Complete Order" title="Complete Order">
<p class="ptp1"><span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=O77iPdMF08ACXGhM5cEzqTjCiEH72r6dwXCQDC3RAcc0NWC6cK"></script></span></p>
<p><script src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=f6e634926e664239a5a4daf7f9938bee"></script></span></p>
</mvt:if>
</div>
</div>
<div class="breaker"></div>
</form>
</div>
<div class="column whole cart-summary">
<div id="js-toggle-cart-summary-contents" class="basket-header-row align-center">Cart Summary <span>▼</span></div>
<div id="js-cart-summary-contents">
<mvt:item name="basket" />
<mvt:item name="customer" />
</div>
</div>
</div>
<div class="row hdft-footer">
<mvt:item name="hdft" param="footer" />
</div>
<mvt:item name="hdft" param="global_footer" />
</body>
</html>
I would like to fix this so i don't need to use special code in our analytics tracking for conversion tracking and pageviews on the INVC screen
Below is the current code i am using for google analytics.
Code:
<mvt:miva compresswhitespace="off" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<mvt:item name="ga_jsencode" param="ga_tracking:google_id_unencoded" />', 'auto');
ga('require', 'linkid');
ga('require', 'displayfeatures');
<mvt:if expr="l.settings:page:code EQ 'INVC'">
ga('require', 'ecommerce');
ga( 'ecommerce:addTransaction', {
'id' : '<mvt:eval expr="int( l.settings:ga_tracking:order_id )" />',
'revenue' : '<mvt:item name="ga_jsencode" param="ga_tracking:order_total" />',
'affiliation' : '<mvt:item name="ga_jsencode" param="store:name" />',
'tax' : '<mvt:item name="ga_jsencode" param="ga_tracking:total_tax" />',
'shipping' : '<mvt:item name="ga_jsencode" param="ga_tracking:total_ship" />'
} );
<mvt:foreach iterator="ga_orderitem" array="ga_tracking:orderitems">
ga( 'ecommerce:addItem', {
'id' : '<mvt:eval expr="int( l.settings:ga_tracking:order_id )" />',
'name' : '<mvt:item name="ga_jsencode" param="ga_orderitem:name_unencoded" />',
'price' : '<mvt:item name="ga_jsencode" param="ga_orderitem:price" />',
'sku' : '<mvt:item name="ga_jsencode" param="ga_orderitem:code_unencoded" />',
'category' : '<mvt:item name="ga_jsencode" param="ga_orderitem:cancat_code_unencoded" />',
'quantity' : <mvt:eval expr="l.settings:ga_orderitem:quantity" />
} );
</mvt:foreach>
ga( 'ecommerce:send' );
</mvt:if>
<mvt:if expr="( g.UI_Exception NE 1 ) OR ( g.Session:cache:last_ui_exception EQ 'order_invoice' )">
<mvt:if expr="l.settings:page:code EQ 'INVC'">
ga( 'send', 'pageview', { 'page':'/INVC.html' } );
<mvt:else>
ga( 'send', 'pageview', { 'page':'/<mvt:item name="ga_jsencode" param="ga_tracking:url_override_unencoded" />' } );
</mvt:if>
</mvt:if>
</script>
-Nick
Comment