firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.25k stars 572 forks source link

πŸ™ˆ Analytics conversions attribution: πŸ™‰ no UTM source in first_open event πŸ™Š #2187

Open Scino opened 3 years ago

Scino commented 3 years ago

Step 1: Describe your environment

Step 2: Describe the problem

Firebase analytics is not collecting anymore utm_source parameters in first_open events.

Since INSTALL_REFERRER broadcast's deprecation (march 2020), Firebase Console and Google Analytics are not correctly showing sources for first_open conversions anymore.

NOTE: on Google Play Console, conversions are attributed properly. Our Google Play links are well built.

Firabase Console conversions view: image

Google Play Console conversions view: image

What we did to mitigate the problem:

AndroidManifest.xml:

<meta-data
            android:name="firebase_analytics_collection_enabled"
            android:value="true" />
<meta-data
            android:name="google_analytics_adid_collection_enabled"
            android:value="false" />

Firebase Analytics logs:

(Installing on Emulator from Android Studio)

2020-11-19 17:33:36.838 5702-6725/? V/FA-SVC: Install Referrer Service is: available 2020-11-19 17:33:36.850 5702-5702/? V/FA-SVC: Install Referrer Service connected

2020-11-19 17:33:36.891 5702-6725/? V/FA-SVC: Logging event: origin=auto,name=first_open(_f),params=Bundle[{ga_conversion(_c)=1, _r=1, engagement_time_msec(_et)=1, previous_first_open_count(_pfo)=44, system_app(_sys)=0, update_with_analytics(_uwa)=0, system_app_update(_sysu)=0}]

2020-11-19 17:33:37.083 5702-6725/? V/FA-SVC: InstallReferrer API result: utm_source=google-play&utm_medium=organic 2020-11-19 17:33:37.084 5702-6725/? V/FA-SVC: Logging Install Referrer campaign from gmscore with : referrer API v2

first_open event object
event {
          name: first_open(_f)
          timestamp_millis: 1605803612746
          previous_timestamp_millis: 0
          param {
            name: ga_conversion(_c)
            int_value: 1
          }
          param {
            name: ga_event_origin(_o)
            string_value: auto
          }
          param {
            name: _r
            int_value: 1
          }
          param {
            name: engagement_time_msec(_et)
            int_value: 1
          }
          param {
            name: previous_first_open_count(_pfo)
            int_value: 44
          }
          param {
            name: system_app(_sys)
            int_value: 0
          }
          param {
            name: update_with_analytics(_uwa)
            int_value: 0
          }
          param {
            name: system_app_update(_sysu)
            int_value: 0
          }
}
ga_campaign event object:
event {
          name: ga_campaign(_cmp)
          timestamp_millis: 1605803617084
          previous_timestamp_millis: 0
          param {
            name: medium
            string_value: organic
          }
          param {
            name: source
            string_value: google-play
          }
          param {
            name: ga_event_origin(_o)
            string_value: auto
          }
          param {
            name: campaign_info_source(_cis)
            string_value: referrer API v2
          }
}
google-oss-bot commented 3 years ago

I found a few problems with this issue:

riccardo91 commented 3 years ago

Same iussue since March and not able to fix with the support. The firebase-analytics sdk is the only one not open source. We don't even have the chance to investigate on our own.

bobsmits commented 3 years ago

Same issue, but with the automated dynamic link events, dynamic_link_app_open and dynamic_link_first_open. The dynamic link attributes are collected correctly seen in Big Query but they are not visible in Firebase -> Analytics -> Conversions or Google Analytics. But logging them manually with the campaign_details event does seem to work for me, the first_open event is attributed(after a day or so). I'm using the rn package. But this seems to be the Java variant. Also building a link via the Google Play store link builder and using that in a dynamic link is working for me. (bom 25.12.0)

riccardo91 commented 3 years ago

Same issue, but with the automated dynamic link events, dynamic_link_app_open and dynamic_link_first_open. The dynamic link attributes are collected correctly seen in Big Query but they are not visible in Firebase -> Analytics -> Conversions or Google Analytics. But logging them manually with the campaign_details event does seem to work for me, the first_open event is attributed(after a day or so). I'm using the rn package. But this seems to be the Java variant. Also building a link via the Google Play store link builder and using that in a dynamic link is working for me. (bom 25.12.0)

Do you have utm source in first_open if you export on bigquery? Or just in dynamic link?

bobsmits commented 3 years ago

The first_open is attributed in Firebase and Analytics but i cant find anything in bigquery, i'm not a big query expert by any means so i could be looking in the wrong place. Screenshot 2020-11-19 at 23 13 17 Screenshot 2020-11-19 at 23 11 50

riccardo91 commented 3 years ago

The first_open is attributed in Firebase and Analytics but i cant find anything in bigquery, i'm not a big query expert by any means so i could be looking in the wrong place. Screenshot 2020-11-19 at 23 13 17 Screenshot 2020-11-19 at 23 11 50

I'll try to export our events to bigquery and explore it. By the way you are already able to see different utm source from firebase dashboard. Our problem is that all source are not tracked even if our configuration is ok. It seems also that the problem is limited to few account.

aleinnocenzi commented 3 years ago

Same issue here

riccardo91 commented 3 years ago

Hello, The problem is definetely on firebase side. 3 days ago something changed and data start to be collected but with a really strange behavior.

this screen has been taken on 22 november with date filetr for "today firstopen-22-11_takeon_22-11 " this screen has been taken on 23 November with date filter "yesterday" screen taken on 23 november

as you can see data disappear from the analytics

riccardo91 commented 3 years ago

@rlazo maybe you should tag for for api analytics ? thanks

riccardo91 commented 3 years ago

by the way i noticed a bug in data aggregation. if you look in the intradays collection you can notice that events have utm_source

SELECT * FROM [project].analytics_151396105.events_intraday_20201123 where Platform="ANDROID" and traffic_source.source="google-play" and app_info.version="2.3.8"

image (2)

but if i move to eventsn dataset the day after

SELECT * FROM [project].analytics_151396105.events_20201123 where traffic_source.source="google-play" and app_info.version="2.3.8"

all data disappear

riccardo91 commented 3 years ago

Hello, the problem seems to be limited to first_open for Android app.

We are passing in the user properties the utm_sorce took from Install Referrer API to validate that aggregation model of google analytics has some iussue.

here how to reproduce it assuming that you are passing the utm_source param as user properties

SELECT a.utm,count(*) FROM
(SELECT user_pseudo_id FROM `[project].analytics_151396105.events_20201122`
where event_name="first_open"
group by user_pseudo_id) AS F
INNER JOIN
(SELECT user_pseudo_id,value.string_value as utm FROM `[project].analytics_151396105.events_20201122`, UNNEST(user_properties)
where key="utm_source" and event_name="screen_view" and value.string_value is not null and value.string_value !=""
group by user_pseudo_id,value.string_value) AS A
ON A.user_pseudo_id=F.user_pseudo_id
group by A.utm

image (3)

but if you aggregate by traffic_source(totally managed on GA) you can see tha all that data are missing

SELECT traffic_source.name FROM `[project].analytics_151396105.events_20201122`
where event_name="first_open"
group by traffic_source.name

image (4)

maverick108 commented 1 year ago

Any resolution to this? Should we use a direct pay store URL with a referrer param?

Is the functionality of Dynamic Link broken? With the introduction of GA4, everything is broken. Request google to help the community here!!

ShuheiSuzuki-07 commented 1 year ago

Same issue, but with the automated dynamic link events, dynamic_link_app_open and dynamic_link_first_open. The dynamic link attributes are collected correctly seen in Big Query but they are not visible in Firebase -> Analytics -> Conversions or Google Analytics. But logging them manually with the campaign_details event does seem to work for me, the first_open event is attributed(after a day or so). I'm using the rn package. But this seems to be the Java variant. Also building a link via the Google Play store link builder and using that in a dynamic link is working for me. (bom 25.12.0)

Does anyone have any additional info on this? Is this a bug? Is it a spec? I want some kind of reaction.