Web

Before you begin

If you haven't already, add Adrop to Web and make sure that Adrop Metrics is enabled in your project

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}>;
    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
   }
}

Set user properties

You can set properties to describe the users of your app. Check the preset defined for the keys we support.

const key = "YOUR_PROPERTY_KEY"
const value = "YOUR_PROPERTY_VALUE"
await adrop.setProperty(key, value)

Last updated