Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Track Admob Event in the Google Analytics

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?

like image 948
dimetil Avatar asked Jul 03 '12 09:07

dimetil


People also ask

Does AdMob use Google Analytics?

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.

Can Google Analytics track Google ads?

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).

Can you use Google Analytics to track apps?

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.


1 Answers

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
}
like image 175
dimetil Avatar answered Sep 24 '22 14:09

dimetil