Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impression tracker for original API #804

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void failure(@NonNull PbFindSizeError error) {
protected void onDestroy() {
super.onDestroy();
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void failure(@NonNull PbFindSizeError error) {
protected void onDestroy() {
super.onDestroy();
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected void onDestroy() {
super.onDestroy();

if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void failure(@NonNull PbFindSizeError error) {
protected void onDestroy() {
super.onDestroy();
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected void onDestroy() {
super.onDestroy();

if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected void onDestroy() {
adView.destroy();
}
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
if (unifiedNativeAd != null) {
unifiedNativeAd.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void configureNativeAdUnit(NativeAdUnit adUnit) {
protected void onDestroy() {
super.onDestroy();
if (nativeAdUnit != null) {
nativeAdUnit.stopAutoRefresh();
nativeAdUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected void onDestroy() {
super.onDestroy();

if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected void onDestroy() {
super.onDestroy();

if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
if (adsLoader != null) {
adsLoader.setPlayer(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
protected void onDestroy() {
super.onDestroy();
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
protected void onDestroy() {
super.onDestroy();
if (adUnit != null) {
adUnit.stopAutoRefresh();
adUnit.destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class GamOriginalApiDisplayBanner300x250Activity : BaseAdActivity() {

override fun onDestroy() {
super.onDestroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

private fun createGAMListener(adView: AdManagerAdView): AdListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class GamOriginalApiDisplayBanner320x50Activity : BaseAdActivity() {

companion object {
const val AD_UNIT_ID = "/21808260008/prebid_demo_app_original_api_banner"
const val CONFIG_ID = "prebid-demo-banner-320-50"
const val CONFIG_ID = "prebid-ita-banner-320-50"
const val WIDTH = 320
const val HEIGHT = 50
}
Expand Down Expand Up @@ -71,6 +71,9 @@ class GamOriginalApiDisplayBanner320x50Activity : BaseAdActivity() {
parameters.api = listOf(Signals.Api.MRAID_3, Signals.Api.OMID_1)
adUnit?.bannerParameters = parameters

// Optional: the activation of the native impression tracker
adUnit?.activatePrebidImpressionTracker(adView)

adUnit?.setAutoRefreshInterval(refreshTimeSeconds)
adUnit?.fetchDemand(request) {
adView.loadAd(request)
Expand All @@ -80,7 +83,7 @@ class GamOriginalApiDisplayBanner320x50Activity : BaseAdActivity() {

override fun onDestroy() {
super.onDestroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class GamOriginalApiDisplayBannerMultiSizeActivity : BaseAdActivity() {

override fun onDestroy() {
super.onDestroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GamOriginalApiDisplayInterstitialActivity : BaseAdActivity() {
const val CONFIG_ID = "prebid-demo-display-interstitial-320-480"
}

private var adUnit: AdUnit? = null
private var adUnit: InterstitialAdUnit? = null


override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -45,6 +45,9 @@ class GamOriginalApiDisplayInterstitialActivity : BaseAdActivity() {
// 1. Create InterstitialAdUnit
adUnit = InterstitialAdUnit(CONFIG_ID, 80, 60)

// Activate additional impression tracker (for burl)
adUnit?.activatePrebidImpressionTracker(true)

// 2. Make a bid request to Prebid Server
val request = AdManagerAdRequest.Builder().build()
adUnit?.fetchDemand(request) {
Expand Down Expand Up @@ -78,6 +81,6 @@ class GamOriginalApiDisplayInterstitialActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

adUnit?.stopAutoRefresh()
adUnit?.destroy()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class GamOriginalApiInStreamActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

adUnit?.stopAutoRefresh()
adUnit?.destroy()
adsLoader?.setPlayer(null)
adsLoader?.release()
player?.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class GamOriginalApiMultiformatBannerActivity : BaseAdActivity() {

override fun onDestroy() {
super.onDestroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

private fun createGAMListener(adView: AdManagerAdView): AdListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ class GamOriginalApiMultiformatInterstitialActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

adUnit?.stopAutoRefresh()
adUnit?.destroy()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class GamOriginalApiNativeInAppActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()
adView?.destroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
unifiedNativeAd?.destroy()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class GamOriginalApiNativeStylesActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

nativeAdUnit?.stopAutoRefresh()
nativeAdUnit?.destroy()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class GamOriginalApiVideoInterstitialActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class GamOriginalApiVideoRewardedActivity : BaseAdActivity() {
override fun onDestroy() {
super.onDestroy()

adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ open class GamOriginalBannerFragment : AdFragment() {
override fun onDestroyView() {
super.onDestroyView()
adView?.destroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
}

private class Events(parentView: View) : BaseEvents(parentView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GamOriginalInstreamFragment : AdFragment() {

override fun onDestroyView() {
super.onDestroyView()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
adsLoader?.setPlayer(null)
adsLoader?.release()
player?.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GamOriginalInstreamNewApiFragment : AdFragment() {

override fun onDestroyView() {
super.onDestroyView()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
adsLoader?.setPlayer(null)
adsLoader?.release()
player?.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class GamOriginalNativeBannerFragment : AdFragment() {

override fun onDestroy() {
super.onDestroy()
nativeAdUnit?.stopAutoRefresh()
nativeAdUnit?.destroy()
}

private class Events(parentView: View) : BaseEvents(parentView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class GamOriginalNativeInAppFragment : PpmNativeFragment() {
override fun onDestroy() {
super.onDestroy()
adView?.destroy()
adUnit?.stopAutoRefresh()
adUnit?.destroy()
unifiedNativeAd?.destroy()
}
}
Loading