Home Integration Methods Miva 5

Miva 5

Miva 5 integration method. This integration method includes click and sale tracing.
1
Add click tracking code
Login to your PAP4 merchant panel. Go  Menu->Tools->Integration. Click on Click tracking icon. Copy your click tracking code from window that opened. Code is located just bellow Copy & paste this JavaScript code to your page sign.
Now login to your Miva5 admin panel. Go Left menu->Pages. Now click edit on INVC Invoice page. 
Now pick Global Header & Footer* from top menu. Now add code, you copy from your merchant panel, to the same end of textarea named Global Footer.
Now click Update button.

2
Add sale tracking code
Login to your Miva5 admin panel. Go Left menu->Pages. Now click edit on INVC Invoice page. 
Now paste sale tracking code to textarea named Template, just after row that contains text <mvt:item name="body">:

Example:

<mvt:item name="html_profile" />
<head>
<title>&mvt:store:name;: Invoice</title>
<base href="&mvt:global:basehref;">
<mvt:item name="head" param="head_tag" />
</head>
<mvt:item name="body">
<mvt:item name="mslscb" param="invc" /> 
<mvt:item name="hdft" param="global_header" />  
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="bottom">
<mvt:item name="navbar" />
</td>
</tr>
...

Now we add sale tracking code:
<mvt:item name="html_profile" />
<head>
<title>&mvt:store:name;: Invoice</title>
<base href="&mvt:global:basehref;">
<mvt:item name="head" param="head_tag" />
</head>
<mvt:item name="body">
<script type="text/javascript">
document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "
www.yoursite.com/affiliate/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
</script>
<script type="text/javascript">
function stringFilter (s) {
filteredValues = "1234567890.,";     
var i; var returnString = "";
for (i = 0; i < s.length; i++) {
var c = s.charAt(i);
if (filteredValues.indexOf(c) != -1) {
returnString = "" + returnString + "" + c;
}
}
return returnString;
}
var counter = 0;
var sales = new Array();
PostAffTracker.setAccountId('default1');
<mvt:foreach iterator="item" array="order:items">
sales[counter] = PostAffTracker.createSale();
sales[counter].setTotalCost(stringFilter(' &mvt:item:formatted_subtotal;'));
sales[counter].setOrderID(' &mvt:order:id;'.substr(1));
sales[counter].setProductID(' &mvt:item:code;'.substr(1));
counter ++;
</mvt:foreach> PostAffTracker.register();
 </script>

<mvt:item name="mslscb" param="invc" /> 
<mvt:item name="hdft" param="global_header" />  
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="bottom">
<mvt:item name="navbar" />
</td>
</tr>
...

Thats it. Now you can track your sales.

Note: Every produt is tracked as single transaction. For every product in customer basket we record its price, code and orderId from your Miva5 store.
If you want to add additional fields read this Miva5 template technical documentation.

not working for me

1 years ago Florentin Stroe
Hi there.

Shouldn't this:

<script type="text/javascript">
document.write(unescape("%3Cscript id=%27affiliate_id%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "www.yoursite.com/affiliate/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
</script> <script type="text/javascript">

Actually be:

<script type="text/javascript">
document.write(unescape("%3Cscript id='affiliate_id' src='" + (("https:" == document.location.protocol) ? "https://" : "http://") + "www.yoursite.com/affiliate/scripts/trackjs.js' type='text/javascript'%3E%3C/script%3E"));
</script> <script type="text/javascript">

Are the %27 's needed?