6

I am trying to test my GDPR compliance code and trying to display the consent form for AdMob but I get this error:

Consent info update failed. Error: Error Domain=Consent Code=1 "Response error. Publisher identifiers not found: ca-app-pub-0123456789012345"

I have triple checked, my publisherID is correct, it is something like "pub-0123456789012345".

When I check my AdMob account status I see that

"Your account is active and in good standing."

I have followed the directions of Google to receive user consent for personalized ads. I am in the USA, so use this line:

PACConsentInformation.sharedInstance.debugGeography = .EEA

When I disable this line, I don't get the error above anymore, but the error below:

Error loading form: Error: request is not in EEA or unknown.

I have tried to use this line instead but nothing changed:

PACConsentInformation.sharedInstance.debugGeography = PACDebugGeography.EEA

My only guess is that for the reason that my AdMob account is USA based, I get "publisherID not found" error when I enable ".EEA". But how can I do the testing if my guess is true?

I am doing the testing both on simulator and on the phone. I could not manage to display the consent form anywhere.

The code I am using is below:

    // advertiseIDOfPhone and publisherID are constants defined elsewhere
   
    PACConsentInformation.sharedInstance.debugIdentifiers = [advertiseIDOfPhone]
    PACConsentInformation.sharedInstance.debugGeography = .EEA
    
    PACConsentInformation.sharedInstance.requestConsentInfoUpdate(forPublisherIdentifiers: [publisherID])
    {(_ error: Error?) -> Void in
      if let error = error {
        // Consent info update failed.
        print("☢️ Consent info update failed. Error: \(error)")
      } else {
        print("☢️ Consent info updated.")
        // Consent info update succeeded. The shared PACConsentInformation
        // instance has been updated.
        switch PACConsentInformation.sharedInstance.consentStatus {
        case .nonPersonalized:
            print("☢️ Personalized ads consent NOT given.")
        case .personalized:
            print("☢️ Personalized ads consent given.")
        case .unknown:
            print("☢️ Unknown consent.")
            guard let privacyUrl = URL(string: "yourWebsiteURL"),
                let form = PACConsentForm(applicationPrivacyPolicyURL: privacyUrl) else {
                    print("incorrect privacy URL.")
                    return
            }
            form.shouldOfferPersonalizedAds = true
            form.shouldOfferNonPersonalizedAds = true
            form.shouldOfferAdFree = true
            form.load {(_ error: Error?) -> Void in
                print("⚛️ Load complete.")
                if let error = error {
                    // Handle error.
                    print("⚛️ Error loading form: \(error.localizedDescription)")
                } else {
                    
                    form.present(from: self) { (error, userPrefersAdFree) in
                        
                        if error != nil {
                            // Handle error.
                        } else if userPrefersAdFree {
                            // User prefers to use a paid version of the app.
                            
                            
                            //buy the pro Version
                        }
                    }
                }
            }
        default:
            break
        }
        print("☢️ isRequestLocationInEEAOrUnknown: \(PACConsentInformation.sharedInstance.isRequestLocationInEEAOrUnknown)")
        }
      }

Where can be my mistake here? Is the code I am using good?

--

It seems that this is a known bug:

Kindly note that we are aware of this issue, and our Engineering team is already working on a resolution. Rest assured that we are keeping an eye out on this, and that we will update you for any news regarding this issue.

Regards, Ziv Yves Sanchez Mobile Ads SDK Team

I didn't expect a bug from Google in such a fundamental aspect of a big product and unfortunately I have spent hours on this problem trying to find my mistake somewhere...

2
  • Apparently, this bug is still very much alive. Have you ever found a solution?
    – SirEnder
    Sep 10, 2020 at 21:20
  • @SirEnder No, unfortunately.
    – Luke
    Sep 12, 2020 at 7:00

3 Answers 3

1

While they work on a resolution, you can use the Google Test Publisher ID:

pub-3940256099942544

My account gives me the error but I was able to use the test ID to implement and test the Consent SDK. Just make sure you switch back to your ID before you distribute the app.

1
  • I'm not sure. But I believe it started working for me when I double checked and fixed GADApplicationIdentifier in Info.plist. Had a typo.
    – PhilModin
    Oct 24, 2020 at 8:19
1

I got the Same Issue! This is not our Code's fault. Admob not serving ads.

  1. Go to Admob Console
  2. In Home There is Dialog Box: "Don't serve Until PaymentDetails Entered"
  3. Click the Learn more and create an AdSense account
  4. after that enter payment details

That's all they will serve ads after 24 hours after the account verified

0

I have the same issue.
Until I updated my settings on https://fundingchoices.google.com.
Go to the webpage, select APP on the left side, go in and activate the app you are using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.