Automate Salesforce with HyperTrack integration

Integration with Salesforce

To track sales agents and share their ETA with your customers, you use the following to integrate with Salesforce:

  • Trips API: Trips API allows you to create trips for your sales agents visiting customers. They can be tracked via embeddable views for operations managers and your customers can get real-time location and ETA experience on their devices via a share URL
  • Devices API: Use this API to obtain device_id for your sales agent who you want to track
  • Generate invitation links API: Easily and frictionlessly deploy Visits App to your sales agents by generating unique deep links for each sales agent
  • Visits App: Use Visits App as an app to perform tracking of sales agents in real-time
  • Embeddable Views: Use real-time embaddable views as part of your Salesforce app experience for operations managers

Distribute Visits App to sales agents

HyperTrack provides an Generate invitation links API for you to generate personalized deep links for your user to install Visits App.

note

You must deploy Visits App to your sales agent once the agent is added to your organization. Once your sales agent installs Visits App, you will be able to obtain the device_id you need to create trips with ETA.

Use Salesforce User identifier to generate a unique invitation link payload.

For example, to generate a unique invitation for the user 0053t000007wsZPAAY you create deep link URLs with the following payload:

payload='{
"metadata":
[
{"driver_id": "0053t000007wsZPAAY"}
]
}'

with a result like this:

[
{
"url": "https://hypertrack-logistics.app.link/1peqNytrWab",
"metadata": {"driver_id": "0053t000007wsZPAAY"}}
]

After you obtain the link, you can choose your preferred communication method. You can send this link to your sales agent via email, SMS, or WhatsApp, for example.

Once your user installs Visits App with https://hypertrack-logistics.app.link/1peqNytrWab URL from above, the user's new device_id becomes automatically associated with the User record identifier that is submitted in the payload above.

note

Once the app installs and loads, it will process deep link data from the invitation and connect your User's Id as primary identity to the device in your HyperTrack account. In some cases, this may take time before screens below are loaded.

Visits App install experience

Your mobile Salesforce user will go through some of the following screens to get started tracking with HyperTrack:


Salesforce Visits App Open   Salesforce Location Access


Once your sales agent grants location and motion permissions in the app, the app is ready to use.

Using Visits App

Visits App will only start tracking once you create a trip for the sales agent. Once the trip is completed, tracking will stop.

Create VIP customer experience with Trips API integration

Use SFDC objects (which may be such as Opportunities, Leads, Tasks, Accounts, Contacts, and People) to determine when to create a trip for a sales agent (sales agent) to reach a visit destination. Once the trip is created, you generate a share URL that can be used to communicate agent's location and ETA.

You may create a trip for a sales agent, for example, 2 hours before scheduled appointment. Once a trip is created, Visits App starts tracking on your agent's device.

Identify sales agent device

Prior to trip creation, you identify which device_id your user has. Please use driver_id metadata to search for your sales agent's device_id prior to the trip creation.

Use Devices API to find and obtain your sales agent's device identifier.

HyperTrack Devices API provides you an option to use a metadata_filter query parameter to help you conveniently retrieve your sales agent's device_id:

GET /devices?metadata_filter=<url_encoded_json>

with an example JSON for the value as listed above:

{
"driver_id": "0053t000007wsZPAAY"
}

Once you perform URL encoding for the string above, you Devices GET API call will be executed as follows:

GET /devices?metadata_filter=%7B%27driver_id%27%3A+%270053t000007wsZPAAY%27%7D

For further reference, please see this guide.

Trip Creation

You create a trip for a sales agent once you have your agent installs Visits App and you retrieve its device_id as explained above.

As mentioned above, you may create a trip for a sales agent, for example, 2 hours before scheduled appointment or whenever it best fits your use case.

You can create a trip with destination as explained here. In order to create a trip, you need to determine which SFDC objects to use in order to provide lat and long for the destination, scheduled time, as well as which sales agent's device_id will be used.

Share URL wih ETA experience

As part of the Trips API response, you will be able to obtain a share URL which your customers may use to track sales agent's location and their ETA. Trips API returns share_url upon successful creation of the trip. The share_url is build for sharing with customers. While the trip is ongoing, customers will see a mobile-web view of the order's live location with route and ETA to destination. For completed trips, customers will see the trip summary from start to complete.

Tracking Experience

Share URL has the following structure: https://trck.at/{7_digit_tracking_id}.

This makes it a total of 23 characters, and therefore a friendly URL to share via text or other messengers. Share URLs stay accessible permanently and show trip summary after trip completion.

Trip Completion

Once your sales agent reaches destination and exits it after the completion of the appointment, you wll get webhook notification payload upon the event when your sales agent leaves after the appointment with exiting the desination geofence. Please see this guide section to review destination exit notifications documentation.

Upon the reception of notification, your backend logic can execute trip completion as explained in this guide. If there are no other pending trips for the sales agent, Visits App will stop tracking on your sales agent's device.

Embeddable real-time tracking views

Once your user installs Visits App, you can embed the user's real-time view inside your Saleforce application as explained in this guide. Please refer to this guide to explore customization options.

Please watch this video to understand how to use and embed custom tracking views.

Questions?

If you have questions or comments on any of the topics above, please do not hesitate to contact us.