Skip to content

DMA🔗

Due to the release of DMA, large digital companies (gatekeepers) need to obtain explicit permissions from users to work with user IDs. Permissions are collected using special CMP (consent management platform) services. For example, Didomi

For Google, collecting these permissions is transferred to the project. Other large companies (Meta and others) take on this collection. Thus, these changes primarily concern working with Google. If these changes are not implemented, then after some time, attribution from Google will be disabled.

It is important that for some time, Google attribution will work for old versions of the AF SDK (Google will give attribution for those users who have allowed working with their id). But it must be implemented quickly, there are no guarantees and this opportunity may disappear at any time.

Key points and recommendations

  • Obtaining permissions has already been implemented through CMP. If it already makes a request via TCF 2.2, then you don't need to implement anything additionally.
  • We recommend making permission requests (CMP call) at the launch itself. Without permission, AF SDK will not initialize and as a result will not see the installation and will not be able to make attribution.
  • We recommend implementing a "flag" in the project to enable support for this mechanism, which can be turned on/off from the server side in case any bugs/problems arise.
  • Use library versions:
    • AF SDK >= 6.14.0
    • Firebase Unity >= 11.9.0
    • MRGS >= 6.17.0

Integration🔗

Update SDK to the versions recommended above

AppsFlyer🔗

The MRGSAnalytics module is required. When initializing MRGS, you need to set the WaitForTCF flag in the AppsFlyer parameters - the time in seconds after which AppsFlyer will be launched without waiting for a response from the CMP. The recommended value is 5 minutes (300 seconds). In this mode, MRGS will wait for the user's decision, and upon receiving it, it will transmit the information to AppsFlyer and call the start.

using MRGS;

public class MasterController : MonoBehaviour
{
    void Awake()
    {
        // Setting up MRGS parameters
        // ...

        var sdkParams = new MRGSExternalSDKParams
        {
            // ...
            // For Android, you can specify an empty string instead of APPLE_APP_ID
            AppsFlyerParams = new MRGSAppsFlyerParams(APPS_FLYER_DEVKEY, APPLE_APP_ID)
            {
                Debug = false
                WaitForTCF = 300
            }
            // ...
        };

        // Configuring External SDKs and initializing MRGS
        // ...

        MRGService.Instance.Initialize(serviceParams, sdkParams);
    }
}
@import MRGService;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //Setting up MRGS parameters
    // ...
    //Setting up external SDKs

    MRGSAppsFlyerParams *appsFlyerParams = [[MRGSAppsFlyerParams alloc] initWithDevKey:<APPS_FLYER_DEVKEY> appleAppId:<APPLE_APP_ID>];
    appsFlyerParams.waitForTCF = 300

    NSArray *externalParams = @[ ..., appsFlyerParams];
    [MRGService startWithServiceParams:<params> externalSDKParams:externalParams delegate:nil];
}
import games.my.mrgs.MRGSExternalSDKParams;
import games.my.mrgs.MRGSExternalSDKParams.AppsFlyerParams;
import games.my.mrgs.MRGService;
import games.my.mrgs.MRGServiceParams;

public class YourApplicationClass extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        // Setting MRGService
        final MRGServiceParams serviceParams = ...;
        // Setting External SDKs
        final AppsFlyerParams appsFlyerParams = AppsFlyerParams.init("<APPS_FLYER_DEVKEY>");
        appsFlyerParams.setDebuggable(false);
        appsFlyerParams.setWaitForTCF(300);

        final MRGSExternalSDKParams externalSDKParams = MRGSExternalSDKParams.newInstance();
        externalSDKParams.appsFlyerParams = appsFlyerParams;

        MRGService.service(context, serviceParams, externalSDKParams);
    }
}

It is important that when receiving a response from CMP and on subsequent launches, AppsFlyer will launch without this timeout

If there is MRGSDidomi🔗

After receiving a response from Didomi, MRGS will automatically pass the result to MRGSAppsFlyer, nothing needs to be done.

If there is no MRGSDidomi🔗

After the CMP has worked (the user accepted/the user does not get/etc - that is, when all SDKs are already starting) - call the MRGSAppsFlyer method onCMPConsentCollectionFinished (if there is no CMP, then you need to do the same, but only manually using setConsent)

Firebase🔗

The MRGSFirebase module is NOT required

If MRGSDidomi is present🔗

  • The EnableFirebaseConsentSetting flag must be set to true
MRGSDidomi.Instance.EnableFirebaseConsentSetting = true;
[MRGSDidomi sharedInstance].enableFirebaseConsentSetting = true;
MRGSDidomi.getInstance().enableFirebaseConsentSetting(true);

After that, when receiving a consent from Didomi, MRGS will pass it to Firebase.setConsent

  • Add the flag of delayed firebase start FIREBASE_ANALYTICS_COLLECTION_ENABLED/firebase_analytics_collection_enabled to the plist/manifest of the application. More details here.

If there is no MRGSDidomi🔗

There is no support for this case, you need to implement it yourself

Events🔗

When AppsFlyer starts with consent from CMP, MRGS will send an event mrgs_dma_start to AppsFlyer with the parameters:

If started from CMP:
"tcfString"

If started with manual consent:
"isUserSubjectToGDPR"
"dataUsage"
"adsPersonalization"

Last update: 2024-10-22
Created: 2024-08-29