Is it possible to track Admob
event that the user clicked on the ads in the Google Analytics
.
I use AdMob
for showing ads. I want to track every click on ads in Google Analytics
.
How can I set up Event
?
Through Google Analytics for Firebase, AdMob now reports all of your revenue streams in one place so that you can track the health of your monetization effort from one dashboard.
Linking your Google Ads account to your Analytics property lets you see the full customer cycle, from how users interact with your marketing (e.g., seeing ad impressions, clicking ads) to how they finally complete the goals you've set for them on your site (e.g., making purchases, consuming content).
User insights from acquisition to app usageAnalytics surfaces data about user behavior in your iOS and Android apps, enabling you to make better decisions about your product and marketing optimization.
I found the solution.
Implement the AdMob
interface AdListener
for your Activity
.
public interface AdListener {
public void onReceiveAd(Ad ad);
public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode error);
public void onPresentScreen(Ad ad);
public void onDismissScreen(Ad ad);
public void onLeaveApplication(Ad ad);
}
Then set listener for AdView
element.
adView.setAdListener(this);
And override onPresentScreen
method for tracking events if user clicks on Ads.
onPresentScreen - Called when an Activity is created in front of your app, presenting the user with a full-screen ad UI in response to their touching ad.
private GoogleAnalyticsTracker tracker;
...
@Override
public void onPresentScreen(Ad arg0) {
tracker.trackEvent(
"AdMob", // Category
"AdView", // Action
"Clicked", // Label
1); // Value
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With