Last modified October 16, 2020 by Shelly Wolfe

How do I log advertising and vendor IDs?

As of December 2015, it is possible to log advertising and vendor identifiers. This article explains how to configure the iOS and Android SDKs to do so.

iOS

To log IDFA (Identifier for Advertisers), add a constant called SWRVE_LOG_IDFA to the preprocessor macros under App Target > Build Settings > Preprocessing > Preprocessor Macros. This logs a user property called swrve.IDFA to the Swrve system.

As of iOS 14, Apple requires user permission to collect the IDFA. If a user gives permission and SWRVE_LOG_IDFA is enabled, the SDK will continue to automatically collect the IDFA and send with device info updates.

To log IDFV (Identifier for Vendors), add a constant called SWRVE_LOG_IDFV to the preprocessor macros under App Target > Build Settings > Preprocessing > Preprocessor Macros. This logs a user property called swrve.IDFV to the Swrve system.

Android

To log GAID (Google Advertising ID), call method SwrveConfig.setGAIDLoggingEnabled(true) before creating the SDK instance. This logs a user property called swrve.GAID to the Swrve system.

To log the Google Android ID, call method SwrveConfig.setAndroidIdLoggingEnabled(true) before creating the SDK instance. This logs a user property called swrve.android_id to the Swrve system.