define(['jquery','ko','uiComponent','Magento_Customer/js/customer-data'],function($,ko,Component,customerData){'use strict';return function(config){var customer=customerData.get('customer');var customerEmail='';if(customer().email){customerEmail=customer().email;} var eventName=config.eventName;var dataLayer=window.dataLayer||[];var crto={email:customerEmail};if(eventName=="crto_listingpage"){if(!config.productList.length){return;} crto.products=config.productList;}else if(eventName=="crto_productpage"){crto.products=config.productDetail;}else if(eventName=="crto_basketpage"){crto.products=config.basketProducts;}else if(eventName=="crto_transactionpage"){crto.products=config.productList;crto.transactionid=config.transactionId;crto.email=config.orderEmail;crto.promoCode=config.promoCode;crto.hashedEmail=config.hashedEmail;} dataLayer.push({event:eventName,crto});}});