Zobot Plug Incorrectly Identifying User on Production

Zobot Plug Incorrectly Identifying User on Production

Hi,

I am trying to setup my Zobot to identify users who visit my site as:
- New Users = all of name, email and phone are empty (or name contains Visitor)
- Existing Users but info missing = either name, email or phone are empty
- Existing Users = all of name, email and phone are already set

In testing my plug AND in testing the flow in my Zobot my plug correctly returns the above values based on the different scenarios.  However, when my Zobot is deployed on my production site New users keep getting flagged as Existing Users but info missing.

I have already read thru the different help articles and have used this article in particular as a starting point/reference: https://help.zoho.com/portal/en/community/topic/plug-sample-4-improve-your-customer-interacting-experience-by-letting-zobot-remember-your-website-visitor-name

I am aware of the fact that for new users SalesIQ sets the visitor name to a placeholder value of Visitor with random numbers and have catered for this, I believe, in the logic of my plug.

Here is the current code of my plug:
  1. name = "";

    email = "";

    phone = "";

    isVisitorName = false;

    // Retrieve values from the session, if they exist

    if(session.containsKey("name") && session.get("name").containsKey("value"))

    {

        name = session.get("name").get("value");

        info "Name : " + name;

        // Check if name contains "Visitor"

        if(name.containsIgnoreCase("Visitor"))

        {

            info "Name Contains Visitor";

            isVisitorName = true;

        }

    }

    if(session.containsKey("email") && session.get("email").containsKey("value"))

    {

        email = session.get("email").get("value");

        info "Email: " + email;

    }

    if(session.containsKey("phone") && session.get("phone").containsKey("value"))

    {

        phone = session.get("phone").get("value");

        info "Phone: " + phone;

    }

    info "Session: " + session;

    // Classify the user based on the retrieved values

    if(isVisitorName && email.isNull() && phone.isNull() || name.isNull() && email.isNull() && phone.isNull())

    {

        info "No info or placeholder name with no email/phone";

        existingUser = "New User";

    }

    else if(name.isNull() || email.isNull() || phone.isNull())

    {

        info "Some Info";

        existingUser = "Existing User - Missing Info";

    }

    else

    {

        info "All info";

        existingUser = "Existing User";

    }

    response = Map();

    response.put("existingUser",existingUser);

    info "Response: " + response;

    return response;


Anyone ran into a similar problem or have a solution?


    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方