5

I'm trying to setup the Campaign Measurement system to track where the users find my app. I've implemented the first part Google Play Campaign Attribution this but I can't seem to figure out how to do the General Campaign & Traffic Source Attribution one.

It says that:

// In this example, campaign information is set using
// a url string with Google Analytics campaign parameters.
// Note: This is for illustrative purposes. In most cases campaign
//       information would come from an incoming Intent.

but I can't find any doc that specifies what would the name of the string received in the Bundle, or how exactly I should retrieve that url. I'm guessing it'll be sent to the app automatically, but I'm not 100% on how I must retrieve it.

Any ideas?

AndreiBogdan
  • 10,858
  • 13
  • 58
  • 106

1 Answers1

1

Whenever any end-user clicked the ad on some social networking site or email, user will hit a url and this url will be sent to your application intent.

You can retrive this url via following code in your activity class:

Intent intent = getIntent();
Uri data = intent.getData();

and then you can send this data to GA for tracking using setCampaignParamsFromUrl() function.

nnn
  • 980
  • 6
  • 13
  • I try this with Google Play Url Builder, but the content of intent.getData is null... – Mia Apr 12 '17 at 09:13
  • I also tried this and the result is I am getting the data null even if in first open after publishing in google play store. – Najib Jun 06 '17 at 09:59