9

I've an Android app where user has to register. On sending registration, I want to send the parameters from the PlayStore (utm_source, etc.) to know from which campaign user comes from.

So the idea was to use a own BroadcastReceiver for INSTALL_REFERRER, where I save parameters to a file. When user registers i will read the file and send the content.

So I made receiver:

public class CampaignBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {


    String refferer = intent.getExtras().getString("referrer");
    try {
        FileOutputStream fos = context.openFileOutput("campaign", Context.MODE_PRIVATE);
        fos.write(refferer.getBytes());
        fos.close();
    } catch (FileNotFoundException e) {

    } catch (IOException e) {

    }


    new CampaignTrackingReceiver().onReceive(context, intent);
}

And, in AndroidManifest.xml I use :

<service android:name="com.google.analytics.tracking.android.CampaignTrackingService"/>
    <receiver android:name=".receiver.CampaignBroadcastReceiver" android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

When i use the test scenario from google it works and the onReceive Method in my BroadcastReceiver is called.

./adb shell am  broadcast -a com.android.vending.INSTALL_REFERRER -n
mypackage/mypackage.receiver.CampaignBroadcastReceiver --es  "referrer" 
"utm_source%3Dtest%26utm_medium%3Dbanner%26utm_term%3Dmailstuff"

But, when I try it from PlayStore then nothing is called.

Has anybody idea how to grap the campaign parameters from the PlayStore in app?

Manish Dubey
  • 4,206
  • 8
  • 36
  • 65
user2641233
  • 109
  • 3
  • now i found out that it works if the user installs the app on the phone directly with the play store app. But when the user uses the playstore site and installs it remote then it does not work. Has anybody a idea for a workaround in that case? – user2641233 Aug 01 '13 at 11:49
  • Looking at the previous comment, this seems to duplicate [Install referrer is not tracking on android web market](http://stackoverflow.com/questions/10072467/install-referrer-is-not-tracking-on-android-web-market) – Juuso Ohtonen Dec 12 '14 at 07:22

1 Answers1

3

I don't know a workaround but the issue is known to Google.

Google Play Campaign Measurement does not currently support web-to-device installs initiated from the web Play Store.

Known Issues

Benny
  • 133
  • 8
  • The documentation link and "known issues" section is for legacy v2. From later version, the whole "known issues" section is missing. So, should the feature work now? For me, it seems not, i.e., the "no referrer via web market" issue still exists. See also http://stackoverflow.com/q/10072467/1097104 – Juuso Ohtonen Dec 12 '14 at 07:22