brwngrldev
brwngrldev

Reputation: 3704

utmParameters is always empty for a Firebase Dynamic Link

I've created several dynamic links with UTM parameters using the Firebase console. Yet, the utmParameters field is always empty.

By the time the intent is received the UTM parameters have been stripped off. We want to use these parameters for additional tracking and decision-making in the app.

Any ideas what could be going wrong here? Thanks

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    Firebase.dynamicLinks
        .getDynamicLink(intent)
        .addOnSuccessListener(this) { pendingDynamicLinkData ->
            var deepLink: Uri? = null
            if (pendingDynamicLinkData != null) {
                deepLink = pendingDynamicLinkData.link

                Timber.tag("XXX").d("UTM :${pendingDynamicLinkData.utmParameters}")
            }
        }
        .addOnFailureListener(this) { e -> Timber.e(e, "Failed to process Dynamic Link") }
}

Upvotes: 1

Views: 1700

Answers (2)

MaverickR
MaverickR

Reputation: 1

The URI worked for me. The Java equivalent code:

FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent().getData())

Upvotes: 0

matias lev
matias lev

Reputation: 96

I find the same problem and what solve it for me is start using the method that expects an Uri instead of Intent.

intent.data?.let {
    Firebase.dynamicLinks.getDynamicLink(it)
        .addOnSuccessListener(this) {
            ......
}

Upvotes: 7

Related Questions