Knowledge Base

Inbox

Add Customer Parameters to the Chat

Add customer parameters to the chat to update customer details in the CRM.

Tamas Ham-Szabo image Written by Tamas Ham-Szabo
Back to articles Tamas Ham-Szabo image Written by Tamas Ham-Szabo

Add Customer Parameters to the Chat

By adding customer parameters to the chat, you can push customer data to SAAS First's CRM. You can use this data:

  • Verify the customer: In the Inbox, you can see if you are chatting with a user who is logged in to your application and what their details are.
  • Targeting: When creating a marketing campaign, you can filter the Customer database based on any variables we know about your customer. This allows you to target the right customers.

Before Adding the Chat to Your Application, Hash the user_id

For security reasons, we need to ensure the data coming through our chat from your application is real.

We need both the user_id and a hash generated from the user id to validate your data. You can read more on how to hash your id securely: https://saasfirst.com/help/getting-started/securely-hash-user-ids.

Install SAAS First's Chat in Your Application

You need to paste a short javascript into your application's frontend code before the closing body tag (</body>). You can find the js code, including your workspace id, here: https://app.saasfirst.com/inbox/settings/installation.

Mandatory and Recommended Customer Parameters to Add

The mandatory variable is the "workspace_id", which is unique to your workspace. However, passing a couple of basic customer parameters is strongly recommended if the chat is installed on a page where customers are logged in.

Recommended Parameters

By adding the following customer parameters to your chat window, you can ensure your contacts are up to date at all times:

  • user_id (string): A unique id in your application identifying each of your customers.
  • user_hash (string): A hash generated from the user_id using HMAC SHA-256 with the security key from your account.
  • email (string): The customer's email address.
  • first_name (string): The customer's first name.
  • last_name (string): The customer's last name.
  • account_created_at (string): Any date format, but recommended UNIX timestamp.

Additional Parameters

Other than the recommended parameters, you can add any custom parameters. For example, you may want to add address details or details of the subscription. 

You can add any parameters.

  • The key can be any string, in lower case, words separated by an underscore. E.g., customer_city
    • Value can be any data. The type of the data, such as string, date, and integer, will be automatically detected, but you can change it later on within the SAAS First application. 

Contact, Business, Contact Business

Our structure is based on 3 different blocks, which are contact, business, and contact-business. 

  • Contact: all data related to the person themselves. We recommend such parameters here as: user_id, email, first_name, last_name, phone, facebook_url, linkedin_url, twitter_url, account_created_at, etc. These parameters are not compulsory, and you can add as many here as you want. 
  • Business: all data related to the business. We recommend such parameters here as: name, domain, email, phone, facebook_url, linkedin_url, twitter_url, etc. These parameters are not compulsory, and you can add as many here as you want. However, please note that adding the business block is not mandatory. If you want to add it to your data, you must add the business_id parameter. If you have a contact-business block, the business block is mandatory.
  • Contact-Business: all data that shows the relation between the contact and the business. Such a parameter can be, for example, position. Adding the contact-business block is not mandatory. 

You can find the structure for this here: https://app.saasfirst.com/inbox/settings/installation

Did this answer your question?

Sad smiley Neutral smiley Happy smiley
Operated by

2024