Google Campaign Measurements Tracking
Asked Answered
G

1

6

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?

Grind answered 25/1, 2017 at 10:21 Comment(0)
A
2

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.

Alleviator answered 25/1, 2017 at 12:17 Comment(2)
I try this with Google Play Url Builder, but the content of intent.getData is null...Hirohito
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.Feathery

© 2022 - 2025 — McMap. All rights reserved.