01_行销(Marketing)里的有用的KPI-转换率 (Conversion Rate)

本文通过Kaggle上的bank-additional-full.csv数据集,探讨数字行销中的关键KPI——转换率。利用Python,作者展示了如何计算转换率,并分析了不同年龄群体、营销活动数量以及婚姻状况对转换率的影响。
摘要由CSDN通过智能技术生成

在这篇文章里我会用一个Kaggle的数据集来演示怎么计算行销学里比较有用的KPI计算。数据来源于 bank-additional-full.csv。这里我们着重讲数字行销(digital marketing)里比较重要的几个概念。例如,您可以基于个人归因逻辑,分析通过不同的社交网络服务(例如Facebook,LinkedIn和Instagram)产生的销售额。我们还可以分析通过此类营销渠道获得了多少客户,并查看各个数字营销活动的CPA和产生的价值。

  • CTR (Click-through-rate): 点击率是查看看你的广告然后继续点击广告的用户所占的百分比。它可以衡量在线营销为网站带来流量方面的有效性

在这里插入图片描述

  • MQL (marketing qualified leads): 营销合格的潜在客户。这些符合市场营销条件的潜在客户(MQL)是可以根据其特征准备出售并符合特定业务标准以成为可能进行购买的客户的潜在客户。当开始营销这些合格的潜在客户时,我们还应该查看转化率。

  • Conversion Rate: 转换率可被定义为,采取所需行动的访客百分比,也可以理解为转化率是转化为活跃客户的潜在客户的百分比。当访客进入网站浏览并最终有透过点击行动呼吁(Call to action , CTA)按钮的方式,完成某个目的的比例,大多数人常会误会完成下单购买才可称为转换,但在不同形式的网站中,访客能为网站产生价值的方式不尽相同,转换的型态也不同。
    在这里插入图片描述
    如果我们想查看在网站上注册的潜在客户的百分比,则公式变为
    在这里插入图片描述
    下面是一个怎么用Python计算的例子

# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load

import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory

import os
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        print(os.path.join(dirname, filename))

# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All" 
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
/kaggle/input/bank-marketing/bank-additional-full.csv
/kaggle/input/bank-marketing/bank-additional-names.txt

Load the packages

import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline

Load the dataset

df = pd.read_csv('../input/bank-marketing/bank-additional-full.csv', sep=';')
df.head(3)
age job marital education default housing loan contact month day_of_week ... campaign pdays previous poutcome emp.var.rate cons.price.idx cons.conf.idx euribor3m nr.employed y
0 56 housemaid married basic.4y no no no telephone may mon ... 1 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no
1 57 services married high.school unknown no no telephone may mon ... 1 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no
2 37 services married high.school no yes no telephone may mon ... 1 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no

3 rows ?? 21 columns

Change category variable to numeric 0 and 1

df['conversion'] = df['y'].apply(lambda x: 1 if x == 'yes' else 0)
df.head(3)
age job marital education default housing loan contact month day_of_week ... pdays previous poutcome emp.var.rate cons.price.idx cons.conf.idx euribor3m nr.employed y conversion
0 56 housemaid married basic.4y no no no telephone may mon ... 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no 0
1 57 services married high.school unknown no no telephone may mon ... 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no 0
2 37 services married high.school no yes no telephone may mon ... 999 0 nonexistent 1.1 93.994 -36.4 4.857 5191.0 no 0

3 rows ?? 22 columns

Aggregate Conversion Rate

print('total conversions: %i out of %i' % (df.conversion.sum(), df.shape[0]))
print('conversion rate: %0.2f%%' % (df.conversion.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值