Jump to content
xt:Commerce Community Forum

Google Analytics Konfiguration


rolo_s

Recommended Posts

  • 2 weeks later...
  • Replies 78
  • Created
  • Last Reply

Hallo, Analytics trackt zwar die Besucher aber es kommen keine Umsätze und Transaktionen rein. Bei einer Testbestellung ist mir nun aufgefallen das in der checkout_success.html der codeteil:

pageTracker._addItem(

'81629',

'3',

'Testartikel',

'1.1000',

'1'

);

so oft wiederholt wird, wie Verlinkungen in Kategorien existieren.

Da der Artikel in etliche Kategorien verlinkt ist, erscheint er im Quelltext ca. 60 mal untereinander.

Ich denke aus diesem Grund hat google ein Problem mit den Transaktionen. Weiß jemand wie ich das Problem beheben kann?

Viele Grüße Frank

Link to comment
Share on other sites

Code aus der checkout_success.html

<!-- Google Analytics start !-->
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
pageTracker._addTrans(
'{$oID}',
"www.******.com",
'{$VALUE}',
'{$TAX}',
'{$SHIPPING}',
'{$CITY}',
'{$STATE}',
'{$COUNTRY}'
);
{foreach name=aussen item=order_values from=$order_data}

pageTracker._addItem(
'{$oID}',
'{$order_values.PRODUCTS_MODEL}',
'{$order_values.PRODUCTS_NAME}',
'{$order_values.PRODUCTS_SINGLE_PRICE}',
'{$order_values.PRODUCTS_QTY}'
);

{/foreach}
pageTracker._trackTrans();
</textarea>
</form>
<!-- Google Analytics end !-->[/HTML]

Code aus der checkout_success.php

[PHP]// Google Analytics start
$smarty->assign('oID',$last_order);
$smarty->assign('CITY',$orders['customers_city']);
$smarty->assign('STATE',$orders['customers_state']);
$smarty->assign('COUNTRY',$orders['customers_country']);
$orders_total_shipping_query = xtc_db_query("select value from ".TABLE_ORDERS_TOTAL." where orders_id = '".$last_order."' and class='ot_shipping'");
$orders_total_shipping = xtc_db_fetch_array($orders_total_shipping_query);
$smarty->assign('SHIPPING',$orders_total_shipping['value']);
$orders_total_tax_query = xtc_db_query("select value from ".TABLE_ORDERS_TOTAL." where orders_id = '".$last_order."' and class='ot_tax'");
$orders_total_tax = xtc_db_fetch_array($orders_total_tax_query);
$smarty->assign('TAX',$orders_total_tax['value']);
$orders_total_query = xtc_db_query("select value from ".TABLE_ORDERS_TOTAL." where orders_id = '".$last_order."' and class='ot_total'");
$orders_total = xtc_db_fetch_array($orders_total_query);
$smarty->assign('VALUE',$orders_total['value']);
$order_query = xtc_db_query("SELECT categories_name, p.products_id, orders_products_id, products_model, products_name, products_price, products_quantity FROM ".TABLE_ORDERS_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." ptc, ".TABLE_CATEGORIES_DESCRIPTION." cd WHERE p.products_id = ptc.products_id AND ptc.categories_id=cd.categories_id AND cd.language_id = 2 AND orders_id='".$last_order."'"); $order_data = array ();
while ($order_data_values = xtc_db_fetch_array($order_query)) {
$order_data[] = array ('PRODUCTS_MODEL' => $order_data_values['products_id'],
'PRODUCTS_NAME' => $order_data_values['products_name'],
'CAT' => $order_data_values['categories_name'],
'PRODUCTS_SINGLE_PRICE' => $order_data_values['products_price'],
'PRODUCTS_QTY' => $order_data_values['products_quantity']);
}
$smarty->assign('order_data', $order_data);
// Google Analytics end[/PHP]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
  • Create New...