Initialization of Java SDK

Initialization of Java SDK

PageSenseClient is the interface provided by the PageSense Java SDK library to run the FullStack A/B Test experiments for the users. To run the FullStack experiment for the user, the PageSenseClient should be first initialised with the Project Setting details. The Project Setting details provide the information about the list of the FullStack experiments the PageSenseClient can execute and also explains how the experimentation should be carried out.

Initialization of PageSense JAVA SDK comprises of two steps:

2.1 Getting the Project Settings for PageSenseClient
2.2 Creating the PageSenseClient instance

2.1 Get the Project Settings for PageSenseClient:

ProjectSettings provides the details of list of the FullStack Experiments to be run by the PageSenseClient. and the current state of each of the experiments. Project Settings can be obtained from the PageSense server using the getProjectSettings API.

This API should be invoked by passing the following parameters:
NAME
TYPE
DESCRIPTION
accountId
String
A unique PageSense account ID for User.
sdkKey
String
Unique Key that corresponds to the SDK Environment.
You can get this key from the Environment Tab under the Project Settings in the FullStack page.
projectName
String
Name of the Project.

Get Project Setting Details

Add the following code to your application to get the Project Setting file for your PageSense account.

 

import com.zoho.pagesense.PageSenseClient;

import com.zoho.pagesense.PageSenseClientBuilder;

 

  // Get the Project Settings

  String projectSettings = PageSenseClientBuilder.getProjectSettings("accountId" “sdkKey”, “projectName”);

Info: This function will return the Project Settings if present in the Stringified JSON format. If there are no project settings available, this function will return null.

2.2  Creating the PageSenseClient instance

Once you receive the ProjectSettings, the next setup is to initialise the PageSenseClient with the Project Setting and create an instance of the PageSenseClient. You can initialise the PageSenseClient using the following code:

PageSenseClient pageSenseClient = PageSenseClientBuilder.getBuilder(projectSettings).buildClient();

If Project Settings have valid details, it will initialise the PageSenseClient with the details of the project and return the PageSenseClient instance. If the Project details are not valid or any error occurred while initialising the PageSenseClient, this API will return null.

Note: Please make sure you implement proper error handling measures when the PageSenseClient is initialized as null.

Example code:

  import com.zoho.pagesense.PageSenseClient;

  import com.zoho.pagesense.PageSenseClientBuilder;

  // Get the Project Settings

  String projectSettings = PageSenseClientBuilder.getProjectSettings("Zylker", "Nmvqoqp2Pr2gtKA", "Zylker Marketing");

  // Create the PageSense Client Instance

PageSenseClient pageSenseClient = PageSenseClientBuilder.getBuilder(projectSettings).buildClient();

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 FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              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
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform 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

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

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

                                                                   
                                                                    

                                                                  Videos

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

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    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

                                                                                                                            • Installation of Java SDK

                                                                                                                              The PageSense JAVA SDK empowers developers to integrate, conduct A/B testing, and personalise user experiences within JAVA applications. PageSense JAVA SDK offers a simple and reliable way to integrate FullStack A/B Testing into your JAVA-based ...
                                                                                                                            • Initialization of C# SDK

                                                                                                                              PageSenseClient is the interface provided by the PageSense C# SDK library to run the FullStack A/B Test experiments for the users. To run the FullStack experiment for the user, the PageSenseClient should be first initialised with the Project Setting ...
                                                                                                                            • SDK Customization

                                                                                                                              Overview: SDK customization involves tailoring a Software Development Kit (SDK) to meet the unique needs of your application or development environment. An SDK typically includes tools, libraries, documentation, and code samples to assist developers ...
                                                                                                                            • SDK Customization

                                                                                                                              Overview SDK customization involves tailoring a Software Development Kit (SDK) to meet the unique needs of your application or development environment. An SDK typically includes tools, libraries, documentation, and code samples to assist developers ...
                                                                                                                            • Java Release Notes

                                                                                                                              Below mentioned are the versions of Java that will be supported: Open JDK versions: 8, 9, 11, 12, 13, 15 and 17 Oracle JDK versions: 8, 9, 11, 12, 13, 15 and 17 We hope this documentation helps make the process easy for you. Please feel free to reach ...
                                                                                                                              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