Google Analytics for Android and Install referral - android

if I include the code following code in AndroidManifest.xml, then will it send a notification on notification or there is something more to be included.
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
How to view installation report in Google Account and What parameters are required to be set in the account?
UA-Account number is the id to be used for websites, is it required for android app installation notification.
Can any one specify the exact procedure to view Android application installation in Google Analytics and coding snippets required.

I think all of your questions are answered here.
In summary:
You need to include the Google Analytics SDK for Android
You need a UA number, which you provide when you call startNewSession: tracker.startNewSession("UA-YOUR-ACCOUNT-HERE", this);
Google provides a fully functional sample application which starts/stops the GoogleAnalyticsTracker instance in your Activity and tracks events and page views, as well as dispatches the results (stored locally on the phone until dispatched to the analytics server)
Include AnalyticsReceiver to track referrals

Related

How is Android Firebase messaging SDK secure against Intent spoofing?

I created a simple project using Firebase Messaging, using the following dependency.
implementation 'com.google.firebase:firebase-messaging:20.0.0'
I have built the app and checked its merged AndroidManifest.xml file. The only exported component by Firebase Messaging SDK is the following receiver:
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>
I couldn't find the definition of the permission com.google.android.c2dm.permission.SEND, even though I have decoded AndroidManifest.xml of Google Play Services APK and found nothing there. Apart from its definition whatever it is, it cannot prevent a malicious app to use-permission it and broadcast forged Intents. Also because of Intents being delivered by system_server, the receiver cannot check the identity of the sender.
How does Firebase Messageing SDK counterattack this threat?
A malicious app installed from the Play Store cannot use any permission that starts with "com.google.android". Those are reserved for system privileged apps.
The Play services "backend" app, which is installed on every device that has the Play store, actually handles incoming FCM messages directly. It is a privileged app, and is the only one that will use those permissions to send data to your app.
If you manage to root your device and install a malicious app with system privileges, then you might have a problem. But that's the risk you take when you bypass the security measures built into the device.

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.

How to use Google Analytics track referrer install from Google Play?

Add libGoogleAnalytics.jar to your project's /libs directory.
Add the following permissions to your project's AndroidManifest.xml manifest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Add the following code snippet to your project's AndroidManifest.xml manifest file:
<!-- Used for install referrer tracking -->
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" >
</intent-filter>
</receiver>
But I never entered my UA-xxxxx-yy ID. The ID entered for Pageviews and Events tracking like this:
tracker.startNewSession("UA-xxxxx-yy", this);
Google Analytics for Android SDK ReadMe says: (NOTE: do not start the GoogleAnalyticsTracker in your Application onCreate() method if using referral tracking).
With referrer tracking where do i put my ID or not? If need, how? If not, why?
At first, it seemed strange to me that Google would require those who only need to do install referrer tracking to incorporate two permissions that might otherwise be unneeded, plus a library, into their apps, given that the information needed to track referrers is already available on the Google Play servers, and could presumably be accessed from there via a Web-based interface, similar to the one used to track purchases on the Chrome Web Store. When you consider that the app-based Analytics interface does not even cover purchases via the GP Web pages, the case for doing this seems even more convincing.
This omission still seems odd in the general case of tracking an arbitrary referrer, but I recently discovered that in the specific case where the referrer that you are trying to track comes from an Adwords ad, there seems to be an easier means of tracking Google Play app installs that does not require any modifications to your app. All of this is set up through the Adwords interface, not through Google Play, and not through modifications to your app.
You did not indicate whether your referrers were from Adwords or from some other source or sources, so I'll provide this information, in case it is useful.
This page
http://support.google.com/adwords/bin/answer.py?hl=en&answer=1722054
describes how to set up conversion tracking of Google Play app sales via Adwords. From that page:
Tracking mobile app downloads from Google Play doesn't require adding a code snippet. It can be done with no changes to your app's code. Simply follow the steps below.
Sign in to your AdWords account at http://adwords.google.com
Click the "Tools and Analysis" tab, and then click the "Conversions" tab.
Click the "+ New conversion" button.
Name your conversion, select "Mobile app download" and click "Save and continue". Enter the package name. (You can find your package name by looking up your app in Google Play. It's the part of the base URL that identifies your application: "https://play.google.com/store/apps/details?id="
Click "Save and continue".
On the next screen, click "Done".
Your mobile app downloads conversion data will now start showing up with the rest of your conversion data within 24 hours.
Note: Mobile application download tracking for Android will only work if your links in Click-to-download or Mobile App Extension ads point directly to the Google Play Store. Third-party tracking URLs are not supported at this time.
Check the GA SDK implementation at - the measurement is explained very clearly. https://developers.google.com/analytics/devguides/collection/android/v2/campaigns#google-play-implement

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.

Google Analytics Referrer issue in android

I've been having some trouble getting my referrer tracking to work with GA (Google Analytics) in my Android app. There isn't much info in the GA Doc. I am only using GA to track the referrer, by the way. Nothing else.
In my manifest file i have exactly this within the application tags:
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
I have then created a URL using the generator, tested it but still no stats are showing at all.
There was nothing else in the docs. Nothing to link this referral to my GA account, which I think is very strange. Is there something in my Activity that I have to write to send the referrer information to my GA account?
You need to add to your Activity:
GoogleAnalyticsTracker GATracker = GoogleAnalyticsTracker.getInstance();
GATracker.start("UA-XXXXXX-XX",20, this);
GATracker.trackPageView("Page-to-track");
Refer this for complete setting: Google Analytics SDK for Android

Categories

Resources