if (window.$ACE) { window.$ACE.get("Leads").then(function (Leads) { Leads.bind('ambassador'); }); var Consumer = window.$ACE_TRACKER.Consumer; var ConsumerInstance = new Consumer('ambassadorBind', function transformer(action) { return action; }, function (action) { if (action.mcm_id && action.mcm_code && action.biz_type == 'goodsBuy') { var commodityCode = action.mcm_code.split('.').pop(); if (commodityCode) { window.$ACE.get("Dashi").then(function (Dashi) { var search = window.$ACE.URL.getSearch(); if (search.userCode) { Dashi.newBuyBind({ commodityCode: commodityCode, userCode: search.userCode }); } }); } } }); window.$ACE_TRACKER.addConsumer(ConsumerInstance) }