Skip to content

Google Analytics attribution params not being recorded in dynamic_link_first_open event #2462

Closed
@damienix

Description

@damienix
  • Xcode version: 10.1
  • Firebase SDK version: 5.16.0
  • Firebase Component: Dynamic Links
  • Component version: 5.16.0/3.4

Steps to reproduce:

Hi, I'm struggling to get iOS attribution via dynamic links working on iOS. I'm using dynamic links where I set the UTM parameters. On Android, this is working as I'd expect. When a user installs the app (on mobile) from a dynamic link, their future analytics event contain campaign params. I can confirm this by capturing these events:

zrzut ekranu 2019-02-27 o 14 08 41

campaign, source and medium are recorded in dynamic_link_first_open, but they are also recorded (without extra data) in the next event (not set). I'm not sure which actually sets the attribution params for the user, can you tell me that?

On iOS after opening the link, and then installing the app I get no UTM parameters included in the event, there's also no (not set) event. As said before, I suspect that one of these events sets the attribution, but I haven't found any information on which, please confirm.

zrzut ekranu 2019-02-27 o 14 56 42

I found that on iOS dynamic_link_first_open or dynamic_link_app_open (doesn't matter which as it's handled by the same code) will report campaign parameters when opened when the app is already installed. AFAIU in that case the app receives the params via a deep link and is handled by different code. Also, this is counted properly in the Conversions tab.

I found that UTM params are lost when the links (obtained from clipboard) are processed by FIRPostInstallAttributionCompletionHandler which then only passes FIRDynamicLink for further processing, and this class doesn't contain UTM data. Old params are replaced by match_type and match_message only.

https://github.com/firebase/firebase-ios-sdk/blob/master/Firebase/DynamicLinks/FIRDLDefaultRetrievalProcessV2.m#L127-L155

I was testing this on https://github.com/firebase/quickstart-ios/tree/master/dynamiclinks/DynamicLinksExample

Relevant Code:

I've prepared the PR #2461 with the code that seems to fix the problem for me i.e. with this change I see UTM parameters properly reported in dynamic_link_first_open event the same as I see them on Android plus extra (not set) event the UTM params, though I haven't debugged where (not set) event is fired and why :) I assume the will save the attribution for a particular user.

Let me know if you have any questions, TBH I still hope that maybe I did something wrong, if not then I can't imagine how no one had been complaining about this for months... 😦 Is this possible? 😉

Damian

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions