Jesseo
a certified ProStores developer

Installing Google Analytics

When installing the Google analytics code user's commonly run into an error when entering the checkout process using IE. The error reads, 'this page contains both secure and non-secure items'. Security errors during the checkout process will ruin your chances of a sale.

we address this by ensuring we only issue secure content on https pages, and insecure content on http pages. to do this, we use a logic test to see if the request is from http or https world. we then issue the proper code.

add the following code to the FOOTER TEMPLATE:

Google http/https code to install on page footer:
Code must be added to each and every page on the site. If not, Google won't do a good job tracking sessions across your site.
Be sure to replace YOUR-ACCOUNT-NUMBER-HERE
with your actual google adwords account number

<ss:if test="$request.getScheme() == 'http'">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<ss:else/>
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
</ss:if>
<script type="text/javascript">
_uacct = "YOUR-ACCOUNT-NUMBER-HERE";
urchinTracker();
</script>

add the following code to the HEADER TEMPLATE:

this is a logic test to see if the requested url is https or http. if yes, it adds some javascript to the body tag if we're in https.

<ss:if test="$request.getScheme() == 'https'">
<body onLoad="javascript:__utmSetTrans()">
<ss:else/>
<body>
</ss:if>

add the following code to the 'Checkout > Order Confirm' template:

this code sends information about the sale to the ecommerce portion of Urchin.

<form style="display:none;" name="utmform"><textarea id="utmtrans">UTM:T|<ss:value source="$invoice.confirmationNumber"/>||<ss:value format="none" source="$invoice.subTotal"/>|0.00|0.00|<ss:value source="$invoice.billToCity"/>|<ss:value source="$invoice.billToState"/>|<ss:value source="$invoice.billToCountry"/>
<ss:foreach item="detail" within="$invoice.details">UTM:I|<ss:value source="$invoice.confirmationNumber"/>|<ss:value source='$detail.sku'/>|<ss:value source="$detail.product.name"/>|<ss:value source="$detail.product.oem"/>|<ss:value format="none" source="$detail.price"/>|<ss:value source='$detail.quantity'/>
</ss:foreach>
</textarea>
</form>

Need help? - Contact Jesseo

>

Summary

Google analytics can be installed to the ProStores templates via the design studio. Be careful, several users install the code incorrectly and receive security errors during checkout, especially when using Internet Explorer.

© 2011 Jesseo Inc
Home | Contact Jesseo