πŸ€‘AdMob Integration Guide

Natively integrates with Google AdMob to help you monetize your iOS and Android applications through high-quality advertisements. This guide covers the end-to-end process of setting up AdMob, configuring the Natively wrapper, and implementing ads via Bubble.io or the JavaScript SDK.

Currently, Natively supports Banner and Interstitial ad formats.

Prerequisites

  • A Google AdMob account.

  • A Natively account with an active app project.

Google AdMob Configuration

You must register your applications in the AdMob console to generate the necessary App IDs.

Create App in AdMob

  1. Navigate to Apps and click Add Your First App (or Add App if you have existing ones).

  2. Select the Platform (iOS or Android).

    • Note: If you are building for both platforms, you must repeat this process to create two separate apps in AdMob.

  3. Is the app listed on a supported app store?

    • Yes: Search for your app and click Add.

    • No: Select No, enter your App Name, and click Add App.

Retrieve App ID

Once the app is created, you need the App ID to link it with Natively.

  1. Go to Apps > View All Apps.

  2. Locate your newly created app.

  3. Copy the App ID (it starts with ca-app...).

View AdMob's full setup guide here: Setup Admob Apparrow-up-right

Natively Dashboard Setup

You must link your AdMob App IDs to your Natively project and rebuild the app.

  • Open your Natively App Dashboard.

  • Navigate to Features > AdMob and toggle the feature to Enabled.

  • Paste the App IDs you copied in the AdMob dashboard into the respective fields:

    • iOS App ID

    • Android App ID

  • Enter a Permission Description. This text explains to the user why the app requests tracking permissions (App Tracking Transparency). Failure to provide a clear description may result in App Store rejection.

  • Order a new build. The AdMob SDK and keys are injected into your app bundle during the build process.

Implementation

Choose your integration method below: Bubble.io Plugin (No-Code) or JavaScript SDK (Code).

Inizialization

Check Plugin

Before starting, verify if the Natively plugin is already installed in your Bubble project.

  1. Open your Bubble editor and navigate to the Plugins tab in the left sidebar.

  2. Check Installed Plugins: Look through your list of installed plugins for "Natively iOS & Android app builder".

    • If it IS installed: Check the version number. If an update is available (e.g., you see a button saying "Update"), click it to ensure you have the latest features and bug fixes.

    • If it is NOT installed: Click the + Add plugins button , search for "Natively", and click Install.

  1. Drag the Natively - Banner element onto your page.

  2. Configure the following fields in the property editor:

    • iOS UnitId: Test unitId 'ca-app-pub-3940256099942544/2934735716' or your own.

    • Android UnitId: Test unitId 'ca-app-pub-3940256099942544/6300978111' or your own.

    • Position: TOP, BOTTOM.

    • Size Type: AUTO, CUSTOM.

    • Banner Width: Will be applied only when Size Type is CUSTOM.

    • Banner Height: Will be applied only when Size Type is CUSTOM.

    • Preload Ad on Initialize: Load ad on initialization.

    • Show Ad on Initialize: Display ad on initialization.

  1. Element Logic (Events, States, & Actions)

Use the following data points to build your ad logic.

  • Events:

    • Did finish setup: When the banner has finished setting up and is ready to load an ad.

    • Did load ad: When ad loading is finished and the banner is ready to be displayed (called after 'Load Ad' action).

    • Did fail to receive ad: When loading the ad failed (can occur after 'Load Ad' action).

    • Did record click: When the user clicks on the banner.

    • Did record impression: When the user sees the ad.

    • Did show banner: When the banner is successfully shown.

    • Did hide banner: When the banner is successfully hidden.

  • States:

    • Banner Is Ready: (Yes/No)

    • Banner Is Visible: (Yes/No)

    • Ad Is Loaded: (Yes/No)

    • Latest Error Message: Text description of the last error.

    • Latest Event: Returns the specific event code received from the app:

      • DID_FINISH_SETUP

      • DID_SHOW_BANNER

      • DID_HIDE_BANNER

      • DID_LOAD_AD

      • DID_RECORD_CLICK

      • DID_FAIL_TO_RECEIVE_AD

      • DID_RECORD_IMPRESSION

      • Actions:

        • Show Banner: Displays the banner on the screen.

        • Hide Banner: Removes the banner from the screen.

        • Load Ad: Manually fetches a new ad.

        • Check Banner Visible: Refreshes the Banner Is Visible state.

        • Check Banner Ready: Refreshes the Banner Is Ready state. Checks if the banner is ready to load the ad.

      How to Use (Workflow Logic) Automatic Setup: The Banner element sets itself up automatically on page load.

      1. Manual Loading (If 'Preload Ad' is disabled):

        • Create a workflow for the event Did finish setup.

        • Add the action Load Ad.

      2. Manual Showing (If 'Show Ad' is disabled):

        • Create a workflow for the event Did load ad.

        • Add the action Show Banner.

Interstitial Ads

  1. Drag the Natively - Interstitial element onto your page.

  2. Configure the following fields in the property editor:

    • iOS UnitId: Test unitId 'ca-app-pub-3940256099942544/2934735716' or your own.

    • Android UnitId: Test unitId 'ca-app-pub-3940256099942544/6300978111' or your own.

    • Auto Ad Reload: Automatically load new ad after 'Did dismiss ad' event. You will be notified once it's ready with 'Did load ad' event.

  3. Element Logic (Events, States, & Actions)

    Use the following data points to build your ad logic.

    • Events:

      • Did Load Ad: When the ad view has finished setup and is ready to be displayed.

      • Did record click: When the user clicks on the ad.

      • Did fail to present: When presenting the ad failed (can be fired after 'Show Ad' action).

      • Did fail to load ad: When loading the ad failed (can be fired after 'Load Ad' action).

      • Did show ad: When the ad view is displayed to the user.

      • Did dismiss ad: When the user dismisses (closes) the ad view.

      • Did record impression: When the user saw the ad.

    • States:

      • Interstitial Is Ready: When the ad view is ready to be displayed.

      • Latest Error Message

      • Latest Event: The latest event received from the app:

        • DID_FAIL_TO_LOAD_AD

        • DID_LOAD_AD

        • DID_SHOW_AD

        • DID_RECORD_CLICK

        • DID_FAIL_TO_PRESENT

        • DID_DISMISS_AD

        • DID_RECORD_IMPRESSION

    • Actions:

      • Show Ad: Displays the interstitial ad.

      • Load Ad: Loads a new ad manually.

      • Check Interstitial Ready: Checks if the ad view is active and can be displayed.

    How to Use (Workflow Logic)

    The Interstitial will set up automatically on page load.

    1. Show Ad: Run the Show Ad action when you want to display it.

    2. Reloading Strategy:

      • After each time the ad is shown, a new ad must be fetched.

      • If 'Auto Ad Reload' is enabled: This happens automatically. You will be notified via the Did Load Ad event.

      • If 'Auto Ad Reload' is disabled: Listen to the Did dismiss ad event and call the Load Ad action manually.

Testing & Release

Testing with Test Devices

Never click your own live ads, as this violates AdMob policy. Always use Test Devices and Test Unit IDs during development.

  1. Add Test Device:

    • Go to AdMob Settings > Test devices.

    • Click Add Test Device.

  2. Use Test Unit IDs: Google provides dedicated test IDs that always return test ads:

    • iOS Test Unit ID: ca-app-pub-3940256099942544/2934735716

    • Android Test Unit ID: ca-app-pub-3940256099942544/6300978111

View AdMob's full app testing guide here:

Moving to Production

  1. Create real Ad Units in your AdMob Console.

  2. Replace the Test Unit IDs in your Bubble plugin or JavaScript code with your real Unit IDs.

  3. Submit your app to the App Store and Google Play.

  4. Once approved, go to Apps > Your App > App Settings in AdMob and click Add Store to link the live app stores to AdMob. This process takes ~1 day for review.

Troubleshooting

If you have more questions, please read the Admob FAQ page: Google Admob Helparrow-up-right

Last updated