Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Able To Retrieve The Refferal Id After Passing It In The Play Store URL #39

Open
subhamPoulimaInfotech opened this issue Aug 7, 2024 · 11 comments
Labels
question Further information is requested

Comments

@subhamPoulimaInfotech
Copy link

Issue: Unable to Retrieve Referral ID from Play Store URL

I am currently facing an issue with retrieving the referral ID once a user clicks and downloads the app from a specific Play Store link. I am using the react-native-play-install-referrer library to pass the referral ID via the Play Store URL.

Sample URL:

https://play.google.com/apps/test/com.astroavastha/25?referrer=referralId%3D123456

Observed Behavior:
After downloading the app from the Play Store using the above URL, the response I received was:

"installReferrer": "utm_source=google-play&utm_medium=organic"

The referralId is not present in the response.

Expected Behavior:
The response should include the referralId.

Code:

import React, { useEffect } from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
  Button,
  ToastAndroid,
  Platform,
} from 'react-native';
import { PlayInstallReferrer } from 'react-native-play-install-referrer';
import SplashScreen from 'react-native-splash-screen';
import { Colors } from 'react-native/Libraries/NewAppScreen';

const App = () => {
  useEffect(() => {
    SplashScreen.hide();
  }, []);

  function _onPress_getInstallReferrerInfo() {
    if (Platform.OS === 'android') {
      PlayInstallReferrer.getInstallReferrerInfo((installReferrerInfo, error) => {
        if (!error) {
          var msg = "Install referrer = " + installReferrerInfo.installReferrer;
          console.log("Install referrer = " + installReferrerInfo.installReferrer);
          msg += "\n\nReferrer click timestamp seconds = " + installReferrerInfo.referrerClickTimestampSeconds;
          console.log("Referrer click timestamp seconds = " + installReferrerInfo.referrerClickTimestampSeconds);
          msg += "\n\nInstall begin timestamp seconds = " + installReferrerInfo.installBeginTimestampSeconds;
          console.log("Install begin timestamp seconds = " + installReferrerInfo.installBeginTimestampSeconds);
          msg += "\n\nReferrer click timestamp server seconds = " + installReferrerInfo.referrerClickTimestampServerSeconds;
          console.log("Referrer click timestamp server seconds = " + installReferrerInfo.referrerClickTimestampServerSeconds);
          msg += "\n\nInstall begin timestamp seconds = " + installReferrerInfo.installBeginTimestampServerSeconds;
          console.log("Install begin timestamp seconds = " + installReferrerInfo.installBeginTimestampServerSeconds);
          msg += "\n\nInstall version = " + installReferrerInfo.installVersion;
          console.log("Install version = " + installReferrerInfo.installVersion);
          msg += "\n\nGoogle Play instant = " + installReferrerInfo.googlePlayInstant;
          console.log("Google Play instant = " + installReferrerInfo.googlePlayInstant);
          ToastAndroid.show(msg, ToastAndroid.LONG);
        } else {
          var msg = "Failed to get install referrer info!";
          console.log("Failed to get install referrer info!");
          msg += "\n\nResponse code: " + error.responseCode;
          console.log("Response code: " + error.responseCode);
          msg += "\n\nMessage: " + error.message;
          console.log("Message: " + error.message);
          ToastAndroid.show(msg, ToastAndroid.LONG);
        }
      });
    }
  }

  return (
    <>
      <View style={styles.buttonSection}>
        <Button 
          onPress={() => _onPress_getInstallReferrerInfo()} 
          style={styles.buttonStyle}
          title="Get Install Referrer Info"
        />
      </View>
    </>
  );
};

const styles = StyleSheet.create({
  buttonSection: {
    margin: 20,
  },
  buttonStyle: {
    padding: 10,
  },
});

export default App;

Request for Assistance:
Could you please help me understand how to correctly retrieve the referralId? If there are any adjustments or specific configurations needed on the Play Console or within the code, please let me know.

@subhamPoulimaInfotech subhamPoulimaInfotech added the question Further information is requested label Aug 7, 2024
@shiftbrent
Copy link

Did you solve this?

@levepic
Copy link

levepic commented Oct 20, 2024

So this module is useless? Doesnt work at all?

@uerceg
Copy link
Owner

uerceg commented Oct 20, 2024

Hello guys,

Sorry for a bit of radio silence in this repo.

I am not really sure whether your test URL is properly formatted - at least I have never used it in that version. If com.astroavastha is your package name, give this URL a shot:

https://play.google.com/store/apps/details?id=com.astroavastha&referrer=referralId%3D123456&hl=en

Looking forward to hear if that worked for you.

@levepic
Copy link

levepic commented Oct 21, 2024

I get the referrer value successfully from Open Testing using referrer=.... . I'll also try it on live release soon. The important thing would be to get if the user came from Google Ads, i'll check that also.
For other users I got ,"installReferrer":"utm_source=google-play&utm_medium=organic" but for myself using the referrer link i got properly the "installReferrer":"testref" which i set as a parameter opening google play

@uerceg
Copy link
Owner

uerceg commented Oct 21, 2024

I am unfortunately unable to run the tests with Google Ads on my end (nor am I really familiar with how that entire setup looks like), so I don't know how do the redirect URLs look like if one gets redirected to Play Store via Google Ads.

Is this something that you can test (Google Ads redirects) while testing with debug build of your app as well?

@levepic
Copy link

levepic commented Oct 21, 2024

I'll just release the new app with your module for all users of my "smaller" app and will see if it detect users coming from Google Ads. So that will be a live test, we will se if it works. There should be a "gclid" paramater in referrer if im right, or antyhing that differentiates these users from the others, i'll see if Ads provides anything unique in referrer.

@uerceg
Copy link
Owner

uerceg commented Oct 21, 2024

Sounds good and looking forward to hear about the results of the live test. 🤞

But in general, library itself is just a wrapper on to of native Android API for obtaining the referrer data. In case install referrer is not read properly, there can be two issues:

  1. There is something wrong with the library itself. If that's the case, one can attempt to simply use Android install referrer API natively directly and see if there's going to be any different if all this data is read natively.
  2. Whatever is doing the redirection to Play Store page of the app might be doing some funky stuff and not really setting the referrer parameter the way one would expect it to be set. I am personally not sure how one would run these tests, but in case there's a scenario where redirect can be triggered by interacting with some Google ad, it would be great if one would somehow be able to see the full redirect URL (either to capture it somehow from mobile browser, in case it was clicked on browser, or if this is happening in some social media apps or similar - maybe giving tools like Charles proxy a shot to see if they might be able to capture the redirect URL).

Good luck and looking forward to hearing back from you.

@levepic
Copy link

levepic commented Oct 22, 2024

I can confirm it works on the released app! When a user comes from Google Ads it receives glcId and additional parameters like this: "installReferrer":"gclid=Cj0KCQjw6o......_wcB&gbraid=0........Out&gad_source=3" I'll look into if I can identify the specific ad by the paramaters. The main thing is the module is good for indentifying users aquired through Google Ads. In my case its an app campaign so there is no webpage or utm parameters involved, it directs users to the Play Store, no additional setup was made just selected the app as target. The app has Firebase integrated for conversion metrics, Im not sure if these parameters are also received in case there is no Firebase integration.

@uerceg
Copy link
Owner

uerceg commented Oct 22, 2024

Great news. Thanks for letting us know, glad it worked for you.

Im not sure if these parameters are also received in case there is no Firebase integration.

It should be unrelated, meaning - those parameters should be there regardless of whether Firebase is integrated in the app or not. Content of the referrer parameter from redirect URL which advertised app is going to receive is affected by things outside of that app. Firebase being integrated into the app or not should make no difference.

@subhamPoulimaInfotech @shiftbrent Is there any progress on this topic on your end or are you still facing this issue?

@MuhammadAliGabol
Copy link

Open Testing

How did you get the refferrer id value with test environment, what's your test environment like how did you checked it?

My application is not on playstore yet, I want to verify this refferal module works or not. how can I test in dev mode?

@levepic
Copy link

levepic commented Oct 30, 2024

Open Testing is just like a released app, its not a test enviromnent, once you join open testing as a Play user, the Test version will be available for you on Play. So it is a live released app, reviewed by Play, available only for a limited group of users, but actually it works just like a fully released version, hidden from the majority of users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants