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)


    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








                                    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

                                          Zoho Desk Resources

                                          • Desk Community Learning Series


                                          • Digest


                                          • Functions


                                          • Meetups


                                          • Kbase


                                          • Resources


                                          • Glossary


                                          • Desk Marketplace


                                          • MVP Corner


                                          • Word of the Day


                                            Zoho Marketing Automation

                                              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 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 for Apple 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. Installation source ...
                                                                                                      • API Tracking for Windows apps

                                                                                                        Apptics SDK provides multiple options for tracking your application APIs. To track the APIs, configure them in the Apptics web console, refer to our user guide. Once the configuration is done in the web console, you will get an API ID. Use the below ...
                                                                                                      • Integrate Zoho Apptics with an Android apps

                                                                                                        Prerequisites Android Studio Artic Fox and above. Target API level 19 (kitkat) or later. Android Gradle plugin at least 7.0.0-beta04. DataBinding should be enabled in your project. Use Google's Androidx library instead of standard or support library. ...
                                                                                                      • Remote Logger for Android apps

                                                                                                        Remote logger helps you to get the applications logs without asking the users. Before you begin, ensure that Apptics is integrated into your project by following the Integration Guide. Add remote logger to your app Declare the Remote Logger ...
                                                                                                      • API Tracking in Zoho Apptics

                                                                                                        Overview API tracking provides insights into how many APIs are being used, what is the success/failure rates of each API, and the average duration of the API. You can view the stats for APIs based on attributes such as brand, platform, bundle id, app ...
                                                                                                        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