In-app Events for Android apps

In-app Events for Android apps

Make sure that you have integrated Apptics in your project, refer to the integration guide.

Add the 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. Alternatively, if you do not use the 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 'com.zoho.apptics:apptics-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)

Logging events

You can log events only after configuring them in the Apptics web console. Events that are logged without configuring in the web console will not be tracked. Refer to the user guide to configure events in the Apptics web console.

Logging events using generated enums

  1. After configuring the required events on the web, rebuild the android studio project (Build -> Rebuild). Upon rebuilding the android studio project, the configured events in the web will be generated as enums in ZAEvents class.
Note: Rebuild the project again, if you have updated the events in the web console for the enum classes to reflect those changes.
  1. Once events are configured and rebuilding the project, you can start logging events using the addEvents method.
  1. AppticsEvents.addEvent(ZAEvents.EventGroup.EventName)
  1. Event can also be logged with additional information as JSONObject/HashMap<String, String> using custom properties param.
  1. val props = JSONObject()
    props.put("some key", "some value")
                
    AppticsEvents.addEvent(ZAEvents.EventGroup.EventName, props)

Logging events using strings

Logging events using strings is recommended for multi-module projects, where you need to log events from modules other than the app module.
  1. To enable logging events using string, add the below snippet in app-level build.gradle.
  1. apptics {
        supportEventAsStrings = ["default" : true]
    }
  1. Initialise AppticsEventsIdMapping in application onCreate after intializing AppticsAnalytics.
  1. AppticsAnalytics.init(this)
    AppticsEventsIdMapping().init()
  1. Use addEvent method to log string events as configured in the web.
  1. AppticsEvents.addEvent("Event_Name", "Event_Group")
  1. Event can also be logged with additional information as JSONObject/HashMap<String, String> using custom properties param.
  1. val props = JSONObject()
    props.put("some key", "some value")
    
    AppticsEvents.addEvent("Event_Name", "Event_Group", props)
Note: Event name and Event group name provided in the addEvent method should be the same as configured in the web console.
  1. Events can be logged either as enums or strings. You cannot use both in the same project. The end result and reports in the web console will be the same for both enum and etring events, only the implementation differs.

    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

                                                                                                      • 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. ...
                                                                                                      • In-app Updates for Android apps

                                                                                                        In-app update module is used to show new version available alerts in android as per the configuration done in the Apptics web console. Refer to the user guide to do the configuration in the web console. Add the in-app update SDK to your app Before ...
                                                                                                      • In-app Feedback for Android apps

                                                                                                        In-app feedback enables you to ask for feedback from your users. App users can then attach and annotate images/screenshots, include logs and diagnostics, or report a bug while sharing a feedback. It comes with an in-built annotator that helps app ...
                                                                                                      • In-app Events for Apple apps

                                                                                                        Configure the Events in the Apptics web console, refer to the user guide. Go to the Xcode project and add the below line to the post_install script of your Podfile. Installation (available by default with the analytics package) #This as an optional ...
                                                                                                      • In-app Events for Windows apps

                                                                                                        Configure the Events in the Apptics web console, refer to the user guide. Do the mentioned steps to add AppticsInterface.cs class with configured events and APIs. Add a class file named "AppticsInterface.cs" in project root. Keep AppticsCommand.exe ...
                                                                                                        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