Record first touch time of leads

Record the date and time of a lead's first interaction in a custom field to track how fast your sales teams respond to leads.

A prompt response to leads is crucial to show them they are valued and to improve the likelihood of converting them into customers. If your sales team is slow to reply, the lead may feel ignored, resulting in a lost opportunity. That's why recording and keeping track of the first touch/interaction time should be a priority for sales teams that aim to achieve maximum success. However, you can only track the date and time of the first email sent if you've integrated your email account with IMAP. If not, using a custom function in your CRM is the next best option.

A custom function coupled with workflows can help you record the first touch time of a lead in one of its custom fields. To do this, you'll need to set up a workflow rule that assigns a task to the lead owner during lead creation. Once the task owner responds to the lead by email or call and closes the task, the task's closed time will be recorded as the touch time for that lead using another workflow. Read on to learn more.

Permissions and availability

  • Users with the Modules Customization permission can add custom fields.
  • Users with the Manage Automation permission can create and update workflow rules.
  • Users with the Manage Extensibility permission can create custom functions.
  • Users with the Manage Sandbox permission can manage the sandbox.

Requirements

  • Add a Date/Time field in the Leads module. This field will hold the lead's first touch date and time. Learn more
  • Create a workflow rule for the Leads module that creates and assigns a task on lead creation. Learn more
  • Create another workflow rule for the Tasks module that triggers every time the above task is closed. Learn more
  • Write a custom Deluge function and link it with the workflow rule for tasks to update first touch time in corresponding leads. Learn more
  • Test the workflow rule in a sandbox before deploying it to your production environment. Learn more

Add a custom field

The first step is adding the custom Date/Time field to the Leads module.

  1. Navigate to Setup > Customization > Modules and Fields.
  2. Click the Leads module to open the layout editor.
  3. Drag and drop the Date/Time field from the New Fields tray to the desired section of the layout.
  4. Name the Date/Time field (e.g. "First Touch") and define its properties as required.
  5. Once you have finished, select Done and then click Save and Close.
Add Custom Field

Create a workflow rule to add tasks

Follow the below steps to create a workflow rule that adds tasks.

  1. Navigate to Setup > Workflow Rules > + Create Rule.
  2. Select Leads from the module drop-down list.
  3. Provide a name for the rule. For example: "Create Task on Lead Creation".
  4. Add a description (optional), then click Next.
  5. In the Execute this workflow rule based on section, do the following:
    1. Choose Date/Time field, then select Created Time from the drop-down.
    2. Click Next.
  6. In the Which leads would you like to apply the rule to? section, select All Leads, then click Next.
  7. Under Instant Actions, do the following:
    1. Select Activities > Add Task > New Task.
    2. Enter a subject for the task. For example: "Email or Call the New Lead".
    3. Customize the task's due date, status, and priority as required.
    4. Click Save and Associate.
  8. Click Save on the workflow rule page.

Create a workflow rule to update touch time

Follow the below steps to create a workflow rule that updates the lead's touch time.

  1. Navigate to Setup > Workflow Rules > + Create Rule.
  2. Select Tasks from the module drop-down list.
  3. Provide a name for the rule. For example: "Update First Touch Time in Lead".
  4. Add a description (optional), then click Next.
  5. In the Execute this workflow rule based on section, do the following:
    1. Choose Date/Time field, then select Closed Time from the drop-down.
    2. Click Next.
  6. In the Which tasks would you like to apply the rule to? section, select All Tasks, then click Next.
  7. Under Instant Actions, select Function and Write your own.
  8. Provide a name and description, if necessary, for the function.
  9. On the Deluge Script Editor, do the following:
    1. Copy and paste the code given below.
    2. Click Edit Arguments.
    3. Choose Tasks - Task Id, name it taskId, then click Save.
    4. Click Save and Execute Script.
  10. Click Save on the workflow rule page.

The code

Code Copied
taskinfo = zoho.crm.getRecordById("Tasks",taskId);
module = taskinfo.get("$se_module");
if(module == "Leads")
{
	leadId = taskinfo.get("What_Id").get("id");
	leadinfo = zoho.crm.getRecordById("Leads",leadId);
	first = ifnull(leadinfo.get("First_Touch"),"");
	if(first == "")
	{
		update = zoho.crm.updateRecord("Leads",leadId,{"First_Touch":taskinfo.get("Closed_Time")});
	}
}

Notes

  • Make sure to use the accurate API names for their corresponding fields (e.g., "First Touch") in the code snippet. Learn more
  • The code above is an example to record the first touch time of a lead in one of its custom fields by using its task closed time after sending an email or making a call. You can use this code for any other module, such as contacts or custom, by modifying the module name and parameters.

Tip

  • Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.

Test the solution

  1. Navigate to Leads > +Create Lead.
  2. On the Lead Details page, enter the required information and click Save.
    The first workflow rule will be triggered.
  3. Check whether the task "Email or Call the New Lead" was created and assigned to the lead's owner.
  4. Click Close Task to indicate sending an email or making a call to the lead.
    The second workflow rule will be triggered.
  5. Check whether the closed time of the task was updated as the first touch time in the lead's corresponding field.
    Note: The system may take 2-3 minutes to create a new task and update its closed time as the lead's touch time.

Idea

  • Map the First Touch field in the lead with its corresponding fields in other modules, such as contacts and accounts, to transfer its value to the mapped field on lead conversion. Learn more

Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.

More info

  • ModuleLeads
  • Trigger PointWorkflow Rule
  • EditionEnterprise and above
  • ComplexityHigh
  • Implementation Time60 minutes

Features used in the solution

Custom FieldWorkflow RuleDeluge ScriptSandbox
Story Image

Looking for a custom solution?

Contact us, we will help enhance your productivity at lightning speed.

SUBMIT REQUEST

Developers: Share your solution with our community!