Skip to main content
Question

Incorrect AppsFlyer ID used in S2S purchase events (Android)

  • January 30, 2026
  • 1 reply
  • 16 views

Forum|alt.badge.img

Hello RevenueCat Support Team,

We are investigating an attribution issue related to AppsFlyer integration on Android and would appreciate your assistance.

Context
In some cases, purchase events (af_purchase) sent to AppsFlyer via S2S are attributed to an old appsflyer_id, which appears to belong to a previous installation of the app. According to AppsFlyer documentation, a new appsflyer_id should be generated on every fresh install.

AppsFlyer support confirmed that these purchase events are received via S2S and advised us to ensure that the latest appsflyer_id is correctly extracted from the AppsFlyer SDK and used in the S2S request.

Our implementation

  • We obtain the AppsFlyer ID via:
    AppsFlyer.getAppsFlyerId()

  • We pass it to RevenueCat after SDK initialization using:
    purchases.SetAppsflyerID(AppsFlyer.getAppsFlyerId());

  • RevenueCat then forwards purchase events to AppsFlyer via S2S.

 

Questions

  1. Does RevenueCat update the AppsFlyer ID used for S2S events, or is the first provided value persisted?

  2. Are there any known edge cases where RevenueCat might continue using a previously provided AppsFlyer ID after an app reinstall?

  3. Do you have recommended best practices for the timing of SetAppsflyerID() relative to AppsFlyer SDK initialization and attribution callbacks?

We are currently validating our lifecycle and timing on the client side, but want to ensure our integration aligns with RevenueCat’s expected behavior.

Thank you in advance for your guidance.

1 reply

Forum|alt.badge.img

I received an email response from RevenueCat support, and I have no further questions.
Here's the response below.
 =======================================================================
Once attribution Customer Attributes are set for a particular App User ID, their value cannot be changed. More information is available in our Customer Attributes documentation:
 

📘ATTRIBUTION DATA

If you have access to install attribution data, you can set it using the reserved keys above. RevenueCat itself is not an attribution network and can not automatically populate this information.

Once attribution data is set for a subscriber, it can't be changed. This way attribution data can be associated with the original installation without getting overwritten.

Source: https://www.revenuecat.com/docs/customers/customer-attributes#attribution-data
 

  1. RevenueCat will continue to use the original AppsFlyer ID set for the user when sending events to AppsFlyer.
  2. If the app reinstall results in a fresh App User ID being used with the RevenueCat SDK, then a new AppsFlyer ID can be set (as this will be the first time the attribute is set for the user). If the reinstall results in an existing App User ID being used, and that App User ID has an existing AppsFlyer ID set, then the existing value will continue to be used.
  3. I'd recommend calling SetAppsflyerID as soon as both the RevenueCat SDK and AppsFlyer SDKs are initialized. Setting the AppsFlyer ID prior to the user making a purchase will ensure that the purchase event is dispatched to AppsFlyer.