Manually configure project

We have created a script that performs all the steps below automatically for you. Learn how to invoke automatic configuration on the Project Setup page.

AdAttributionKit and SKAdNetwork Support

Read more on Apple Ad Attribution page.

App Transport Security

App Transport Security (ATS) is a privacy feature introduced in iOS 9. It's enabled by default for new apps and enforces secure connections.
To ensure your ads are not impacted by ATS, add the NSAllowsArbitraryLoads exception to disable ATS restrictions:

KeyTypeValue
Information Property ListDictionary
▼ App Transport Security SettingsDictionary
- Allow Arbitrary LoadsBooleanYES

Or, open plist as source code:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Make sure that your info.plist does not contain any other exceptions besides NSAllowsArbitraryLoads, as this might create a conflict.

Link the project

To link your project with the mediation settings, you need to have a registered account and an application in the CAS system.

If you haven't created an CAS account and registered the app yet, now's a great time to do so.
If you just want to experiment or test the SDK, you can skip link your project.

  1. Sign In https://cleveradssolutions.com.
  2. Select the Applications section on the right panel.
  3. Click the plus(+) button and follow the instructions on the form. It may take up to 30 minutes to register the app in the CAS system.
  4. After the registration completed, click the Action button in the row of your application
dashboardcasapps

CAS uses a mediation configuration caching system to handle unexpected situations.

  1. Click Download CAS settings button.
  2. A cas_settings[settings_id].json file will be downloaded.
  3. Move your config file into the root of your Xcode project.
  4. If prompted, select to add the config file to all targets.

Add Google Ads App ID

CAS assigns a new AdMob App ID for your application to the correct operation of all features.

You cannot use your own identifier and must replace it with a new one generated by CAS system.

You can find your Admob App ID in the CAS UI:

  1. Click the Show AdMob App ID button.
  2. Copy the id from the form.
  3. Add a GADApplicationIdentifier key to your app's Info.plist file.
  4. Insert AdMob app ID to <string>, as shown below.
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~1458002511 -->
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Or, edit it in the property list editor:

KeyTypeValue
Information Property ListDictionary
▼ GADApplicationIdentifierStringca-app-pub-3940256099942544~1458002511

In a real app, replace the sample app ID with your actual AdMob app ID. You can use the sample ID if you're just experimenting with the SDK in a Hello World app.

Also, note that failure to add the <meta-data> tag exactly as shown results in a crash with the message: Missing application ID

Delay app measurement

By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to Google immediately when the app starts. This initialization behavior ensures you can enable AdMob user metrics without making additional code changes.

However, if your app requires user consent before these events can be sent, you can delay app measurement until CAS explicitly initialize the Google Mobile Ads SDK.

To delay app measurement, add the GADDelayAppMeasurementInit key with a boolean value of YES to your app’s Info.plist. You can make this change programmatically:

<key>GADDelayAppMeasurementInit</key>
<true/>

Or, edit it in the property list editor:

KeyTypeValue
Information Property ListDictionary
▼ GADDelayAppMeasurementInitBooleanYES