Track Goal

Track Goal

The trackGoal API  is used to track the goal conversions for the FullStack A/B test experiments. This can be invoked in two ways:

Method:

  1. String variationName = pageSenseClient.trackGoal(experimentName, userId, goalName, userAttributes);

Parameters:

Parameter

Type

Description

experimentName

String

The name of the experiment activated.

userId

String

A unique identifier for the user.

goalName

String

The name of the goal being tracked.

userAttributes

HashMap<String, String>

A map of user attributes used for audience targeting and segmentation.


In a FullStack A/B Test experiment, a conversion event is tracked for a user for a particular goal only when the following conditions are met:
  1. User qualifies for the experiment based on the audience targeting conditions and experiment traffic
  2. User completes the specified goal action
As a prerequisite, you must configure the list of goals associated with the experiment and clearly define the conditions under which each goal is considered completed. Once a user qualifies for the experiment and satisfies the criteria for a specific goal, the trackGoal API must be invoked to report the conversion event to the PageSense server.

If the user qualifies for the experiment, the API sends the goal conversion details to PageSense server. If the user does not qualify, the API call is ignored, and no goal conversion details will be recorded.

This ensures that goal tracking remains accurate, consistent, and limited only to the users who are actively participating in the experiment.

Example code:

Please see the following code to understand how the user conversion can be tracked using trackGoal API.
  1. import java.util.HashMap; 
  2. // Create the User Attributes object 
  3. HashMap<String, String> userAttributes = new HashMap<>(); 
  4. // Add the User Attribute values 
  5. userAttributes.put("Browser", "Chrome"); 
  6. userAttributes.put("Device", "Desktop");
  7. userAttributes.put("OS", "Windows 10");
  8.  // Activate the FullStack A/B Test Experiment 
  9. String variationName = pageSenseClient.trackGoal(experimentName, userId, goalName, userAttributes); 

How this API Works

When the trackGoal API is invoked, it follows a structured process to determine whether a variation should be allocated to the user. Below is a detailed breakdown of this process:

Audience Targeting

The API first evaluates whether the user qualifies for the experiment based on audience targeting conditions defined during experiment configuration.
These conditions are typically based on user attributes such as browser, device type, operating system, or any custom user data passed in the userAttributes.
  1. If the user’s attributes match the audience targeting conditions, the API proceeds to the next step.
  2. If the user does not meet these conditions, the API immediately returns null, indicating that the user is not eligible to be included in the experiment.

User Qualification

The next step is to determine if the user qualifies for the experiment based on the experiment’s traffic allocation settings.
  1. The API checks whether the User Storage Service is enabled. If it is enabled, the API will check for any stored variation for the user. If a variation has already been assigned and stored for the user in the User Storage Service, the API retrieves and returns that stored variation.
  2. If no stored variation exists, the API proceeds to allocate a new variation using variation bucketing.
  3. The API applies the MurmurHash algorithm to the user's ID (userId). This hashing algorithm consistently generates a unique numeric value between 0 and 9999 for each user ID, which serves as the user's hash value.
  4. Each variation within the experiment is assigned a specific range of hash values that corresponds to the variation’s allocated traffic percentage.
  5. The API checks if the user’s hash value falls within any of these defined ranges. If it does, the user will be considered qualified for the experiment. If the hash value falls outside all assigned ranges, it means the user is not qualified for the experiment and the goals will not be tracked.

Tracking and Analytics

If the user qualifies for the experiment and achieves the goal, the API sends the corresponding goal conversion details to the PageSense server. This data is used for analytics, reporting, and experiment performance evaluation.

Using trackGoal without user attributes

The trackGoal API may also be invoked without providing any user attributes. The following code demonstrates how to call the API without passing any user attribute parameters.

Method:

  1. String variationName = pageSenseClient.trackGoal(experimentName, userName, goalName);

Parameter details

Parameter

Type

Description

experimentName

String

The name of the experiment activated.

userId

String

A unique identifier for the user.

goalName

String

The name of the goal being tracked.


How the API Works

  1. In this version of the API, only the experiment name and user ID are required.
  2. The audience targeting step is still executed; however, since no user attributes are provided, the user will qualify only for the experiments where the audience targeting criteria is configured as “All Visitors.”
  3. If the experiment includes any additional audience targeting conditions—such as device type, location, or custom attributes—the user will automatically fail the qualification check due to the absence of user attribute data for evaluation.
  4. For experiments that allow “All Visitors,” the MurmurHash algorithm is applied to thee User Id to get the User's unique has value based on experiment's traffic allocation. If the user's hash value falls within the defined range of any variation, that user is qualified for the experiment  and the goal conversion details will be sent to the PageSense server.
  5. If the user's hash value falls outside all defined variation ranges—due to the experiment’s traffic allocation configured, the user will not qualify for the experiment and no goal conversion details will be sent to the PageSense Server.
We hope this documentation helps make the process easy for you. Please feel free to reach out to us anytime by dropping an email to support@zohopagesense.com if you need more explanation or have any questions.

      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 FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile 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 FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure 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

                                                                                                                          • Track Goal

                                                                                                                            The TrackGoal API is used to track the goal conversions for the FullStack A/B test experiments. This can be invoked in two ways. Using ActivateExperiment with user attributes Method pageSenseClient.TrackGoal(experimentName, userId, goalName, ...
                                                                                                                          • Integrate PageSense Revenue Goal via Google Tag Manager

                                                                                                                            Zoho PageSense enables you to track the revenue made on your website when a visitor completes a successful transaction on your A/B (and Split URL) experiment page. A revenue goal is mostly set up in the 'Thank you or Payment confirmation' page of ...
                                                                                                                          • Enable cross-domain tracking in PageSense

                                                                                                                            Cross-domain tracking is the process of tracking a visitor's journey across different domains to achieve a desired goal or action. For example, your user visits your website's homepage www.technology.com, clicks the blog tab on the page and is ...
                                                                                                                          • Understand your push notification report

                                                                                                                            Track and analyze the impact of your push notification among your subscribers using realtime results. Zoho PageSense allows you to evaluate the success of each notification, with detailed reports based on which notification performed the best, which ...
                                                                                                                          • Set goals and launch your push notification

                                                                                                                            The primary goal of any notification is to evoke a desired action from the users reaching your website. You can easily track this by creating different types of goals for your targeted audience on PageSense. These can trigger automated ...
                                                                                                                            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