Add Adrop to Web

Step 1: Create an Adrop project

Before you can add Adrop to your project, you need to create an Adrop project to connect to your app.

Step 2: Register your app with Adrop

To use Adrop in your Web app, you need to register your app with your Adrop project. Registering your app is often called "adding" your app to your project.

Using Web app builder
  1. Go to the Adrop console.

  2. In the center of the project app page, click the Web icon button to launch the setup workflow.

  3. Enter your app's domain name in the App domain name field.

    • Please note that the domain name value cannot be changed for this Adrop Web app once it has been registered with your Adrop project.

  4. Enter other app information: App nickname.

    • App nickname: An internal, convenience identifier that is only visible to you in the Adrop console

  5. Click Register app and then Android and Apple apps will be created respectively.

Step 3: Add an Adrop configuration file

You can obtain the required App Key in the code snippet.

Step 4: Add Adrop SDK to your app

Load Adrop SDK libraries from the CDN (content delivery network). Copy and paste these scripts into the bottom of your <head> tag

<head>
    ...
    <script src='https://storage.adrop.io/js/adrop-0.1.1.min.js' type='text/javascript'></script>
    <script>adrop = window.adrop || {}</script>
</head>

Step 5: Initiailze Adrop

  1. Please replace the parameter with appropriate values before using it.

adrop.initialize('YOUR_APP_KEY')
  1. If you're using Typescript, copy this code in your *.d.ts

declare var adrop: {
    initialize: (appKey: string) => void;
    request: (unitId: string) => Promise<{ ad: string, unit: string, message: string}>;
    setProperty: (key: string, value: string) => Promise<void>;
}

3. If you're using ESLint, add "adrop": true to globals field in your .eslintrc.json

{
   "globals": {
      "adrop": true
   }
}

Next Steps

You're all set! Please register an Ad unit to show ads to users.

Learn how to Create your Ad unit.

Last updated