faqs | How to Fetch Device IDs

This document aims to help publishers working with InMobi via API or JS Ad tag integrations to fetch device IDs and pass them in runtime:

iOS

  • Step 1: Refer this document to obtain the user’s iOS advertising ID and ad tracking preference.
  • Step 2: Pass the IDFA and Limit Ad Tracking values to InMobi in the ad request.
Object / Parameter Type Parent Object Mandatory / Recommended Description
lmt integer device Mandatory with IDFA or GPID Limits Ad Tracking setting of the device. The value should be:

For Android:
1 - If the user has turned ON “Opt out of interest-based ads”
0 - If the user has turned OFF “Opt out of interest-based ads”

For iOS:
1 - If the user has turned ON “Limit Ad Tracking” switch on the device
0 - If the user has turned OFF “Limit Ad Tracking” switch on the device

Note: If absent, a value of 0 is assumed.

ifa string device Conditionally mandatory Identifiers for Advertisers on the iOS platform. They are mandatory if the app object is present in the request.

Note: If app object is present but request does not contain ifa (for iOS only), the request will be invalidated.

Android

  • Step 1: Refer this document to obtain the user’s Google advertising ID and ad tracking preference.
  • Step 2: Pass the GPID and Limit Ad Tracking values to InMobi in the ad request.
Object / Parameter Type Parent Object Mandatory / Recommended Description
lmt integer device Mandatory with IDFA or GPID Limits Ad Tracking setting of the device. The value should be:

For Android:
1 - If the user has turned ON “Opt out of interest-based ads”
0 - If the user has turned OFF “Opt out of interest-based ads”

For iOS:
1 - If the user has turned ON “Limit Ad Tracking” switch on the device
0 - If the user has turned OFF “Limit Ad Tracking” switch on the device

Note: If absent, a value of 0 is assumed.

gpId string device Conditionally mandatory Identifiers for advertisers on Android platform (where available). They are mandatory if the app object is present in the request.

Note: If app object is present but request does not contain gpId or o1 (for Android only), the request will be invalidated.