AppsFlyer 研究(二)应用内事件

一、记录应用内事件

 

应用内事件可助您深入了解应用里正在发生的事。我们建议您花些时间定义要记录的事件。记录应用内事件有助于您衡量KPI,例如ROI(投资回报率)和LTV(生命周期价值)。

有几种方法可以记录应用内事件。最常见的方法是通过我们在本文中讨论的通过SDK发送事件。

 

如果您的应用属于某个行业,例如旅行、游戏、电子商务等,您可以参考每个行业的推荐应用内事件列表

 

1、应用内事件类型

以下部分介绍了每个事件类型的推荐结构, 以及指向 Facebook、Twitter、Criteo、Google Ads 和 Snapchat 的参数映射。

 

以下应用内事件被定义为 AFInAppEventType 接口的一部分, 建议这样做:

 

完成注册

事件名称:af_complete_registration

描述:用于追踪用户注册方式

事件参数 (Android): AFInAppEventType.COMPLETE_REGISTRATION

事件参数 (iOS):AFEventCompleteRegistration

Facebook映射事件: fb_mobile_complete_registration

Twitter映射事件: SIGN_UP

Criteo映射事件:无

Google Ads: sign_up

Snapchat: SIGN_UP

推荐参数: af_registration_method

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle AdsSnapchat
af_registration_ methodfb_registration_ methodregistration_method-registration_methodsign_up_method

 

 

购买

事件名称: af_purchase

描述:用于追踪购买事件(及相关收入)

事件参数 (Android): AFInAppEventType.PURCHASE

事件参数 (iOS): AFEventPurchase

Facebook映射事件: fb_mobile_purchase

Twitter映射事件: PURCHASE

Criteo 映射事件: transactionConfirmation

Google Ads: in_app_purchase

Snapchat: PURCHASE

推荐参数: af_revenue, af_content_type, af_content_id, af_content, af_price, af_quantity, af_currency, af_order_id

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle AdsSnapchatPartnerize
af_revenue*_valueToSumprice_micro**ui_revenuevalueprice-
af_content_typefb_content_typecontent_type-item_categoryitem_category类别
af_content_idfb_content_idcontent_ididitem_iditem_ids-
af_contentfb_content----Custom conversion meta
af_currencyfb_currencyprice_currencycurrencycurrency_codecurrencycurrency
af_quantityfb_num_itemsnumber_itemsquantityquantitynumber_itemsquantity
af_validated---已验证successVoucher
af_receipt_id--transaction_idtransaction_id-Conversion Reference
af_order_idfb_order_id--order_idtransaction_idClickref
af_content_listfb_content_id--item_id-Custom item meta
af_date_afb_checkin_date-dinstart_date--
af_date_bfb_checkout_date-doutend_date--
af_departing_ departure_datefb_departing_ departure_date-----
af_returning_ departure_datefb_returning_ departure_date-----
af_destination_afb_origin_airport--origin--
af_destination_bfb_destination_ airport--destination--
af_destination_listfb_destination_ids-----
af_cityfb_city-----
af_regionfb_region---------
af_countryfb_country-----
af_departing_arrival_ datefb_departing_arrival_ date-----
af_returning_arrival_ datefb_returning_arrival_ date-----
af_suggested_ destinationsfb_suggested_ destinations-----
af_travel_startfb_travel_start-----
af_travel_endfb_travel_end-----
af_num_adultsfb_num_adults-----
af_num_childrenfb_num_children-----
af_num_infantsfb_num_infants-----
af_classfb_travel_class--travel_class--
af_suggested_ hotelsfb_suggested_ hotels-----
af_user_scorefb_user_score-----
af_hotel_scorefb_hotel_score-----
af_pricefb_purchase_value-price**price-value
af_purchase_ currencyfb_purchase_ currency-----
af_preferred_star_ ratingsfb_preferred_star_ ratings-----
af_preferred_price_ rangefb_preferred_price_ range-----
af_preferred_ neighborhoodsfb_preferred_ neighborhoods-----
af_preferred_num_ stopsfb_preferred_num_ stops-----

* af_revenue 用于计算 AppsFlyer 平台中的收入。

**af_price - 您可使用 af_price 作为不计算收入的货币参数(例如“添加到购物车”事件)。 该参数意指单个商品价格。 所有购买的总金额用 af_revenue 参数表示。

 

广告点击

事件名称: af_ad_click

说明: 用于追踪应用中展示广告的点击次数

事件参数 (Android): AFInAppEventType.AD_CLICK

事件参数 (iOS): AFEventAdClick

Facebook 映射时间: AdClick

Twitter映射事件: 无

Criteo映射事件:无

Google Ads: 无

推荐属性: af_adrev_ad_type

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle Ads
af_adrev_ad_typead_type---
af_currencyfb_currency---

 

 

分享

事件名称: af_share

描述:用于追踪分享事件

事件参数 (Android): AFInAppEventType.SHARE

事件参数 (iOS): AFEventShare

Facebook 映射 事件: 无

Twitter 映射事件: SHARE

Criteo映射事件:无

Google Ads: share

推荐 属性: af_description

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle Ads
af_description-description-description

 

 

邀请

事件名称: af_invite

描述:用于追踪邀请(社交)事件

事件参数 (Android): AFInAppEventType.INVITE

事件参数 (iOS): AFEventInvite

Facebook 映射事件: None

Twitter 映射事件: INVITE

Criteo映射事件:无

Google Ads: invite

推荐属性: 无

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle Ads
af_description-description-description

登录

事件名称:af_login

描述:用于追踪用户登录事件

事件参数 (Android): AFInAppEventType.LOGIN

事件参数 (iOS): AFEventLogin

Facebook 映射事件: None

Twitter 映射事件: LOGIN

Criteo映射事件:无

Google Ads: login

推荐属性: 无

 

 

用户唤醒

事件名称: af_re_engage

描述: 用于追踪用户的重参与事件

事件参数 (Android): AFInAppEventType.RE_ENGAGE

事件参数 (iOS): AFEventReEngage

Facebook 映射 事件: 无

Twitter 映射事件: RE_ENGAGE

Criteo映射事件:无

Google Ads: custom_event

推荐 属性: 无

属性映射:

AppsFlyerFacebookTwitterCriteoGoogle Ads
af_description-description-description

 

 

从推送通知打开

事件名称: af_opened_from_push_notification

描述:用于追踪从推送通知打开应用的事件

事件参数 (Android): AFInAppEventType.OPENED_FROM_PUSH_NOTIFICATION

事件参数 (iOS): AFEventOpenedFromPushNotification

Facebook 映射事件: None

Twitter映射事件: 无

Criteo映射事件:无

Google Ads: notification_open

推荐 属性: 无

 

 

2、 应用内事件限制

  • 事件名称:最多45个字符

  • 事件值:不得超过1000个字符-如超过这个长度,我们可能会截断它

  • 定价和收入:仅使用数字和小数点,例如5或5.2

  • 价格和收入最多可以到小数点后5位,如5.12345

  • 从Android SDK V4.8.1开始,应用内事件和其他SDK API都支持非英语字符。

     

3、 记录应用内事件的示例

您可以通过调用trackEvent来记录应用内事件的名称和参数值。有关更多详细信息,请参见应用内事件文档。

以下是有关如何记录购买事件的简单示例。关于每个行业的现成代码片段列表,请参阅详细应用内事件指南

示例:应用内购买活动

Java

Map<String,Object> eventValues = new HashMap<>();
eventValues.put(AFInAppEventParameterName.REVENUE, 1200);
eventValues.put(AFInAppEventParameterName.CURRENCY, "JPY");
eventValues.put(AFInAppEventParameterName.CONTENT_TYPE, "Shoes");
AppsFlyerLib.getInstance().trackEvent(this, AFInAppEventType.PURCHASE, eventValues);

 

4、记录离线应用内事件

如果用户在互联网连接不可用时启动事件,Appsflyer仍然可以记录该事件。它是这样工作的:

  1. SDK 将事件发送到 AppsFlyer 的服务器并等待响应。

  2. 如果 SDK 没有收到响应200, 则该事件将存储在缓存中。

  3. 收到下一个响应200后, 存储的事件将重新发送到服务器。

  4. 如果缓存中有多个事件, 它们将被立即按序发送到服务器。

注意

SDK 的缓存最多可以存储40个事件, 这意味着只保存脱机发生的前40个事件。所有之后的事件都会被丢弃,直到下一个相应200。

原始数据中显示的事件时间是设备再次联机后事件发送到AppsFlyer的时间。不是事件发生的实际时间。

 

5、记录应用内事件处理成功和失败的信息

您可以在记录应用内事件时设置监听器。监听器可以给两种场景定义逻辑:

  • 应用内事件已成功记录。

  • 记录应用内事件时发生错误。

Java

AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.PURCHASE, eventValue, new AppsFlyerTrackingRequestListener() {
      @Override
      public void onTrackingRequestSuccess() {
        Log.d(AppsFlyerLibCore.LOG_TAG, "onTrackingRequestSuccess");
      }
      @Override
      public void onTrackingRequestFailure(String error) {
        Log.d(AppsFlyerLibCore.LOG_TAG, "onTrackingRequestFailure: " + error);
      }
 });
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

w风雨无阻w

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值