Control the visibility of ads throughout your application.
Type
Copy
setAdsEnabled(enabled: boolean): void;
DetailsThis method allows you to enable or disable ads globally. This can be useful for paid users or
specific application states. Note that it’s recommended to omit the RevIQ ads script entirely on
pages where ads are not desired.
Example
Copy
import overlayedAds from "@overlayed/ads";// Disable ads for premium usersoverlayedAds.setAdsEnabled(false);// Re-enable adsoverlayedAds.setAdsEnabled(true);
DetailsTrack key values that can later be used to filter ad metrics. These values help with ad targeting
and performance analysis.Warning: You may not pass any user-identifiable data (including names, addresses, or user IDs)
in targeting.
Example
Copy
import overlayedAds from "@overlayed/ads";overlayedAds.setKv("page_id", "HomePage");overlayedAds.setKv("game_mode", "competitive");
DetailsProviding a UID significantly improves ad performance and is highly recommended, though optional.
The system complies with all privacy regulations and does not store user-identifiable data. Once
passed to RevIQ, the UID is normalized and hashed - the original value is never stored.If the user has opted out of tracking, the UID will not be stored or transmitted, making it safe
to call regardless of tracking preferences.
e: Email address
u: Username
p: Phone number
Example
Copy
import overlayedAds from "@overlayed/ads";// With emailoverlayedAds.setUid({ e: "bestgamerx@gmail.com" });// With usernameoverlayedAds.setUid({ u: "BestGamerX" });// With phoneoverlayedAds.setUid({ p: "+1234567890" });
DetailsCall this method for any BrowserWindow or RenderWindow where you intend to show ads. This method:
Sets up a link handler to open ads safely and block malicious behavior
Sets the user agent for all requests, removing non-standard portions that may trigger IVT
(invalid traffic)
Example
Copy
import { overlayed } from "@overlayed/app";const window = new BrowserWindow({ // window options});// Register the window for adsoverlayed.ads.registerWindow(window);