Thank you so much for your help!
I wait for the mechant-key from Trovaprezzi search engine, and then let you know if your script works well.
Thank you so much for your help!
I wait for the mechant-key from Trovaprezzi search engine, and then let you know if your script works well.
but nothing happensPHP Code:<?php
//-Add the tracking script only for the checkout_success page
$customer_email_info = $db->Execute ("SELECT customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . (int)$_SESSION['customers_id'] . " LIMIT 1");
if (!$customer_email_info->EOF) {
$customers_email_address = $customer_email_info->fields['customers_email_address'];
?>
<script type="text/javascript" src="https://tracking.trovaprezzi.it/javascripts/tracking.min.js" async="true"></script>
<script type="text/javascript">
window._tt = window._tt || [];
window._tt.push({ event: "setAccount", id: "RMUnJ1SUw1" });
window._tt.push({ event: "setOrderId", order_id: "<?php echo $order_id; ?>" });
window._tt.push({ event: "setEmail", email: "<?php echo $customers_email_address; ?>" });
<?php
foreach ($orders->products as $current_product) {
?>
window._tt.push({ event: "addItem", sku: "<?php echo $current_product['model']; ?>" , product_name: "<?php echo $current_product['name']; ?>" });
<?php
}
?>
window._tt.push({ event: "orderSubmit"});
</script>
<?php
}
So, you created the separate file (/includes/modules/pages/checkout_success/jscript_tracking.php) with the contents above. Now, on the checkout_success page, when "nothing happens" ... what does that mean?
OK, after re-reviewing the header processing for the checkout_success page, I was using the wrong variables, having incorrectly assumed that an order-class element had been created. Give the following a go:
Code:<?php //-Add the tracking script only for the checkout_success page $customer_email_info = $db->Execute ("SELECT customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . (int)$_SESSION['customers_id'] . " LIMIT 1"); if (!$customer_email_info->EOF) { $customers_email_address = $customer_email_info->fields['customers_email_address']; ?> <script type="text/javascript" src="https://tracking.trovaprezzi.it/javascripts/tracking.min.js" async="true"></script> <script type="text/javascript"> window._tt = window._tt || []; window._tt.push({ event: "setAccount", id: /* keymerchant */ }); window._tt.push({ event: "setOrderId", order_id: <?php echo $order_id; ?> /* idorder */ }); window._tt.push({ event: "setEmail", email: "<?php echo $customers_email_address; ?>" /* emailcucstomer */ }); <?php $products_info = $db->Execute ("SELECT products_model, products_name FROM " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id = $order_id"); while (!$products_info->EOF) { ?> window._tt.push({ event: "addItem", sku: "<?php echo $products_info->fields['products_model']; ?>" /* sku */, product_name: "<?php echo $products_info->fields['products_name']; ?>" /* product_name */ }); <?php $products_info->MoveNext (); } ?> window._tt.push({ event: "orderSubmit"}); </script> <?php }
Part of why lat9 has asked that question s that the script provided basically gathers data together and provides it back to the "company" to provide additional tracking information. There are results that should be able to be reviewed, but the "nothing happens" description does not clearly identify 1) action taken to validate operation or 2) results of that action.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
the example script equipped by Trovaprezzi need to track shop by customer and invites to add reviews on trovaprezzi website
Here you can find a guide to installation: https://tracking.trovaprezzi.it/guida.html
So, the script edited by lat9 don't start, so if I open the ceckout_success source page, there is no trace of the code.
Last edited by 100asa; 12 Feb 2016 at 06:37 PM.
Does your store's template already load a version of jQuery >= 1.4?
yes, sure!