Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context.device.advertisingId Not Being Collected #780

Open
tcrawford94 opened this issue Dec 17, 2021 · 5 comments
Open

context.device.advertisingId Not Being Collected #780

tcrawford94 opened this issue Dec 17, 2021 · 5 comments

Comments

@tcrawford94
Copy link

tcrawford94 commented Dec 17, 2021

Our Analytics track & screen calls are not being sent with a context.device.advertisingId. We have minifyEnabled set to true in our build.gradle, and disabling this fixes the issue, but that isn't an acceptable solution here.

Adding the following proguard rules to our project fixes the issue while minifying:

-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { *; }
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { *; }

Segment SDK is only a sustainable service and library for us to use if we can assume it will continue to work between library version updates. For these reason, we would also request that you package any other necessary proguard rules in the analytics-android library itself, as opposed to instructing us to keep our proguard rules up to date based on your latest documentation:

-keep class com.segment.analytics.** { *; }
-keep class androidx.lifecycle.DefaultLifecycleObserver

Other fixes attempted:
There's a small amount of documentation highlighting the requirement of including "Google Play Services Ads Library" to our project, but that does not fix the issue. Additionally, I'm confused why anything more than the Google Play Services Ads Identifier library would be necessary, as Ads Library requires us to sign up for Ad Mob like we plan to display ads in our app. I believe the documentation should clarify what is required here. I believe all that would be needed is the following line in the build.gradle, even though this didn't fix the issue.

implementation 'com.google.android.gms:play-services-ads-identifier:18.0.0'
@tcrawford94
Copy link
Author

Edited issue, adding more comments. Please let me know if I can provide any more details here.

@jflavio11
Copy link

@tcrawford94 This got me confused too. The lib documentation mentions that we should add the Google Ads Library as a dependency in order to let the Segment lib collect the Advertising ID.

Moreover, if your app targets SDK 33 or later, Google Play Store Console shows a warning mentioning that we must declare the Advertising ID permission in the Android Manifest (which is included by default by the Google Ads Library). What I do not understand is: Will the Segment Library work or not if we don't include the Google Ads Library as a dependency in our apps?

@carlosmonzon
Copy link

@tcrawford94 @jflavio11 I have exactly the same scenario. I have not added the Advertising ID permission in the Android Manifest and I am targeting android 13 now.

Should we declare that our app uses Advertising ID because of segment?

@mrtnrst
Copy link

mrtnrst commented Aug 1, 2022

Ideally, Segment updates their SDK to include the requirement in the manifest so it will be merged into users' apps when they update the version number.

I can also open a PR for this if no one has started yet.

@sterlingudell-th2
Copy link

I'd like to strongly second @tcrawford94's request that the AdvertisingIdClient ProGuard rules be added to the docs, as collecting the advertising ID won't work without them. If there's a way to include these in the actual library itself, that'd be even better.

Also, @mrtnrst's suggestion of adding the following line to the library's manifest only makes sense:

    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants