API Tracking for Android apps

API Tracking for Android apps

API Tracking is a part of Apptics' Analytics SDK which allows you to track the success rate and response time for the REST APIs configured in the Apptics web console. Refer to the user guide to configure APIs in the web console.
  1. Before you begin, make sure that Apptics is integrated into your project by following the Integration Guide.

Add analytics SDK to your app

  1. Declare analytics dependency using Apptics BoM.
  1. dependencies {
      // ...
    
     // Apptics BoM, latest version is mentioned in the integration guide.
      implementation platform('com.zoho.apptics:apptics-bom:[latest-version]')
      
      // Since BoM version is specified, no need to explicitly specify the dependency version.
      implementation 'com.zoho.apptics:apptics-analytics'
    
    }
  1. If you do not use Apptics BoM, you can directly declare the analytics dependency with its version.
  1. dependencies {
       // Have to explicitly mention the version, if you are not using BoM.
       // latest version is mentioned in the integration guide.
       implementation 'apptics_android_sdk.milestones:analytics:[latest-version]'
    }
Note: It is recommend to use Apptics BoM to avoid unnecessary compatibility issues.
  1. Initialize analytics in application onCreate() method.
  1. Apptics.init(this)

Start tracking APIs

You can track APIs only after configuring them in the Apptics web console. You will be provided with an ID for each API that is configured in the console.

For retrofit users

  1. Add AppticsAnalyticsApiTrackingInterceptor to your Okhttp client builder used to make API calls.
  1. OkHttpClient client = new OkHttpClient.Builder()
                 .addInterceptor(new AppticsApiTrackingInterceptor())
                 .build();
  1. Add TrackApiWith annotation to the API interface method, with the corresponding API ID provided in the web console.
  1. interface Service {
    	@TrackApiWith(API_ID)
    	@Post(url) or @Get(url)
    	fun makeApiCall()
    }

For users using other networking libraries

  1. Use startTrackApi method with the API ID and the request method (GET, POST, PUT, etc.) before making network call.
  1. val trackId = AppticsApiTracker.startTrackApi(API ID, requestMethod)
  1. startTrackApi will return a tracking id. Use that id along with the API response code (200, 400, etc.) in the endTrackApimethod. Call endTrackApi method once the API has returned the response.
  1. AppticsApiTracker.endTrackApi(trackId, responseCode)


      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Intake FormsLegalMobile App
                              Form DesignerHRMobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsEncrypted Forms

                              Secure Forms

                              WCAG

                                      Create. Review. Publish.

                                      Write, edit, collaborate on, and publish documents to different content management platforms.

                                      Get Started Now






                                                        You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                            Manage your brands on social media


                                                              • Desk Community Learning Series


                                                              • Digest


                                                              • Functions


                                                              • Meetups


                                                              • Kbase


                                                              • Resources


                                                              • Glossary


                                                              • Desk Marketplace


                                                              • MVP Corner


                                                              • Word of the Day


                                                              • Ask the Experts


                                                                Zoho Sheet Resources

                                                                 

                                                                    Zoho Forms Resources


                                                                      Secure your business
                                                                      communication with Zoho Mail


                                                                      Mail on the move with
                                                                      Zoho Mail mobile application

                                                                        Stay on top of your schedule
                                                                        at all times


                                                                        Carry your calendar with you
                                                                        Anytime, anywhere




                                                                              Zoho Sign Resources

                                                                                Sign, Paperless!

                                                                                Sign and send business documents on the go!

                                                                                Get Started Now




                                                                                        Zoho TeamInbox Resources





                                                                                                  Zoho DataPrep Demo

                                                                                                  Get a personalized demo or POC

                                                                                                  REGISTER NOW


                                                                                                    Design. Discuss. Deliver.

                                                                                                    Create visually engaging stories with Zoho Show.

                                                                                                    Get Started Now









                                                                                                                        • Related Articles

                                                                                                                        • API Tracking in Zoho Apptics

                                                                                                                          Overview API tracking provides insights into the REST APIs that you use for your application and helps you monitor the usage, success/failure rates, average duration taken for the response, etc. for each API. API tracking is a part of the analytics ...
                                                                                                                        • Non-fatal tracking in Zoho Apptics

                                                                                                                          Overview Apptics provides a way to record the non fatal errors and exceptions that are caught in your app's try-catch blocks. Using the non-fatal module in Zoho Apptics, you can track and analyze non fatal errors similar to fatal errors like crashes ...
                                                                                                                        • Events Tracking in Zoho Apptics

                                                                                                                          Overview In-app event tracking helps you to understand how users interact and engage with your app. An event is an action taken by your user within the app (user activity) that you want to measure. Events is part of the core data you require for ...
                                                                                                                        • Session Tracking in Zoho Apptics

                                                                                                                          Overview A session records the time for which a user interacts with your app. Each session records the duration and frequency of user interactions within the app. You can measure and analyze all the sessions that happen within your app. A session ...
                                                                                                                        • JS Errors

                                                                                                                          Overview Error reporting for JavaScript errors include caught errors, uncaught errors, and warnings that are printed in the browser console for your web applications. In Apptics, the JS errors page in Apptics gives you an overview of all the ...
                                                                                                                          Wherever you are is as good as
                                                                                                                          your workplace

                                                                                                                            Resources

                                                                                                                            Videos

                                                                                                                            Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                            eBooks

                                                                                                                            Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                            Webinars

                                                                                                                            Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                            CRM Tips

                                                                                                                            Make the most of Zoho CRM with these useful tips.



                                                                                                                              Zoho Show Resources