Accessing the Advertising ID on Google and iOS Devices

Santiago Petrone
applike
Published in
2 min readFeb 26, 2019

Problem?

Hard to believe, but by the time we wrote this publication we couldn’t find a library or external module that allows us at AppLike to access the Advertising Id from both Android and iOS platforms in a consistent way.

AppLike is a direct user acquisition platform, i.e. we run our own apps worldwide and sell traffic from those apps, acquiring millions of users for our apps every month. On a daily base, we make use of the Advertising ID which is shared between our business partners in order to keep track of the user itself.

What is an Advertising ID?

According to the Interactive Advertising Bureau (IAB)

Advertising ID is a user resettable ID assigned by the device or operating environment for advertising purposes (e.g. targeting, frequency capping). The key difference between a Device ID and an Advertising ID is that advertising IDs can be reset by the user at any time. Examples include Apple’s IDFA and Android’s AAID.

In mobile applications, there are no cookies. So in order to track user’s activity for marketing purposes developers and marketers can rely on these user-resettable identifiers. Under normal circumstances, these are provided by mobile device’s operating systems, like Google (Google Advertising ID aka GAID or AdID) and Apple (Identifier for Advertiser aka IDFA).

By accessing these mobile advertising IDs, companies like us are able to track user's activity in one application, share it with their partners and create a better advertising experience for the user.

Solution!

So we decided to build our own library that allows us to access the Advertising Id on android and iOS platforms and open source it for everyone to access, consume and collaborate as they feel like.

For consistency purposes, we've designed a unique interface to be applied on both platforms: react-native-advertising-id is an ES6 module that exposes a method called getAdvertisingId().

When invoked, a Promise will be obtained. Once resolved, an object will be obtained as follows:

{
advertisingId: "0f5d9fb0-807a-4126-a156-4fc8a13fe03c",
isLimitAdTrackingEnabled: false,
}

advertisingId contains the value of the Google Advertising Id (GAID) / Android Advertising ID (AAID) or Apple's Advertising Identifier (IDFA).

isLimitAdTrackingEnabled is a boolean value that reflects the choice of the user to limit usage of his Id to build profiles or get personalised ads. (When enabled for iOS, advertisingId will be an empty string).

Go Public

Finally, this entire solution has been packed in the form of a public npm package and its source code is available on Github to the public.

Now projects that requires access to Advertising Id can easily access it, in a consistent way, for both Android and iOS.

Got until here and would love to work with us on the next big mobile challenges? Check our open positions or drop us a line at jobs@applike.info

--

--