如何正确使用和跟踪App-invites? [英] How to correctly use and track App-invites?

查看:31
本文介绍了如何正确使用和跟踪App-invites?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google 允许执行应用邀请并跟踪它们对您的应用安装的改进情况:

Google allows to perform app-invites and also track how well they improve your app installations:

https://www.youtube.com/watch?v=UfdCNYXMC9M

我做了一个简单的应用邀请,似乎人们确实使用它,使用以下代码:

I made a simple app invite, and it seems people do use it, using this code:

public static Intent getAppInviteIntent(Context context) {
    return new AppInviteInvitation.IntentBuilder(title,appName).setCustomImage(imageUri).setMessage(message).setCallToActionText(download).build();
}


startActivityForResult(getAppInviteIntent(this), GOOGLE_APP_INVITES_REQUEST_CODE);

这有效,但在 分析网页中,我找不到显示应用程序邀请统计信息的方法,即使他们说这是自动的 (此处).可悲的是,即使我发现的东西看起来也很旧,而且它们使用了已弃用的函数.

This works, but in the Analytics webpage, I can't find a way to show the statistics of the app-invite, and that's even though they say it's automatic (here). Sadly, even what I've found seem quite old and they use deprecated functions.

我认为这可能不是完全自动的(因为教程也有一些用于接收器部分的额外代码,此处),并且我们可能需要添加一些代码,如 这个文档说:

I thought that maybe it's not quite automatic (because the tutorial has some extra code for the receiver part too, here), and that we might need to add some code, as this docs say :

当用户接受邀请并安装应用程序时,getInvitation(GoogleApiClient, Activity, boolean) 将更新邀请状态以安装并返回使用 getInvitationIntent() 从 AppInviteInvitationResult 访问的 Intent 中的邀请数据

When the user accepts an invitation and installs the app, getInvitation(GoogleApiClient, Activity, boolean) will update the invitation state to installed and return the invitation data in an intent accessed from AppInviteInvitationResult using getInvitationIntent()

查看 Google 的示例(此处),我我注意到他们创建了 2 个活动.一个是主要活动,它确实调用了 "getInvitation" ,另一个称为 "DeepLinkActivity",并处理深层链接(可能用于额外数据,如优惠券).

Looking at Google's sample (here), I've noticed they created 2 activities. One is the main activity, which does have a call to "getInvitation" , and another is called "DeepLinkActivity" , and handles deep links (which is probably for extra data, like coupons).

我还发现了一些关于跟踪的 stackOverflow 问题(例如此处),但我所看到的是人们还没有成功跟踪.

I've also found some stackOverflow questions about the tracking (like here), but all I see is that people didn't succeed tracking yet.

  1. 如视频所示,跟踪邀请所需的最少代码是多少?它们的效果如何?在分析页面本身应该配置什么?我目前不使用深层链接,所以我不想使用它.

  1. What is the minimal code needed in order to track the invitations and how well they work, as shown on the video? What should be configured in Analytics page itself? I don't use deep linking currently, so I don't want to use it.

似乎 Google 已将应用邀请功能移至firebase"gradle 存储库.它是必备品吗?有哪些优势?我们目前使用以前的(com.google.android.gms:play-services-appinvite:...").FireBase 的仪表板似乎没有像 Google Analytics 那样包含那么多用于分析的 UI.更不用说应用邀请了.

It seems that Google moved the app-invites feature to "firebase" gradle repositories. Is it a must-have? What are the advantages? We currently use the previous ones ("com.google.android.gms:play-services-appinvite:..." ). The dashboard of FireBase doesn't seem to include as much UI for analytics as Google Analytics. Not to mention of app-invites.

如果 #1 的答案是我需要使用getInvitationIntent",它是否必须在应用程序的主要活动中?它是否必须在一个活动中(也许是 broadcastReceiver?)?

If the answer to #1 is that I need to use "getInvitationIntent", does it have to be on the main activity of the app ? Does it have to be in an activity at all (maybe broadcastReceiver?) ?

似乎也可以邀请到 IOS(如图所示 此处此处,使用setOtherPlatformsTargetApplication").这个对吗?它是如何工作的?当 IOS 用户点击链接时会发生什么?clientId"的参数应该填什么,我从哪里得到它?

It seems it's possible to also invite to IOS too ( as shown here and here, using "setOtherPlatformsTargetApplication"). Is this correct? How does it work? What happens when an IOS user clicks the link? What should be put into the parameter of "clientId" and where do I get it from ?

G+ 有应用邀请吗?如果是,它是否也有分析功能?

Does G+ have app-invites? If so, does it also have analytics?

推荐答案

很好的问题.我会尽力回答一切.请询问您是否需要澄清.

Great questions. I'll do my best to answer everything. Please ask if you need clarification.

分析跟踪需要一个跟踪 ID,您需要使用 setGoogleAnalyticsTrackingId(String trackingId) 设置该 ID,我在您的示例中没有看到该 ID.然后将此跟踪 ID 传递给为您记录分析跟踪事件的下游事件:

Analytics tracking requires a tracking Id that you'll need to set using setGoogleAnalyticsTrackingId(String trackingId), which I don't see in your example. This tracking Id is then handed to the downstream events that record analytics tracking events for you:

  • 发送邀请时(电子邮件和短信).
  • 当受邀用户通过点击邀请链接或按钮接受邀请时.
  • 当开发者调用 getInvitation() 时
  • 当开发者调用 convertInvitation() 时

因此,要回答您的具体问题,请按以下步骤操作:

So, to answer your specific questions, here goes:

  1. 只需将您的跟踪 ID 如上所述添加到构建器,就会报告所有跟踪事件.无需深层链接,这是邀请时可选的.
  2. 是的,appinvites api 被复制到 firebase,同时保留了原来的.目前,它们完全相同.未来的改进将在 Firebase 中进行,因此请在有时间时进行迁移.
  3. getInvitationIntent() 在 getInvitation() 回调中返回的结果上被调用,因此回调应该在一个活动中.此外,由于您只会在启动后立即收到邀请,因此您实际上只需要检查主要活动以及从在深层链接上触发的意图过滤器启动的任何活动.听起来您不使用深层链接,因此只使用主要活动.通常,您应该从可能直接从邀请中启动的所有活动中调用 getInvitation(),这就是您确定应用是否从邀请中启动的方式.
  4. 是的,邀请可以在两个方向跨平台,iOS -> android 和 android -> iOS.您需要在console.developers.google.com 中的同一个项目中定义这两个应用程序,这是将它们关联起来所必需的.如果项目中有多个 iOS 应用程序,则需要调用 api 来消除与 android 应用程序配对的 iOS 应用程序的歧义.当您使用凭据部分的下拉菜单创建 OAuth 客户端 ID 时,会在控制台中生成 ClientID 参数.
  5. 没有任何单独的 G+ 邀请.

这篇关于如何正确使用和跟踪App-invites?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆