Firebase动态链接在使用自定义域时未获取UTM源之类的查询参数

时间:2019-07-02 11:00:46

标签: java android kotlin

在这里,当我使用自定义域时,没有得到像soource,medium这样的GoogleAnalyticsParameters

FirebaseDynamicLinks.getInstance().getDynamicLink(intent).addOnSuccessListener {
                if (it != null) {
                    deepLink = it.link

                }
            }.addOnCompleteListener {
                callCampaignApi(deepLink)
                if (!appUtils.readStringFromPref(Constant.KEY_TOKEN).isNullOrBlank() && deepLink != null) {
                    try {
                        //means user is allready logged in
                        //source is used for screenname
                        var source = deepLink!!.getQueryParameter("utm_source")
                        // campaign is used for additional data like agentId or feedId
                        var campaign = deepLink!!.getQueryParameter("utm_campaign")
                        // utm _medium to track external sources
                        var medium = deepLink!!.getQueryParameter("utm_medium")
                        handleDynamicLinks(this, source ?: "", campaign ?: "", medium ?: "", deepLink!!)
                        this.finish()
                    } catch (ex: Exception) {
                        Log.e("DEEPLINK EXCEPTIONS", ex.message)
                        mDelayHandler!!.postDelayed(mRunnable, SPLASH_DELAY)
                    }
                } else {
                    //take him to login  or Registration with deeplink
                    if (deepLink != null) {
                        var source = deepLink!!.getQueryParameter("utm_source")
                        var campaign = deepLink!!.getQueryParameter("utm_campaign")
                        if (source?.equals(Constant.SCREEN_SEND_INVITATION)!! && campaign != null) {
                            //it means it has cp code /// send that value of cpcode to registration screen
                            launchLoginActivity(campaign)
                        } else {
                            //regular flow
                            mDelayHandler!!.postDelayed(mRunnable, SPLASH_DELAY)
                        }
                    } else {
                        //regular flow
                        mDelayHandler!!.postDelayed(mRunnable, SPLASH_DELAY)
                    }

                }
            }








Expected Result is utm source,campaign gets appended in link automatically

0 个答案:

没有答案