神策分析致力于帮助客户搭建开放的数据平台,便于客户更深入的利用数据。本节文档涉及较多技术细节,适用于对相关功能有经验的用户参考。如果对文档内容有疑惑,请咨询您的数据咨询顾问获取一对一的协助。
App 消息推送是一种常用的运营手段,国内已有多家公司向 Android 和 iOS 开发者提供推送服务。神策分析 1.6 版本中提供了如下的方案,以便使用和等第三方推送服务的开发者,能够将神策分析的分析结果同步到推送服务中,以便向定向的人群推送特定的消息,从而将用户行为分析能力与推送服务结合,提高 App 的运营效果。
开发者将神策分析的结果同步到第三方推送服务的大致步骤如下:
在 App 中集成神策分析和第三方推送服务:
在 App 集成第三方推送平台的 SDK 和神策分析的 SDK,在 App 中获取第三方推送平台的设备推送 ID,并将该 ID 保存在神策分析的用户 Profile 中;
在 App 中处理推送消息,并使用神策分析追踪推送结果;
在神策分析中添加推送相关配置,如 AppKey、保存设备推送 ID 的 Profile 名称等;
在神策分析中通过用户分群等功能使用 App 推送。
以下详细说明如何集成第三方推送服务。
1. 在 iOS 中集成第三方推送系统
1.1 获取设备推送 ID
首先,开发者需要在 App 中集成第三方推送系统的 SDK,并在 App 初始化过程中获取设备推送 ID,并保存在神策分析的用户 Profile 中。以下简要说明集成第三方推送系统的集成方式。
极光推送
在 iOS App 中,获得 APNs 的 Device Token 后,需要向极光推送注册,注册成功后极光推送会推送 kJPFNetworkDidLoginNotification
通知,开发者需要监听该通知,并从极光推送中获取 Registration Id:
// 在 App 初始化成功的回调函数中
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *) launchOptions {
// 初始化极光SDK之后,从极光推送获取 Registration Id
[JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
if (resCode == 0) {
// 将极光推送的 Registration Id 存储在神策分析的用户 Profile "jgId" 中
[SensorsAnalyticsSDK.sharedInstance profilePushKey:@"jgId" pushId:registrationID];
}
}];
}
// App 成功获取 APNs 的 Device Token
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// 向极光推送注册 Device Token
[JPUSHService registerDeviceToken:deviceToken];
}
注意: 为了保证 Registration Id 能成功绑定到最新的用户上,需要在登录\切换用户时,重新绑定 Registration Id.
[[SensorsAnalyticsSDK sharedInstance] login:account];
[JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
if (resCode == 0) {
// 将极光推送的 Registration Id 存储在神策分析的用户 Profile "jgId" 中
[SensorsAnalyticsSDK.sharedInstance profilePushKey:@"jgId" pushId:registrationID];
}
}];
小米推送
在 App启动时注册小米推送服务,注册成功后获取 APNs 的 Device Token ,注册时需要添加 MiPushSDKDelegate 协议。
@interface AppDelegate ()<MiPushSDKDelegate,UNUserNotificationCenterDelegate>
@end
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
//小米 注册APNS成功, 注册deviceToken
[MiPushSDK bindDeviceToken:deviceToken];
}
实现MiPushSDKDelegate协议中的方法获取regId。
#pragma mark MiPushSDKDelegate
- (void)miPushRequestSuccWithSelector:(NSString *)selector data:(NSDictionary *)data
{
// 请求成功
// 可在此获取regId
if ([selector isEqualToString:@"bindDeviceToken:"]) {
// 将小米推送的regId 存储在神策分析的用户 Profile "xmId" 中
[SensorsAnalyticsSDK.sharedInstance profilePushKey:@"xmId" pushId:data[@"regid"]];
}
}
个推
开发者在 GeTuiSdkDelegate
的 - GeTuiSdkDidRegisterClient:
中获取 clientId 保存在神策分析的用户 Profile 中:
- (void)GeTuiSdkDidRegisterClient:(NSString *)clientId {
//将 clientId 保存到用户表中的 gtId 中
[SensorsAnalyticsSDK.sharedInstance profilePushKey:@"gtId" pushId:clientId];
}
1.2 App 推送效果追踪
开发者可以使用神策分析追踪推送效果。当用户收到推送消息时,通过神策分析 SDK 上报消息推送成功事件,并通过漏斗分析等功能,将用户在推送前的行为和推送后的行为关联起来。
我们可以在 App 中监听第三方消息推送服务的广播,当收到消息时调用神策分析的 track
接口记录 App 推送成功事件;当用户点击消息打开 App 或执行其他行为时,调用 track
接口记录 App 消息打开事件。
假设 App 推送成功事件的名称为 AppReceivedNotification
,中文名称为 App 消息推送成功
,包含事件属性:
以下简要介绍如何在 App 中记录上述 App 消息推送成功
事件,追踪极光推送的推送效果。
极光推送
根据极光推送文档所述,需要为AppDelegate添加Delegate,代码如下:
@interface AppDelegate ()<JPUSHRegisterDelegate>
@end
用户需要在 AppDelegate.m 中实现以下回调方法并在回调方法中调用神策分析 SDK 追踪推送成功的事件。
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_j_msgid"]]
}];
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以设置
}
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(); // 系统要求执行这个方法
}
// Required, iOS 7 Support
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
[JPUSHService handleRemoteNotification:userInfo];
if (application.applicationState == UIApplicationStateActive) {
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_j_msgid"]]
}];
}
else if (application.applicationState == UIApplicationStateBackground)
{
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_j_msgid"]]
}];
}
else if (application.applicationState == UIApplicationStateInactive)
{
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
}
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UIBackgroundFetchResultNewData);
}
小米推送
用户需要在 AppDelegate.m 中实现以下回调方法并在回调方法中调用神策分析 SDK 追踪推送成功的事件。
// iOS 10 Support
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以设置
}
// iOS 10 Support
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
[JPUSHService handleRemoteNotification:userInfo];
}
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(); // 系统要求执行这个方法
}
// Required, iOS 7 Support
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
[JPUSHService handleRemoteNotification:userInfo];
if (application.applicationState == UIApplicationStateActive) {
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
}
else if (application.applicationState == UIApplicationStateBackground)
{
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
}
else if (application.applicationState == UIApplicationStateInactive)
{
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
}
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UIBackgroundFetchResultNewData);
}
个推
用户需要在 AppDelegate.m 中实现以下回调方法并在回调方法中调用神策分析 SDK 追踪推送成功的事件。
// iOS 10 Support
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
// Required
NSDictionary * userInfo = notification.request.content.userInfo;
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以设置
}
// iOS 10 Support
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
// Required
NSDictionary * userInfo = response.notification.request.content.userInfo;
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppOpenNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler();
}
// Required, iOS 7 Support
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if (application.applicationState == UIApplicationStateActive) {
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
}
else if (application.applicationState == UIApplicationStateBackground)
{
// 收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedNotification" withProperties:@{
@"msg_title":[NSString stringWithFormat:@"%@",userInfo[@"aps"][@"alert"]],
@"msg_id":[NSString stringWithFormat:@"%@",userInfo[@"_id_"]]
}];
}
else if (application.applicationState == UIApplicationStateInactive)
{
// 用户点击通知栏打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
}
// 直接上报数据
[[SensorsAnalyticsSDK sharedInstance] flush];
completionHandler(UIBackgroundFetchResultNewData);
}
- (void)GeTuiSdkDidReceivePayloadData:(NSData *)payloadData andTaskId:(NSString *)taskId andMsgId:(NSString *)msgId andOffLine:(BOOL)offLine fromGtAppId:(NSString *)appId {
//收到个推消息
NSString *payloadMsg = nil;
if (payloadData) {
payloadMsg = [[NSString alloc] initWithBytes:payloadData.bytes length:payloadData.length encoding:NSUTF8StringEncoding];
}
NSString *msg = [NSString stringWithFormat:@"taskId=%@,messageId:%@,payloadMsg:%@%@",taskId,msgId, payloadMsg,offLine ? @"<离线消息>" : @""];
NSLog(@"\n>>>[GexinSdk ReceivePayload]:%@\n\n", msg);
[[SensorsAnalyticsSDK sharedInstance] track:@"AppReceivedGetuiNotification" withProperties:@{@"msg":msg}];
}
2. 在 Android 中集成第三方推送系统
2.1 获取设备推送 ID
首先,开发者需要在 App 中集成第三方推送系统的 SDK,并在 App 初始化过程中获取设备推送 ID,并保存在神策分析的用户 Profile 中。以下简要说明集成第三方推送系统的集成方式。
极光推送
极光推送使用唯一的 Registration Id 标示设备。开发者需要在 Manifest 中定义 Receiver 接受极光推送的广播,通过 cn.jpush.android.intent.REGISTRATION
消息获取 Registration Id。
<receiver
android:name="Your Receiver"
android:enabled="true">
<intent-filter>
<action android:name="cn.jpush.android.intent.REGISTRATION" />
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" />
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" />
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" />
<category android:name="You package Name" />
</intent-filter>
</receiver>
广播 cn.jpush.android.intent.REGISTRATION
的 Intent 参数中JPushInterface.EXTRA_REGISTRATION_ID
为 Registration Id ,开发者在极光推送初始化完成后,在广播中获取 Registration Id 保存在神策分析的用户 Profile 中:
public void onReceive(Context context, Intent intent) {
// 收到极光推送初始化成功的广播
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
// 获取极光推送的 RegistrationId
final String registrationId = intent.getExtras().getString(JPushInterface.EXTRA_REGISTRATION_ID);
// 将推送 ID 保存到用户表中
SensorsDataAPI.sharedInstance().profilePushId("jgId",registrationId);
}
}
注意: 由于极光 SDK 只会在第一次初始化成功时,发出 JPushInterface.ACTION_REGISTRATION_ID
广播,为确保已安装 App 的老用户也能把推送 ID 保存到神策分析的用户表中,可以在调用 login
方法后再次保存推送 ID:
// 注册成功/登录成功(调用 login 方法)后 保存 jgId 到用户表
String registrationId=JPushInterface.getRegistrationID(this);
SensorsDataAPI.sharedInstance().profilePushId("jgId",registrationId);
小米推送
开发者在小米推送初始化完成后,在广播中获取 Registration Id 保存在神策分析的用户 Profile 中:
@Override
public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) {
String command = message.getCommand();
List<String> arguments = message.getCommandArguments();
String mRegId = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);
if (MiPushClient.COMMAND_REGISTER.equals(command)) {
if (message.getResultCode() == ErrorCode.SUCCESS) {
//小米推送初始化成功,将推送 ID 保存到用户表中
SensorsDataAPI.sharedInstance().profilePushId("xmId",mRegId);
}
}
}
个推
开发者在 GTIntentService 的 onReceiveClientId 中获取 ClientId 保存在神策分析的用户 Profile 中:
@Override
public void onReceiveClientId(Context context, String clientid) {
// 将 clientid 保存到用户表 gtId 中
SensorsDataAPI.sharedInstance().profilePushId("gtId",clientid);
}
2.2 App 推送效果追踪
开发者可以使用神策分析追踪推送效果。当用户收到推送消息时,通过神策分析 SDK 上报消息推送成功事件,并通过漏斗分析等功能,将用户在推送前的行为和推送后的行为关联起来。
我们可以在 App 中监听第三方消息推送服务的广播,当收到消息时调用神策分析的 track
接口记录 App 推送成功事件;当用户点击消息打开 App 或执行其他行为时,调用 track
接口记录 App 消息打开事件。
假设 App 推送成功事件的名称为 AppReceivedNotification
,中文名称为 App 消息推送成功
,包含事件属性:
以下简要介绍如何在 App 中记录上述 App 消息推送成功
事件,追踪极光推送的推送效果。
极光推送
如极光推送文档所述,用户需要在 Receiver 中处理极光推送的广播,并在收到消息时使用神策分析 SDK 追踪推送成功的事件。
public void onReceive(Context context, Intent intent) {
if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) {
// 极光推送注册成功通知,如前文所述,获得 Registration Id 并保存在神策分析的用户 Profile 中
} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
// 用户收到了自定义消息,自定义消息不会展示在通知栏,只透传给 App
} else if (JPushInterface.ACTION_NOTIFICATION_RECEIVED.equals(intent.getAction())) {
// 用户收到了推送消息,使用神策分析追踪 "App 消息推送成功" 事件
Bundle message = intent.getExtras();
try {
JSONObject properties = new JSONObject();
// 获取消息标题,并保存在事件属性 msg_title 中
properties.put("msg_title", message.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE));
// 获取消息 ID,并保存在事件属性 msg_id 中
properties.put("msg_id", message.getString(JPushInterface.EXTRA_MSG_ID));
// 使用神策分析追踪 "App 消息推送成功" 事件
SensorsDataAPI.sharedInstance().track("AppReceivedNotification", properties);
} catch (InvalidDataException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
// 用户点击打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
}
}
小米推送
如小米推送文档所述,用户需要在 Receiver 中处理小米推送的广播,并在收到消息时使用神策分析 SDK 追踪推送成功的事件。
@Override
public void onNotificationMessageArrived(Context context, MiPushMessage message) {
try {
JSONObject properties = new JSONObject();
// 获取消息标题,并保存在事件属性 msg_title 中
properties.put("msg_title", message.getTitle());
// 获取消息 ID,并保存在事件属性 msg_id 中
properties.put("msg_id", message.getMessageId());
// 使用神策分析成功" 事件
SensorsDataAPI.sharedInstance().track("AppReceivedNotification", properties);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onNotificationMessageClicked(Context context, MiPushMessage message) {
// 用户点击打开消息,使用收到推送消息类似的方法,使用神策分析记录 "App 打开消息" 事件
}
@Override
public void onReceivePassThroughMessage(Context context, MiPushMessage message) {
// 用户收到了自定义消息,自定义消息不会展示在通知栏,只透传给 App
}
个推
如个推文档所述,用户需要在 GTIntentService 中处理推送消息,可以在透传消息到达时使用神策分析 SDK 追踪消息到达事件。
@Override
public void onReceiveMessageData(Context context, final GTTransmitMessage gtTransmitMessage) {
try {
JSONObject properties = new JSONObject();
// 获取消息 ID,并保存在事件属性 msg_id 中
properties.put("msg_id", gtTransmitMessage.getMessageId());
// 追踪 "消息到达" 事件
SensorsDataAPI.sharedInstance().track("AppReceivedNotification", properties);
} catch (Exception e) {
e.printStackTrace();
}
}
3. 在神策分析中使用推送服务(以极光推送为例)
3.1 填写推送配置
开发在第三方推送平台注册了 App 后,使用管理员账户进入神策分析的推送服务管理界面。
新建推送服务,选择第三方推送服务商,填入 App Key、Secret Key 等配置信息,特别地,开发者需要填写保存设备推送 ID 的 Profile 名称,如前文的例子中,我们在 jgId
中保存极光推送 Android App 的设备推送 ID。
成功添加推送服务后,将可以使用该推送配置,在用户分群、留存用户分析等分析功能中使用消息推送功能。
3.2 用户分群
在神策分析中,可以按照用户的事件所体现的过往的行为特征和用户的 Profile 所体现的用户自然属性特征,来对整个用户群体进行分群。开发者可以根据分群结果,对群体中的用户推送消息。如图,当用户编辑用户分群规则时,勾选推送渠道:
当用户分群执行成功后,会自动在第三方推送渠道中为满足分群条件的用户标记 Tag,Tag 名称为用户分群的英文名。特别地,当开发者拥有多款 App 的多个推送渠道时,可以同时将推送结果同步到多个推送渠道的 Tag 中。
3.3 第三方推送平台进行消息推送
开发者可以在第三方推送系统的后台,使用用户分群的英文名对应的 Tag 进行消息推送,例如在极光推送中:
3.4 用户列表
在神策分析的各种数据分析功能中,都可以根据分析结果获取对应的用户列表,如留存分析中,开发者可以获得第一天留存的用户列表:
在用户列表中,可以根据用户列表的生成规则创建用户分群,此时我们也可以为该分群配置消息推送:
进而,在用户分群执行成功后,开发者可以在第三方推送系统的后台使用用户分群的英文名对应的 Tag 进行消息推送。
4. 推送效果追踪
如前文所述,开发者在 App 中集成第三方消息推送服务后,可以使用神策分析追踪推送效果。我们对一些常用的推送效果分析,做简单的介绍。
统计推送成功的用户数
可以直接在事件分析中,统计 App 消息推送成功
事件的触发用户数,并筛选对应的消息唯一 ID 属性。
分析推送成功的用户的转化
想查看某一段时间内,推送成功的用户的转化,可以在漏斗分析中新建漏斗,第一个步骤为 App 消息推送成功
,第二个步骤为下订单等行为。
分析推送成功的用户的留存
想查看某一段时间内,推送成功的用户的留存,可以在留存分析中,把初始行为设置为 App 消息推送成功
,后续行为设置为 任意事件
,或者某个表示用户留存的核心行为。