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 builderIn the center of the project app page, click the Web icon button to launch the setup workflow.
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.
Enter other app information: App nickname .
App nickname : An internal, convenience identifier that is only visible to you in the Adrop console
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
Copy < head >
...
< script src = 'https://storage.adrop.io/js/adrop-0.1.2.min.js' type = 'text/javascript' ></ script >
< script >adrop = window .adrop || {}</ script >
</ head >
Step 5: Initiailze Adrop
Please replace the parameter with appropriate values before using it.
Copy adrop .initialize ( 'YOUR_APP_KEY' )
If you're using Typescript
, copy this code in your *.d.ts
Copy declare var adrop : {
initialize : (appKey : string ) => void ;
request : (unitId : string ) => Promise <{ ad : string , unit : string , message : string }>;
setProperty : (key : string , value : string ) => Promise < void >;
logEvent : (name : string , params ?: Record < string , any >) => Promise < void >;
}
3. If you're using ESLint
, add "adrop": true
to globals
field in your .eslintrc.json
Copy {
"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 .