[英]Firebase Dynamic Link to track : App Installs, First-Open , Reopen Inside the app and consume Custome Events
I'm using firebase dynamic link in my app.我在我的应用程序中使用了 firebase 动态链接。 I've a two part quetsion.我有一个两部分的问题。
How to know in the app if its a fresh install done using Dynamic Link?如何在应用程序中知道它是否是使用动态链接完成的全新安装? Is there a way I can get these events in my app " dynamic_link_app_open, dynamic_link_first_open," which the document says are automatically tracked by Firebase analytics and Google Analytics?有没有办法可以在我的应用程序“dynamic_link_app_open、dynamic_link_first_open”中获取这些事件,文档中说这些事件会被 Firebase 分析和 Google Analytics 自动跟踪?
All i want is to ask firebase if this dynamic has lead to a fresh install or just a app reopen.我想要的只是询问 firebase 这种动态是否导致全新安装或只是重新打开应用程序。 I'm using this code for getting the deeplink.我正在使用此代码获取深层链接。
FirebaseDynamicLinks.getInstance() .getDynamicLink(intent) .addOnSuccessListener( this ) { pendingDynamicLinkData -> // Get deep link from result (may be null if no link is found) var deepLink: Uri? = null if (pendingDynamicLinkData != null) { deepLink = pendingDynamicLinkData.link Log.d("Firebase pendingDynamicLinkData", pendingDynamicLinkData.toString()) Log.d("Firebase deepLink ", deepLink.toString()) // Handle the deep link. For example, open the linked // content, or apply promotional credit to the user's // account. } .addOnFailureListener(this) { e -> Log.w("Firebase", "getDynamicLink:onFailure", e) } }
Custom Params: Is this the correct way to do it自定义参数:这是正确的方法吗
What I'm doing in my app is adding custom params like customParam1 and customParam2 in the deep link while generating DynamicLink from the Firebase console.我在我的应用程序中所做的是在深层链接中添加自定义参数,如 customParam1 和 customParam2,同时从 Firebase 控制台生成 DynamicLink。 like this像这样
And then in my app when I try to get the deep link using val deepLink = pendingDynamicLinkData.link
I get back this deep link that I generated along with the customParam1 and customParam2 and I'm able to extract them from my URI and perform the needful action.然后在我的应用程序中,当我尝试使用val deepLink = pendingDynamicLinkData.link
获取深层链接时,我取回了与 customParam1 和 customParam2 一起生成的深层链接,并且我能够从我的 URI 中提取它们并执行所需的操作行动。
My question is simply, is this the correct/standard way to do the task?我的问题很简单,这是完成任务的正确/标准方法吗?
I have found solution to get these event from Dynamic Link Callback in Android.我找到了从 Android 中的动态链接回调获取这些事件的解决方案。
Posted answer here.在这里发布答案。
https://stackoverflow.com/a/67732296/4148323 https://stackoverflow.com/a/67732296/4148323
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.