I am using my custom broadcast receiver as follows to track UTM parameters.
<receiver
android:name=".services.CustomInstallListener"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
public class CustomInstallListener extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.hasExtra("referrer")) {
String data = intent.getStringExtra("referrer");
String referrers[] = data.split("&");
for (String referrerValue : referrers) {
String keyValue[] = referrerValue.split("=");
if (keyValue.length > 0) {
if (keyValue[0].equalsIgnoreCase("utm_campaign")) {
... something
}
}
}
}
I have also implemented the InstallReferralClient as follows
referrerClient.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
switch (responseCode) {
case InstallReferrerClient.InstallReferrerResponse.OK:
ReferrerDetails response = null;
try {
response = referrerClient.getInstallReferrer();
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
@Override
public void onInstallReferrerServiceDisconnected() {
}
});
And I used the Google Play Url Builder to generate this URL.
https://play.google.com/store/apps/details?id=com.myapp&referrer=utm_source%3Dweb%26utm_medium%3Dlogo-click%26utm_term%3Dnew-install%26utm_content%3Dworld-cup%26utm_campaign%3Dworld-cup
Now I have it tried with both HTTP and https URLs and tried some other solutions following some other questions on StackOverflow but nothing seems to work.
Link1, Link2, Link3
For all the UTM parameters passed in the URL to play store, I am getting (not%20set) as value. I have also tried using the URL in the deep link from the branch and firebase dynamic links and I am getting the same error.
But I am sure that the code to handle this is correct as it returns campaign and medium value as Google and organic respectively when directly installing from Play Store.
The “source” UTM tag = the referrer (Facebook, Twitter, LinkedIn, YouTube, etc.) The “medium” UTM tag = how the traffic gets to you (for most social media links, this will just be “social”) The “campaign” UTM tag = why the traffic is coming to you (launch, persona, promotion, etc.)
An Install Referrer is an Android-specific ad tracking identifier. Like Device IDs and Device Fingerprinting, an install referrer is a unique string that's sent to the Play Store when a user clicks on an ad.
Open the Admin Settings and navigate to Custom Definitions → Custom Dimensions → New Custom Dimension. We'll add a Name to the dimension, and use the Scope as Session because our UTM parameters are also scoped to sessions. We'll keep the status as Active only. Once done, let's click on Create.
utm_source : Identify the advertiser, site, publication, etc. that is sending traffic to your property, for example: google, newsletter4, billboard. utm_medium : The advertising or marketing medium, for example: cpc, banner, email newsletter. utm_campaign : The individual campaign name, slogan, promo code, etc.
You're most likely logged into a managed account (e.g. a work email). It doesn't matter if you have your personal account active in Play Store. The Play Store consistently checks all accounts that you're signed into on that phone. If any of them are managed by an enterprise that it resets the referrer token. You can verify this by removing said account and retry sending the token.
I can't speak to why this is the intended behavior but perhaps someone from Google can shine some light.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With