Enable Advertising Identifier Tracking

For accurate analytics around devices and tracking Re-installs, it is essential to track the Advertising Identifier.

Add Ad Identifier Library

Add the below dependency in the application level build.gradle file.

Groovy

    implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
    

To enable Advertising Identifier tracking use the enableAdIdTracking() method as shown below.

Dart

    import 'package:moengage_flutter/moengage_flutter.dart';
    
    final MoEngageFlutter _moengagePlugin = MoEngageFlutter(YOUR_APP_ID);
    _moengagePlugin.initialise();
    
    _moengagePlugin.enableAdIdTracking();
    

Before you enable Advertising Id tracking please ensure the application is complying with the Google Play Policy regarding Advertising Id tracking. Refer to our help document for more information on the policy.

 

In case, you need to disable advertising-id after enabling tracking use the following method.

Dart

    import 'package:moengage_flutter/moengage_flutter.dart';
    
    final MoEngageFlutter _moengagePlugin = MoEngageFlutter(YOUR_APP_ID);
    _moengagePlugin.initialise();
    
    _moengagePlugin.disableAdIdTracking();
    
 

The above APIs are available only starting plugin version 4.2.0. In the older versions, Advertising Identifier tracking is enabled by default.

Was this article helpful?
0 out of 0 found this helpful