How to get Google Advertisement ID in Ionic?

I installed Ionic Google Analytics plugins in my app.I did’t find any function in the Google Analytics to get the Google Advertisement ID .Please help me

There is probably a Cordova Plugin (and maybe matching Ionic Native plugin wrapper for easier usage) that can return this data.

:grinning:Solved
Install: cordova-plugin-android-idfa
add these line in app.component.ts

declare var androidIDFA;

@Component({
  templateUrl: 'app.html',
})
export class MyApp {
googleAddId:any;
........................
.......................


if (this.platform.is('cordova')) {
    androidIDFA. getAdId(
      (addId) => {
        console.log(addId);
        this.googleAddId=addId.adId;
      },
      (e) => {
        console.log(e);
       //This error message not works on Desktops
      }
    );
  }
..............................
}

Tq Sujan
I found the Plugins
cordova-plugin-android-idfa

1 Like

@y12ec3231 tried as you said.am getting issue
androidIDFA is not defined .Please guide me what we miss here