Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:56:23+00:00 2026-06-14T20:56:23+00:00

I implemented inapp purchase successfully in android app. I just want to log the

  • 0

I implemented inapp purchase successfully in android app. I just want to log the purchase event in google analytics. If the application is in foreground, i can log the event through PurchaseObserver. But If the application in background, how to log the event in google analytics. Currently i am using EasyTracking library to log the events.

Please Help.
thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:56:24+00:00Added an answer on June 14, 2026 at 8:56 pm

    Try something like this with the new v2 Google Analytics Android API

    public void onPurchaseCompleted() {
      Transaction myTrans = new Transaction.Builder(
          "0_123456",                                           // (String) Transaction Id, should be unique.
          (long) 2.16 * 1000000)                                // (long) Order total (in micros)
          .setAffiliation("In-App Store")                       // (String) Affiliation
          .setTotalTaxInMicros((long) 0.17 * 1000000)           // (long) Total tax (in micros)
          .setShippingCostInMicros(0)                           // (long) Total shipping cost (in micros)
          .build();
    
      myTrans.addItem(new Item.Builder(
          "L_789",                                              // (String) Product SKU
          "Level Pack: Space",                                  // (String) Product name
          (long) 1.99 * 1000000,                                // (long) Product price (in micros)
          (long) 1)                                             // (long) Product quantity
          .setProductCategory("Game expansions")                // (String) Product category
          .build());
    
        Tracker myTracker = EasyTracker.getTracker(); // Get reference to tracker.
        myTracker.trackTransaction(myTrans); // Track the transaction.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented an in-app purchase into my iPhone application. It is non-consumable, and
i have implemented the in app purchase in my application and added few in
I have implemented InApp Purchase in my App. These are the steps i have
I have implemented In-App purchase in my application.But I need to custom the purchased
I've implemented In App purchase in my account using static response id android.test.purchased .
I have implemented In App purchase in my application. While testing (with SandBox environment),
I have implemented In App Purchase in one of the existing application, it's working
I have implemented In App purchase in one of the existing application. I have
I have implemented In-App Purchase in my application. I uploaded apk which is not
How to implement in-app purchase in my android application?? I referred http://developer.android.com/guide/market/billing/billing_integrate.html#billing-service this link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.