Hi Team, Actually i am not able to see advertiseme...
# support
l
Hi Team, Actually i am not able to see advertisementId in device object of rudderstack events (I am trying to integrate AppsFlyer with rudderstack). I am sure its getting generated coz i can see it in traits in rudderstack. This works fine for android .May i know what could be the reason for this
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Sheshahayan, you are trying to send event from your Android/iOS source to Appsflier. You are unable to see the advertisementId for iOS devices in the destination while it appears correctly for Android devices. Is that correct? Also can you provide the destinationId? (You should be able to find it in the settings tab in the destination)
l
Yes, that's correct. Essentially, it's a React Native project. I'm confident that the advertisementId is sent correctly for both Android and iOS. However, when inspecting the iOS device rudderstack object (below), you'll notice that there is no advertisementId present, although it can be found in the traits object. (In case of android it is present in advertisement Id)
{
"anonymousId": "91a946c6-2bbc-47ea-ab28-f0fecee41562", "channel": "mobile", "context": { "app": { "build": "1", "name": "YaraConnect", "namespace": "com.yara.connect.dev", "version": "1.0" }, "device": { "attTrackingStatus": 0, "id": "eaf27cdb-64e4-4e39-a69a-980101ae3e9e", "manufacturer": "Apple", "model": "iPhone", "name": "iPhone 14 Pro", "type": "iOS" }, "library": { "name": "rudder-ios-library", "version": "1.24.1" }, "locale": "en-US", "network": { "cellular": false, "wifi": true }, "os": { "name": "iOS", "version": "16.4" }, "screen": { "density": 3, "height": 852, "width": 393 }, "sessionId": 1709893697, "timezone": "Asia/Kolkata", "traits": { "AdvertisingId": "00000000-0000-0000-0000-000000000000", "AppsFlyerUID": "1709893655029-2764443", "anonymousId": "91a946c6-2bbc-47ea-ab28-f0fecee41562", "balance": 848, "language": "English", "phone": "+915555511016", "userId": "bb90d36a-63e0-477b-ac12-1ac2af292bb8" } }, "event": "a_EarnPoints_ScanQRScreen_back", "integrations": { "All": true }, "messageId": "6d3580c1-f5c9-4ecf-a552-28ad15efcb92", "originalTimestamp": "2024-03-08T165638.526Z", "properties": { "auth0Id": "sms|647ed8ab450917dcaf6ee328", "cms_state": "", "country": "India", "deviceId": "iPhone15,2", "language": "en", "operatingsystem": "iOS", "source": "p_EarnPoints_ScanQRScreen_default", "sourceAction": "a_EarnPoints_ScanQRScreen_back", "userFirstLevelLocation": "Karnataka", "userId": "bb90d36a-63e0-477b-ac12-1ac2af292bb8", "userType": "retailer" }, "rudderId": "1a932a19-cd96-4070-a2a0-45513a33dc86", "sentAt": "2024-03-08T165639.487Z", "type": "track", "userId": "bb90d36a-63e0-477b-ac12-1ac2af292bb8" } DESTINATION ID 2NugE1VJ8WVVhtQ4Xr43NXpqWwS (Appsflyer Destination Id)
m
Hi Sheshashayan, So RudderStack maps the following for iOS idfa -> advertisingId (context.device.advertisingId) and idfv -> id (context.device.id). Also the React-native source sets the advertisingId for both Android and iOS. Since the context.device.advertisingId is null, the idfa is not being set. However, the AdvertisingId property in traits seems to be set by your team. Are you seeing this value change or is it always "00000000-0000-0000-0000-000000000000". If you are seeing the advertisingId missing for only select users it may be due to iOS blocking it based on your setting. See doc below https://www.linkedin.com/pulse/how-stop-ad-tracking-iphone-david-schunk-tmjqe/?trk=article-ssr-frontend-pulse_more-articles_related-content-card
l
Hi @shy-kite-21035, The Advertising ID we obtain from the traits object is correct. When pasted from the simulator response, it appears as zeros; however, on a physical device, it's a random number, which is correct. (that part is fine) The concern now is whether it is necessary or mandatory to retrieve the Advertising ID inside the device object. If it is mandatory, what might I be missing?
I am sure Advertising ID is collected properly and sent via rudderClient.putAdvertisingId( )
async componentDidMount() {
const updateInfo = await codePush.getUpdateMetadata()
AppState.addEventListener('change',this.handleAppStateChange)
if (updateInfo) {
Sentry.setRelease(updateInfo.appVersion + '-codepush:' + updateInfo.label)
}
await new Promise (resolve => setTimeout(resolve,30000))
const data = await this.getAdvertisingId() /* get advertising Id */
if (!data?.isAdTrackingLimited) rudderClient.putAdvertisingId(data?.id)  /* using putAdvertisingId before setUp()*/
rudderStackCDP.setUp()
const storageData = await Storage._retrieveData(Storage.keys.attributionIdentifyFields)
logger.info('storageData',storageData)
let check =  await Storage._storeData(Storage.keys.attributionIdentifyFields, {
...storageData,
AdvertisingId: data?.id
})
logger.info('check',check)
getAppsFlyerID()
const appsflyerInstallData = getInstallConversionData()
const deeplinkreceived = getDeeplinkListener()
initializeAppsflyer()
}
Let me know if any findings
s
So if you have the correct AdvertisingId, then the simpleat way to add it to the device object would be through a user transformation. Once the advertisingId is added to the device object it will be picked up and sent to the destination correctly. This should unblock you for now. However, we need to check why Rudderstack is unable to pick up the advertisingId directly from the device.
l
I didn't quite understand (I'm relatively new to RudderStack). What is a user transformation, and where can I find information about it? Any documentation links to help me understand better? So, is it acceptable if we retrieve the Advertising ID from the traits object?
However, we need to check why Rudderstack is unable to pick up the advertisingId directly from the device. ---> This even i am not sure. Is there any manual way to push...?
m
So, is it acceptable if we retrieve the Advertising ID from the traits object?
Yes
Any documentation links to help me understand better?
Will share some docs and the actual User transformation shortly.
However, we need to check why Rudderstack is unable to pick up the advertisingId directly from the device. ---> This even i am not sure. Is there any manual way to push...?
Yes. There is a way to push, but before that I have a question You are using the same data.id in both the places `rudderClient.putAdvertisingId(data?.id)`⁣ and `AdvertisingId: data?.id`⁣ So setting this correctly should populate the adverstingId in the context. However, I am not sure what does `!data.isAdTrackingLimited`⁣ do
l
rudderClient.putAdvertisingId(data?.id) ----> This is correct because when we request for advertisingID using ReactNativeIdfaAaid we get the result in object format something like {isAdTrackingLimited : false, id : "13435653647478" }. we are extracting id from data object.
m
Yes but the isAdTrackingLimited is the user defined permission to track . So if the isAdTrackingLimited is set to true, are to allowed to capture the advertisingId. Should you not be using the isAdTrackingLimited boolean logic while sending the AdvertisingId in the traits as well?
Actually do you want to jump into a call to clarify this?
l
Yes plz
l
joined
m
Raised a ticket for this. Seems to be a bug on our side
l
Thank you so much