Skip to content

Advertising module

From JSDoc on AffiseAdvertising (src/module/advertising/AffiseAdvertising.ts:7):

iOS only / Start Advertising module

iOS only. Advertising Module starting Manually.

The Android side of the module reads Google Advertising ID automatically via the corresponding native artifact.

  • AffiseModules.ADVERTISING = "Advertising" (src/module/AffiseModules.ts:1-16)

AffiseAdvertising (src/module/advertising/AffiseAdvertising.ts:7) implements AffiseModuleAdvertisingApi (src/module/advertising/AffiseModuleAdvertisingApi.ts:3):

Affise.module.advertising.startModule(): void
// AffiseModuleAdvertisingApi.ts:3-9
Affise.module.advertising.hasModule(): Promise<boolean>

Since 1.7.16 the module ships as its own npm package, affise-attribution-module-advertising (Android and iOS). Install it next to the core library:

Terminal window
npm install affise-attribution-lib
npm install affise-attribution-module-advertising

The package only pulls in the native dependency (com.affise:module-advertising / AffiseModule/Advertising at 1.7.16); its JS entry point is empty, so keep importing everything from affise-attribution-lib. Rebuild the native app (and run pod install on iOS) after installing.

Affise.module.advertising.startModule()

Add the iOS subspec to your Podfile:

pod 'AffiseModule/Advertising', '1.7.16'

The Affise Advertising module uses the AppTrackingTransparency framework to read advertisingIdentifier.

Install the Maven artifact:

implementation "com.affise:module-advertising:$affise_version"

Automatic per README: “Advertising Identifier (google) tracking is supported automatically, no actions needed”.

From src/parameters/ProviderType.ts:96-106:

  • GAID_ADID
  • GAID_ADID_MD5
  • OAID
  • OAID_MD5
  • ADID
  • ALTSTR_ADID
  • FIREOS_ADID
  • COLOROS_ADID
  • AD_PERSONALIZATION (since 1.7.9)
  • ADVERTISER_TRACKING_ENABLED (since 1.7.9)
  • APPLICATION_TRACKING_ENABLED (since 1.7.9)