Reputation: 539
I've been reading up all day on Google Analytics Campaign Measurement for my Android app. I'm really confused on how this whole process works and it would be amazing if someone would help clear up some questions.
I've got the trackers set up in one of the activities:
@Override
public void onStart() {
super.onStart();
EasyTracker.getInstance().activityStart(this);
}
@Override
public void onStop() {
super.onStop();
EasyTracker.getInstance().activityStop(this);
}
I ran a test campaign via the terminal as per the documentation:
$ ./adb shell am broadcast -a com.android.vending.INSTALL_REFERRER
-n your.package.name/path.to.receiver --es "referrer"
"utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&
utm_content=testContent&utm_campaign=testCampaign"
I got the test to show up in LogCat
Thread[GAThread,5,main]: Campaign found: utm_source=testSource
Questions:
How do I use this with real campaigns? Where do the urls come from and do I have to manage them somehow or does Google take care of that?
How can I view these on my Analytics dashboard? I can't find anything about campaigns or anything.
If the only thing I'm tracking is where downloads are coming from, do I only need to put the code in the first activity of the app? Or every activity like the documentation says?
Thank you!
Upvotes: 1
Views: 2223
Reputation: 397
Because in linux terminal &(ampersand) is escaped that is the reason not work
Follow below given steps:-
1) Type adb shell and press enter
2) Then paste this
am broadcast -a com.android.vending.INSTALL_REFERRER -n com.futureprints.smiley/com.futureprints.smiley.CustomCampaignTrackingReceiver --es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"
3) Now check you will receive complete string in receiver
"utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"
Upvotes: 2
Reputation: 76
To use it with real campaigns the easiest way is probably to use the Google Play URL builder. See here: https://developers.google.com/analytics/devguides/collection/android/v2/campaigns#google-play-url-builder
To view on the analytics dashboard go to "Acquisitions -> Google Play -> Sources"
If you only want to see where installs are coming from make sure you set up your INSTALL_REFERRER see https://developers.google.com/analytics/devguides/collection/android/v2/campaigns. This goes in your manifest. Looking at your example it appears you have already done this. You shouldn't need to do anything else.
Upvotes: 1