I want to read customer email and ID for a tracking purpose. My script is as below.
<?php
$_email = '';
$_customer = Mage::getSingleton('customer/session')->getCustomer();
if($_customer->getEmail()){
$_visitorId = $_customer->getId();
$_email = $_customer->getEmail();
}else{
$_visitor = Mage::getSingleton('core/session')->getVisitorData();
$_visitorId = $_visitor['visitor_id'];
}
?>
<!-- Initialize RDK -->
<script type="text/javascript">
window.sfrdk('_setConfig', {
visitorId: '<?php echo $_visitorId ?>',
email: '<?php echo $_email ?>'
});
</script>
This tracks the customer email in my account page but does not track in the product detail/list pages
Any idea?