前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >B2B营销中使用Python进行探索性数据分析

B2B营销中使用Python进行探索性数据分析

作者头像
代码医生工作室
发布2019-06-23 20:39:41
1.3K0
发布2019-06-23 20:39:41
举报
文章被收录于专栏:相约机器人相约机器人

作者 | Mai Nguyen

来源 | Medium

编辑 | 代码医生团队

该项目侧重于使用Python进行B2B营销的探索性数据分析(EDA)。将使用来自Olist的数据,Olist是一个将中小型企业与巴西顶级市场连接起来的电子商务平台。除了提供方法和代码之外,还想讨论B2B营销的基本原理以及EDA的这些见解如何帮助Olist做出更好的营销决策。GitHub上提供了所有Python代码。

https://github.com/Fumanguyen/EDA-Python-B2B-Marketing

介绍

Olist是一个将中小型企业与巴西市场(Extra,Shoptime,Walmart,Submarino,.etc)连接起来的平台,可帮助商家在这些市场上销售。与一些国家不同,巴西快速增长的电子商务部门由一些大型市场主导,而不是少数几个市场(例如:亚马逊和美国的Ebay)。因此,商家有动力在多个市场中运营以最大化其收入。由于人力资源的限制是主要的痛点,商家希望使用Olist管理不同市场的销售渠道,简化库存管理和订单履行流程。

Olist的商业模式

有了这个B2B2C模型,Olist的营销团队有两个主要目标:

  • 从卖方方面来看,希望使用Olist平台增加商家数量。
  • 从买方方面来看,希望最大化这些市场上商家的电子商务销售。

该分析的范围更多地侧重于Olist的卖方(B2B)。通过给定的数据集,将进行探索性数据分析(EDA),为Olist的B2B营销团队带来一些有用的见解。

B2B的营销和销售流程:

B2B营销漏斗

数据特征

数据集来自Kaggle。

https://www.kaggle.com/olistbr/marketing-funnel-olist

  • 第一个数据集有4个变量,有8000个数据点。变量是MQL_id(营销合格潜在客户),其第一个联系日期,捕获潜在客户的登录页面以及潜在客户来源(将潜在客户带到目标网页的渠道)。
  • 第二个数据集包含842个带有14个变量的观测值。每个观察都是Olist的成交,包括商家的mql_id,seller_id(在Olist平台中使用),sdr_id和sr_id(负责交易的销售发展代表和销售代表),won_date,业务部门, lead_type,lead_behaviour_profile,business_type,declared_monthly_revenue。其中,5个变量的Null值太多,无法为分析带来价值。
  • 第三个数据集:Via Kaggle,Olist还捐赠了关于需求方的数据集。将使用此信息向Olist营销人员通知卖家的表现,从而帮助改善B2B营销流程。

探索性数据分析

MQL的数量: MQL数据从2017年7月7日到6月18日提供,而获奖的MQL数据从01/2018到12/2018提供。2017年,Olist营销团队产生的MQL约为400 MQL /月。在2018年,将数量提升至每月1000-1400条线索。关于获胜的MQL,它的峰值是在05/2018,有200个获胜机会。

代码语言:javascript
复制
#Figure 1num_mql = mql.set_index(pd.to_datetime(mql[‘first_contact_date’]))num_mql = num_mql.groupby(pd.Grouper(freq = “M”)).count().drop(axis =1, columns = [‘first_contact_date’,“landing_page_id”, “origin”])num_won = close.set_index(pd.to_datetime(close[“won_date”]))num_won = num_won.groupby(pd.Grouper(freq = “M”)).count().drop(axis = 1, columns = [“seller_id”, “sdr_id”, “sr_id”,“business_segment”, “lead_type”, “lead_behaviour_profile”, “has_company”, “has_gtin”, “average_stock”, “business_type”,“declared_product_catalog_size”, “declared_monthly_revenue”, “won_date”])plt.figure(figsize = (8,6))plt.plot(num_mql.index, num_mql, "-", label = "number of MQL")plt.plot(num_won.index, num_won, "-", label = "number of won MQL")plt.legend()plt.title("Number of MQL", size = 15)plt.savefig("NumMQL.png")

图1

渠道:大多数MQL来自有机搜索渠道,其次是直接流量和社交。其他other_publicities,推荐和显示是将最少的MQL带到Olist的来源。organic_search MQL在2018 - 02年显着增加,之后下降。这可能是大型活动/公关活动的结果。

代码语言:javascript
复制
#Figure 2mql_origin = mql.groupby(‘origin’).agg({‘mql_id’:”count”});print(mql_origin)origin = list(mql_origin.index)plt.figure(figsize = (10,8))fancy_plot = plt.subplot()for i in origin:  channel = mql[mql[‘origin’] == i]  channel = channel.set_index(pd.to_datetime(channel[‘first_contact_date’]))  channel_agg = channel.groupby(pd.Grouper(freq = “M”)).count().drop(axis = 1, columns =[“first_contact_date”,  “landing_page_id”, “origin”])  fancy_plot.plot(channel_agg.index, channel_agg, “-o”, label = i)fancy_plot.legend()plt.title(‘Number of MQL by channels overtime’, size = 15)plt.savefig(“channel-mql.png”)

图2

这些渠道的转换率各不相同。有机搜索,付费搜索和直接流量是转化率最高的来源(分别为12.5%,11.5%和11%)。电子邮件,其他公共和社交的转化率最低(分别为3%,5%,5.5%)。这意味着SEO和Google Adwords是Olist最有效的营销渠道。这个结果似乎与几个调查相关,这些调查说明了B2B公司最有效的营销渠道。

以下是最有效的B2B营销渠道的行业分析[更新了2017年数据]

https://www.bizible.com/blog/b2b-industry-analysis-best-marketing-channels

代码语言:javascript
复制
#Figure 3origin_lost = data.groupby([‘origin’, ‘lost’]).count().drop(axis = 1, columns =[‘first_contact_date’,’landing_page_id’, “seller_id”, “sdr_id”, “sr_id”, “won_date”, “business_segment”, “lead_type”, “lead_behaviour_profile”, “has_company”, “has_gtin”, “average_stock”, “business_type”, “declared_product_catalog_size”, “declared_monthly_revenue”])percentage = []for i in origin: pct = origin_lost.loc[i].loc[False][0]/(origin_lost.loc[i].loc[True][0]+origin_lost.loc[i].loc[False][0]) percentage.append(pct)plt.figure(figsize = (6,4))plt.bar(origin, percentage)plt.xticks(rotation = 90)plt.ylabel(‘won rate’)plt.savefig(“won-rate.png”)

图3:按渠道赢得利率

登陆页面

Olist使用495个登陆页面来捕获MQL。即使销售团队负责将MQL转换为赢得的机会,营销团队也可以通过在登录页面上提供相关的消息传递和优势来从漏斗的顶部影响这种可能性。从上面的图4可以看出,有2个登陆页面具有非常多的MQL(~800 MQL)以及非常高的赢率(~20%),这意味着从这些登陆页面捕获的MQL中有20%成为Olist的卖家。

代码语言:javascript
复制
#Figure 4mql_lp = mql.groupby(‘landing_page_id’).agg({‘mql_id’:”count”})mql_lp = mql_lp[mql_lp[‘mql_id’] > 30]data_lp = pd.merge(data, mql_lp, how = “inner”, left_on = “landing_page_id”, right_index = True)lp_lost = data_lp.groupby([‘landing_page_id’, ‘lost’]).agg({‘mql_id_x’:”count”})landing_page = list(mql_lp.index)percentage_lp = []landing_page_2 = []Num_mql = []for i in landing_page: if mql_lp.loc[i][0] == lp_lost.loc[i].loc[True][0]: lp_lost.drop([i]) else: pct = lp_lost.loc[i].loc[False][0]/(lp_lost.loc[i].loc[True][0]+lp_lost.loc[i].loc[False][0]) percentage_lp.append(pct) landing_page_2.append(i) Num_mql.append(mql_lp.loc[i][0])fig = plt.figure(figsize = (10,4))ax = fig.add_subplot(111)ax2 = ax.twinx()ax.bar(landing_page_2, percentage_lp)ax2.plot(landing_page_2, Num_mql, color = “red”)ax.set_ylabel(‘won rate’)ax2.set_ylabel(‘number of MQL’)for tick in ax.get_xticklabels(): tick.set_rotation(90)plt.savefig(“landing-page.png”)

图4:MQL的数量并通过登陆页面赢得了机会

从这些目标网页中学习可以帮助Olist将成功复制到其他目标网页。

定位 - 业务部门

定位在B2B营销中非常重要。有些细分市场对Olist非常感兴趣,反之亦然。下图显示了使用销售周期(销售流程的时长)作为指示:

代码语言:javascript
复制
#Figure 5data2 = pd.merge(mql, close, how = “right”, on = “mql_id”)data2[‘first_contact_date’] = pd.to_datetime(data2[‘first_contact_date’])data2[‘won_date’] = pd.to_datetime(data2[‘won_date’])data2[‘sales cycle’] = data2[‘won_date’] — data2[‘first_contact_date’]data2[‘sales cycle’] = data2[‘sales cycle’].dt.dayssegment_time = data2.groupby([‘business_segment’]).agg({“mql_id”:”count”, “sales cycle”:”mean”})fig = plt.figure(figsize = (10,4))ax = fig.add_subplot(111)ax2 = ax.twinx()ax.bar(segment_time.index, segment_time[‘sales cycle’])ax2.plot(segment_time.index, segment_time[‘mql_id’], color = “red”)ax.set_ylabel(‘Sales cycle’)ax2.set_ylabel(‘number of MQL’)for tick in ax.get_xticklabels(): tick.set_rotation(90)

图5

Home_decor,health_beauty,household_utilities,住宅和花园建筑工具,汽车配件和电子产品等业务部门是卖家的主要部分,销售周期通常约为50天。销售周期较长的一些细分市场是香水和手表。但是由于这两个段只有少量的MQL(7和10),所以Olist应该等待更多的MQL来获得更准确的观察。

图6:按引导类型划分的MQL数量和销售长度

关于Lead_type变量,Online_medium是Olist MQL中最受欢迎的类型。这些业务类型的销售周期之间没有显着差异。

代码语言:javascript
复制
#Figure 7fig = plt.figure(figsize = (10,4))ax = fig.add_subplot(111)ax2 = ax.twinx()ax.bar(lead_time.index, lead_time[‘sales cycle’])ax2.plot(lead_time.index, lead_time[‘mql_id’], color = “red”)ax.set_ylabel(‘Sales cycle’)ax2.set_ylabel(‘number of MQL’)for tick in ax.get_xticklabels(): tick.set_rotation(90)

Olist还可以根据销售周期来评估销售代表的绩效。从图7中可以看出,SR的销售线索数量越多,销售周期越短。这可以解释为经验丰富的销售代表(更多MQL)将比新销售代表表现更好(更短的销售长度)。

图7:销售代表的MQL数量和销售长度

引导行为

下表是每个行为概况的描述,基于DiSC,一种根据心理学家William Moulton Marston的DiSC理论开发的行为评估工具。

代码语言:javascript
复制
#Figure 8segment = pd.DataFrame(index = ['cat','eagle', 'wolf', 'shark'])for i in segment_time.index:    lead_profile = close[close['business_segment'] == i]    segment = lead_profile.groupby('lead_behaviour_profile').agg({'mql_id':"count"}).rename(columns = {'mql_id':i}).merge(segment,                                                                                                 how = "right", left_index = True, right_index = True)    segment = segment.fillna(0)plt.figure(figsize = (14,4))snb.heatmap(segment, annot = True)plt.title("Heatmap of Lead Behaviour Profile and Business Segment", size = 15)

图8

48.3%的引导行为特征是稳定的,这意味着这个人强调合作,诚意和可靠性。了解潜在客户的特征可以帮助Olist团队创建相关角色,更容易为目标受众制作内容,消息和故事。

业务类型

代码语言:javascript
复制
#Figure 9segment2 = pd.DataFrame(index = ['reseller', 'manufacturer', 'other'])for i in segment_time.index:    lead_profile = close[close['business_segment'] == i]    segment2 = lead_profile.groupby('business_type').agg({'mql_id':"count"}).rename(columns = {'mql_id':i}).merge(segment2, how = "right", left_index = True, right_index = True)segment2 = segment2.fillna(0)plt.figure(figsize = (14,4))snb.heatmap(segment2, annot = True)

图9

有两种业务类型:经销商和制造商。经销商占总MQL的69.7%。因此当经销商在业务部门中出现最多时,就不足为奇了。然而,在home_decor部分,56%是制造商。

关闭交易表现

第一次订单的时间

代码语言:javascript
复制
#Figure 10seller = pd.merge(order_item, orders[['order_id','order_approved_at']], how = "left", left_on = "order_id",right_on = "order_id")seller['order_approved_at'] = pd.to_datetime(seller['order_approved_at']) seller_first_order = seller.groupby('seller_id').agg({"order_approved_at":"min"})diff = pd.merge(close, seller_first_order, how = "inner", left_on = "seller_id", right_index = True)diff['first_order_time'] = diff['order_approved_at'] - pd.to_datetime(diff['won_date'])diff['first_order_time'] = diff["first_order_time"].dt.days #Histogramplt.figure()plt.hist(diff["first_order_time"], bins = 15, rwidth = 0.9)plt.title("Histogram of time for first order",size = 15)plt.xlabel("Days")plt.show()

图10

自从同意加入Olist平台之日起,大多数卖家必须等待不到50天才能获得Olist的第一笔订单(图10)。

主要的业务部门,如heath_beauty,home_decor,household_utilities,audio_video_electronics,......通常会等待50-60天才能获得自获胜日期以来的第一笔订单。还看到其他一些细分市场,例如food_drink,手工制作和fashion_accessories,它们在首次订购之前的时间要长得多。

代码语言:javascript
复制
#Figure 11first_order_segment = diff.groupby("business_segment").agg({"first_order_time":"mean", "mql_id":"count"}) fig = plt.figure(figsize = (10,4))ax = fig.add_subplot(111)ax2 = ax.twinx()ax.bar(first_order_segment.index, first_order_segment['first_order_time'])ax2.plot(first_order_segment.index, first_order_segment['mql_id'], color = "red")ax.set_ylabel('Days')ax2.set_ylabel('number of MQL')for tick in ax.get_xticklabels():    tick.set_rotation(90)plt.title("First order time by segments", size = 15)

图11

每个细分受众群:

代码语言:javascript
复制
#Figure 12product = pd.merge(product[["product_id", "product_category_name"]], category, how = "left", left_on = "product_category_name",                    right_on = "product_category_name") product_by_value = pd.merge(seller, product, how = "left", left_on = "product_id", right_on = "product_id") category_sales = product_by_value.groupby("product_category_name_english").agg({"price":"sum"})category_sales = category_sales.sort_values(by = ["price"], ascending = False)top10 = category_sales.iloc[:10]top10_category = top10.indexplt.figure(figsize = (10,6)) fancy_plot_2 = plt.subplot() for i in top10_category:     order_category = product_by_value[product_by_value['product_category_name_english'] == i]     order_category = order_category.set_index(pd.to_datetime(order_category['order_approved_at']))     order_category_agg = order_category.groupby(pd.Grouper(freq = "M")).agg({"price":"sum"})     fancy_plot_2.plot(order_category_agg.index, order_category_agg,'-x', label = i) fancy_plot_2.legend() plt.title("Sales by segment overtime", size =15)

图12

图12是Olist销量最高的前10大产品类别。由于health_beauty,computer_accessories,furniture_devor,housewares,auto和garden_tools也是MQL中的主要业务部门,因此这些细分市场的销售价值也位居首位。唯一令我惊讶的是手表。虽然只有少数来自手表部门的卖家,但与其他细分市场相比,手表的收入确实很高。

结论和建议

从不同的角度看Olist卖方的营销:渠道,消息(登陆页面),定位(业务部门,主导行为,业务类型......),销售流程(销售周期,销售代表),封闭交易表现以表明平台使用。每个角度都可以为团队如何优化营销活动增加价值。

以下是一些细节建议:

  • 继续研究SEO / Events以增加有机流量
  • 从成功的登陆页面中学习,为A / B测试创建假设。目标是复制其他登陆页面中的成功
  • 体育休闲和手表细分市场的开发可以更多,因为Olist可以从中获取高额收入
  • 引线是稳定型。Olist可以围绕这些类型的人建立客户角色,并制作针对这些人的消息/内容。
  • 调查Home_decor部分为何会吸引很多制造商。可以在其他细分中复制吗?

推荐阅读

用于实现用python和django编写的图像分类的Keras UI

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-05-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 相约机器人 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档