Passing Logged-In Customer Details to Popin

Passing Logged-In Customer Details to Popin

This guide explains how to automatically pass logged-in customer data to the Popin widget. This ensures a seamless experience by skipping the manual data entry step and directly opening the widget.


📋 When to Use This

Use this method if:

  • The user is already logged in.

  • You have access to their name and at least one contact field (mobile number or email).

  • You want to open the Popin widget directly without asking the user to enter their details.


🛠️ Required Fields

To pass customer details to Popin, include the following fields using the Popin("captured", {...}) method:

Field Required Notes
name ✅ Yes Full name of the customer.
mobile ⚠️ Yes* Either mobile or email is required. Mobile number should exclude country code.
email ⚠️ Yes* Either email or mobile is required.
country ❌ No If not provided, +91 (India) will be used as the default.

Important: name is mandatory. At least one of mobile or email must be provided.


🧩 Implementation

Use the Popin("captured", {...}) function before opening the widget.

✅ Example Code:

Popin("captured", {
  name: data["contact[full-name]"],                      // Required
  mobile: data["contact[phone]"],                        // Optional if email is provided
  email: data["contact[email]"],                         // Optional if mobile is provided
  country: data["contact[country-code]"]?.trim()         // Optional (defaults to +91)
});

Popin("open"); // Opens the widget directly to the second screen

🔁 Sample Scenarios

Case 1: Mobile and Name Provided

Popin("captured", {
  name: "Ravi Kumar",
  mobile: "9876543210"
});
Popin("open");

Case 2: Email and Name Provided

Popin("captured", {
  name: "Meera Das",
  email: "meera@example.com"
});
Popin("open");

Case 3: Mobile, Email, and Country Code Provided

Popin("captured", {
  name: "Arjun Mehta",
  mobile: "9123456789",
  email: "arjun@example.com",
  country: "971" // UAE
});
Popin("open");

📌 Notes

  • If country is not passed, it will default to +91.

  • mobile should be passed without the country code (e.g., "9876543210" instead of "+919876543210").

  • The widget will open directly to the second screen, skipping the customer input prompt.