Skip to content

Advertising module

Artifact: com.affise:module-advertising (module-advertising/build.gradle:53).

implementation("com.affise:module-advertising:1.7.16")

For module Advertising to send GAID (Google Advertising ID). Uses com.google.android.gms:play-services-ads-identifier.

Entry class: AdvertisingModule : AffiseModule(), AdvertisingApi (module-advertising/src/main/java/com/affise/attribution/module/advertising/AdvertisingModule.kt:19).

Public API: AdvertisingApi.getAdvertisingId(): String? (attribution/src/main/java/com/affise/attribution/modules/advertising/AdvertisingApi.kt:5-7).

Typical usage via Affise.getProviders():

val gaid = Affise.getProviders()[ProviderType.GAID_ADID] as? String

module-advertising/build.gradle:38:

implementation "com.google.android.gms:play-services-ads-identifier:18.2.0"

No extra AndroidManifest.xml additions beyond the core attribution module.

AdvertisingModule.kt:59-69: GAID_ADID, GAID_ADID_MD5, AD_PERSONALIZATION, ADVERTISER_TRACKING_ENABLED, APPLICATION_TRACKING_ENABLED, plus empty-string placeholders for ADID, ALTSTR_ADID, FIREOS_ADID, COLOROS_ADID.

ADVERTISER_TRACKING_ENABLED and APPLICATION_TRACKING_ENABLED (since 1.7.9) are booleans: true when the user has not limited ad tracking (!isLimitAdTrackingEnabled), false when tracking is limited or the Google advertising info is unavailable. On Android both providers report the same value.

See Device info for the full provider map.