How to get Google Advertisement ID in Ionic3

#1

Hi we tried to get Advertisement ID using ionic3 application.We added plugin

cordova plugin add cordova-plugin-idfa --save

We tried like this

cordova.plugins.idfa.getInfo().then(function(info) {
if (!info.limitAdTracking) {
console.log(‘OK getting ID**********’+info.idfa || info.aaid);
}
});

and

window.cordova.plugins.idfa.getInfo().then(function(info) {
if (!info.limitAdTracking) {
console.log(‘OK getting ID**********’+info.idfa || info.aaid);
}
});

both not working please guide me what we need do .is there any other option to get Google_Advertisement ID.