Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Campaign Measurements Tracking

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?

like image 692
AndreiBogdan Avatar asked Nov 08 '22 02:11

AndreiBogdan


1 Answers

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.

like image 82
nnn Avatar answered Nov 15 '22 04:11

nnn