econcepts:
No, both codes are for two SEPARATE tracking items.
In my post I listed code to setup E-commerce tracking, Standard Google Analytics tracking, and Conversion Tracking. All offered tracking systems within the "Google Analytics" framework.
Conversion Tracking codes do not have a "UA" or a "dash (-)" in them. Standard Google Analytics tracking DOES have the "UA" and the dash.
Again, they are two different tracking codes entirely, and are used for two totally different things. One tracks conversion data from Paid Search campaigns while the other tracks "overall statistics".
Okay, so if you're not doing Conversion Tracking, the code should look like this, right?
<!-- Tracking -->
<?php // If page is SSL then use Secure Code
if($_SERVER['HTTPS']=='on'){
?>
<!-- Google Analytics -->
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-xxxxxx-x";
urchinTracker();
</script>
<!-- /Google Analytics -->
<?php
if ($_GET['main_page']=="checkout_success") { // if transaction is a successful purchase then record the order details
?>
<!-- Google Analytics E-Commerce Tracking (must go below standard Analytics code)-->
<body onLoad="javascript:__utmSetTrans()">
<form style="display:none;" name="utmform">
<textarea id="utmtrans">UTM:T|<?php echo $zv_orders_id ?>||<?php echo $zv_order_total_cd ?>|<?php echo $zv_order_tax ?>|0.00|<?php echo $zv_order_city ?>|<?php echo $zv_order_state ?>|<?php echo $zv_order_country ?>
<?php // Loop through products purchased to track in Google (these come from the "cart_orders_products TABLE)
//sku = "products_model"; productname = "products_name"; category = ""; price = "final_price"; quantity = "products_quantity"
$products_displayed_google = array();
for ($i=0, $n=sizeof($products_array_google); $i<$n; $i++) {
if (!in_array($products_array_google[$i]['id'], $products_displayed_google)) {
echo 'UTM:I|' . $zv_orders_id . '|' . $products_array_google[$i]['model'] . '|' . $products_array_google[$i]['text'] . '||' . $products_array_google[$i]['price'] . '|' . $products_array_google[$i]['quantity'];
$products_displayed_google[] = $products_array_google[$i]['id'];
}
}
?>
</textarea>
</form>
<!-- /Google Analytics E-Commerce Tracking -->
<!-- Google Analytics -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-xxxxxx-x";
urchinTracker();
</script>
<!-- /Google Analytics -->
<?php } ?>
<!-- / Tracking -->