簡體   English   中英

要跟蹤的 Firebase 動態鏈接:應用安裝、首次打開、重新打開在應用內並使用自定義事件

[英]Firebase Dynamic Link to track : App Installs, First-Open , Reopen Inside the app and consume Custome Events

我在我的應用程序中使用了 firebase 動態鏈接。 我有一個兩部分的問題。

  1. 如何在應用程序中知道它是否是使用動態鏈接完成的全新安裝? 有沒有辦法可以在我的應用程序“dynamic_link_app_open、dynamic_link_first_open”中獲取這些事件,文檔中說這些事件會被 Firebase 分析和 Google Analytics 自動跟蹤?

    我想要的只是詢問 firebase 這種動態是否導致全新安裝或只是重新打開應用程序。 我正在使用此代碼獲取深層鏈接。

     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) } }
  2. 自定義參數:這是正確的方法嗎

    我在我的應用程序中所做的是在深層鏈接中添加自定義參數,如 customParam1 和 customParam2,同時從 Firebase 控制台生成 DynamicLink。 像這樣

    在此處輸入圖片說明

然后在我的應用程序中,當我嘗試使用val deepLink = pendingDynamicLinkData.link獲取深層鏈接時,我取回了與 customParam1 和 customParam2 一起生成的深層鏈接,並且我能夠從我的 URI 中提取它們並執行所需的操作行動。

我的問題很簡單,這是完成任務的正確/標准方法嗎?

我找到了從 Android 中的動態鏈接回調獲取這些事件的解決方案。

在這里發布答案。

https://stackoverflow.com/a/67732296/4148323

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM