Server SDKs

Ad Revenue Event

Send ad revenue events with the Node.js SDK

Track ad impressions and revenue by sending an ad event via the webhook endpoint.

Usage

import {
  Client, UserData, AdData, AppEvent
} from "@geeklab.app/audiencelab_nodejs_sdk";

const client = new Client({
  apiKey: "YOUR_API_KEY",
  baseUrl: "https://analytics.geeklab.app",
});

const userData = new UserData()
  .setUserId("user_12345")
  .setUserIp("203.0.113.42")
  .setUserCreativeTokenInfo({
    creativeToken: "abc123-creative-token",
    os_system: "iOS 17.4",
    device_name: "iPhone 14 Pro",
    device_model: "iPhone15,2",
    utc_offset: "+03:00",
    install_date: "2026-06-09T10:00:00+00:00",
    last_login_date: "2026-06-10T10:00:00+00:00",
    total_purchase_value: 12.5,
    total_ad_value: 1.25,
  });

const adEvent = new AdData()
  .setAdId("rewarded_video_main")
  .setName("Main Menu Rewarded")
  .setSource("admob")
  .setWatchTime(30)
  .setReward(true)
  .setMediaSource("ironsource")
  .setChannel("rewarded_video")
  .setValue(0.0125)
  .setCurrency("USD")
  .setDedupeKey("ad_view_12345");

const response = await new AppEvent(
  client, adEvent, userData
).send();

AdData Fields

Prop

Type

Event ID