Implementing the User Messaging Platform (UMP) for Google AdMob on iOS

Ben Bregman
4 min readNov 5, 2021

This is a semi-technical post collecting some pointers for implementing the User Messaging Platform (UMP) for Google AdMob on iOS.

Integrating Google AdMob itself is pretty straightforward — the Google QuickStart guide is helpful, and there are plenty of tutorials online as well (Medium Tutorial by Simon Ng). However, privacy updates and regulations in the past years mean that there are user dialogues you will need to incorporate to your AdMob implementation.

In this post, we’ll talk about (1) the opt-in AppTrackingTransparency dialogue on iOS 14, and (2) GDPR requirements from the EU around consent and disclosure for data usage. We’ll focus on using Google’s User Consent Messaging (UMP) framework to obtain and manage consent from users.

My usual disclosure: I am not a lawyer, and you should not consider this post to be legal advice. But hopefully, I can introduce you to some important topics that you’ll need to be aware of when implementing ads in your app.

Let’s start with a quick overview of three levels of data consent that can impact the ads that Google AdMob can show:

  1. Level 1 (EU only): No ads shown at all. A few basic permissions for data sharing are required for AdMob to load and render ads in your app. Without these permissions granted, Google AdMob will not show any ads.
  2. Level 2: Non-personalized ads. For users who are out of the EU, this is actually the default state before you have asked for user consent via the App Tracking Transparency dialogue.
  3. Level 3: Personalized ads. Once a user has consented to App Tracking Transparency dialogue, Google AdMob can share user information across apps to improve ad delivery. Note that if you are in the EU, there are additional personalization setting toggles in the GDPR dialogue.

Here is how some of these permissions play out in the UMP implementation:

  • A user in the EU will enter the app with the consentStatus state “required”. You must display the UMP GDPR form and get basic permissions from users before ever even being able to load and render ads. A user must at least (1) provide consent to “store and/or access information on a device”, (2a) provide consent to “select basic ads”, and (2b) provide legitimate interest to “select basic ads”. (Language taken from the UMP GDPR dialogue). These requirements are described here: Troubleshooting TCF.
  • Here’s where it gets a bit tricky: If a user has managed their options in that initial UMP dialogue and did not consent to the “Level 1” settings mentioned above, Google AdMob will simply fail to load ads. You can check in the UserDefaults to see whether this is the case, by referencing some the keys listed in this GitHub documentation. This is important to know, for example, if your app would otherwise require a subscription to enjoy an ad-free experience.
  • On the other hand, a user who is not in the EU will enter the app with the consentStatus state “notRequired.” You don’t necessarily need to show the AppTrackingTransparency dialogue before initializing AdMob and showing ads, but you may want to ask for permission in order to improve the quality of the ads. For EU users, the GDPR form triggers this request automatically after GDPR consent is granted; for non-EU users, you can trigger this request by showing the (non-GDPR) UMP form.
  • You can’t always show the iOS AppTrackingTransparency dialogue. There are two main cases where this happens: (1) you have already shown it once, or (2) the user has prevented apps from asking for data sharing via their iOS settings. This state is available via the ATTrackingManager. In cases like this, UMP will fail to create a user form (i.e. FormStatus after requestConsentInfoUpdate)… but only for non-EU users! That’s because UMP will still create a GDPR form for EU users. It is a little tricky that both the ever-present GDPR form and the sometimes-present ATT form are both generated by the UMPConsentForm.load function.
  • One final note: You probably want to have some easy places for a user to update their data privacy settings, especially if they are in a “Level 1" state (i.e. being unable to load Google AdMob ads). If a user is in the EU, you will always be able to generate a UMP form for them to make an update to their GDPR settings. AdMob doesn’t provide any user guidance around the required settings for now, so that would be up to you if you wanted to explain to users in an understandable way. For any users that may want to update their AppTrackingTransparency, you will need to direct them over to their iOS settings to update this.

Hope that helps clarify some of the steps involved in setting up AdMob and UMP with respect to GDPR and ATT. Good luck!

--

--

Ben Bregman

Violin teacher in Santa Cruz, CA. App developer as a hobby.