How to remotely change AdMob app unit ID? - android

Is there a way to remotely change the AdMob app unit ID, which is located in the manifest file? I already use Firebase Remote Config, but I could not find a way to update Manifest remotely...
In Manifest file:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>

Related

Firebase Analytics, re-enable Advertising Id collection

Firebase Analytics for android has a metadata for the manifest to disable data collection before the user's consent
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
To re-enable collection, such as after an end-user provides consent there is the method
setAnalyticsCollectionEnabled(true);
To limit only the collection of the advertising id there is the metadata to add to the manifest
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
Then, to rehabilitate the collection of the advertising id, after the user's consent is there a dedicated method? Or is it okay to continue to use setAnalyticsCollectionEnabled(true);
setAnalyticsCollectionEnabled(true) doesn't influence setting google_analytics_adid_collection_enabled. Once you disable advertising id collection in the manifest file, there is no way to enable it programatically.

Advertising Id taken from a library not app

I use a library for my app which takes Google Advertising Id for some reason.
This will violate the Android Advertising Id policy.
My question is if I disable taking this id using the firebase metadata tag (ignoring what will happen to the library), am I still violating that policy?
The tag, according to firebase doc is:
<meta-data
android:name="google_analytics_adid_collection_enabled"
android:value="false" />
I mean how google detects that using getAdvertisingId method is violating?

Is it necessary to use com.google.android.gms.ads.AdActivity on android app?

I am setting the use of a banner ad for my android app. I've followed the official doc at: https://developers.google.com/admob/android/quick-start
The doubt I want to clearify is that some tutorials over the internet say that you need to add the code bellow in android manifest:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|
screenLayout|uiMode|screenSize|smallestScreenSize"/>
The official doc doesn't state anything about that, so what then? Will my ads work properly without that?
First you have to add below dependency in your gradle file:
implementation 'com.google.android.gms:play-services-ads:17.1.1'
Then You have to add meta-data tag in your manifest that specifies your admob application id.
So add below code to your manifest in application tag:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="your admob application id"/>
and if you want to test ads in your app, you can use sample application id provided by google itself, which is as below:
ca-app-pub-3940256099942544~3347511713
Now you can implement all types of ads by your own and first use test ad unit ID for testing purpose. It shows that your ads will be showed or not. Test ad unit Ids are as follows:
For Banner Ad: ca-app-pub-3940256099942544/6300978111
For Interstitial Ad: ca-app-pub-3940256099942544/1033173712
For Native Ad: ca-app-pub-3940256099942544/2247696110
For Rewarded Video Ad: ca-app-pub-3940256099942544/5224354917
Yes , Since you are using the Google Play Services and not the legacy AdMob SDK
you have to replace the name of the activity class which comes from gms.ads.AdActivity
com.google.ads.AdActivity
to
com.google.android.gms.ads.AdActivity

Google Analytics v4 and tracking installs in different apks

I'm new to this GA thing, and the guide on the official website (https://developers.google.com/analytics/devguides/collection/android/v4/) is not really clear to me.
For my first app I want some simple statistics: when people install the app or delete it, do they return to it after installing.
Also I'd like to make several apk's (not only for Google Play, but also for third-party websites) and see stats for each app (I've heard you can add some kind of markers for that).
I have the required permissions in my manifest:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
I also have a global_tracker.xml but it's not yet functional:
<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="TypographyDashes">
<integer name="ga_sessionTimeout">300</integer>
<!-- Enable automatic Activity measurement -->
<bool name="ga_autoActivityTracking">true</bool>
<!-- The screen names that will appear in reports -->
<!-- The following value should be replaced with correct property id. -->
<string name="ga_trackingId">UA-hidden-2</string>
What else do I need to add and where? Is there some better guide rather that the one I linked above?
To track installations on Android you need to enable campaign tracking by registering CampaignTrackingService and CampaignTrackingReceiver in your ApplicationManifest.xml:
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
To also track applications referring your application (like browser link launching your application) you will also need to either enable automatic activity tracking with a call to tracker.enableAutoActivityTracking(true) or manually call tracker.setCampaignParamsOnNextHit(activity.getIntent.getData(). If you expect your app will run on Android API 11 or earlier (this is Android 3.0 Honeycomb) you also need to manually call analytics.reportActivityStart(this) from each Activity.onStart() and analytics.reportActivityStop(this) from each Activity.onStop() of your application activities.
Web sites don't actually distribute your app. They only link to Google Play store entry. You need to provide the web site with the URL to install your application. The URL you provide must include "referrer" parameter with your campaign parameters.
There is detailed campaign tracking devguide on Google Analytics developer site: https://developers.google.com/analytics/devguides/collection/android/v4/campaigns
There is URL builder at the end of the devguide that you can use to generate your download URL.

Android AdMob download Tracking Test

I am working on an application, in which i have to add google admob download tracking. i.e., to check that number of the time the app has been downloaded from the android market. But for the time being app is not in android market as it is in development phase, to do so, i have added the code in xml as per the documentation in the manifest file within application tag:
<receiver
android:name="com.google.ads.InstallReceiver"
android:exported="true">
<intent-filter>
<action
android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
What else i need to do, i have included the jar file as well, but what next ??? remember it's just download tracking not whole app tracking. Any help is appreciated. Thanks..!!!
Duplicate of Tesing Admob Tracking in Android App
With no response. The conclusion so far is that it can be tested only after the app is live with the tracking implemented.

Categories

Resources