Audiencelab
Client-Side/React SDK/Usage

Ad View Event

Track when rewarded or interstitial ads are being viewed

Use sendCustomAdEvent to send an ad view event when a user watches an ad. Send this event every time a user views an ad in your app.

import { sendCustomAdEvent } from "@geeklab.app/audiencelab-react-web-sdk";
sendCustomAdEvent(
  "ad456", // adId
  "Video Ad", // name
  "YouTube", // source
  30, // watchTime (seconds)
  true, // reward
  "YouTube", // mediaSource
  "Channel1", // channel
  0.5, // value
  "USD" // currency
)
  .then((response) => {
    console.log("Ad event sent successfully:", response);
  })
  .catch((error) => {
    console.error("Failed to send ad event:", error);
  });
PropTypeDefault
ad_id
string
-
name
string
-
source
string
-
watch_time
int
-
reward
bool
-
media_source
string
-
channel
string
-
value
double
-
currency
string
-

⚡ Value can be estimated ad revenue

Ad view events allow tracking of monetization performance per ad unit, creative, or channel.