Impression Level Data - cleveradssolutions/CAS-ReactNative GitHub Wiki
:zap: Before you start
Make sure you have correctly Initialize CAS.
CleverAdsSolutions enables you to access detailed information for each impression through the impressions callback APIs. The information includes, for example, which demand source served the ad, the expected or exact revenue associated with it. In addition, it contains granular details to allow you to analyze and, ultimately, optimize user acquisition strategies.
Ad Impression
AdImpression
is an interface for getting detailed information about the current ad impression, such as revenue and ad creative details.
Each ad format has a callback to receive an AdImpression
about the current impression.
The code below demonstrates how to handle impression events for Interstitial ad and Banner ad:
manager.showInterstitial({
onImpression: (ad: AdImpression) => {
// Get ad details using impression parameter
},
});
manager.showRewarded({
onImpression: (ad: AdImpression) => {
// Get ad details using impression parameter
},
});
<BannerAd
onAdViewPresented={({impression}) => {
// Get ad details using impression parameter
}}
/>
Ad revenue
Use the cpm
property to get a revenue estimate for the current impression.
The value of the cpm
property is Cost Per Mille estimated impressions. To earn per impression revenue, follow these steps:
const cpm = impression.cpm;
You can also check the precision estimate for the cpm
value, as shown in the following example:
const precision = impression.priceAccuracy;
if (precision == PriceAccuracy.Floor) {
// The value is minimum eCPM, obtained from the ad network waterfall configuration.
} else if (precision == PriceAccuracy.Bid) {
// The value is exact and committed per 1000 impressions
} else{
// The value is not disclosed by the demand source, cpm will return 0.
}
Ad creative
You can also retrieve information about the current ad (such as its mediated network and creative ID), and you will be able to report creative issues for that ad to our Ad review team.
const placementType = impression.adType;
const creativeId = impression.creativeId;
const networkName = impression.network;
const networkSDKVersion = impression.versionInfo;
const casUnitId = impression.identifier;
impression.creativeIdentifier
may return null.
A list of all supported networks can be found in AdNetwork
enum. For example:
if (networkName == AdNetwork.Vungle) {
// Impression from Vungle network.
}
User ad summary
CAS count the number of ad impressions and the total revenue of all formats at the time of a new impression.
const totalImpressions = impression.impressionDepth;
const totalRevenue = impression.lifetimeRevenue;
Progress is saved between sessions until the user clears your app's data.
Automatic collect ad revenue
The CleverAdsSolution SDK have feature to automatically logs the ad_impression event whenever your users see an ad impression. Optionally, the alternative event name can be CAS_Impression
.
⭐ Contact support for details of enabling automatic logs the events to Google Analytics from your CAS application.