Skip to main content
Gainsight Inc.

Handle Dynamic URLs with Auto Resolve Feature

This article explains PX’s auto resolve feature and how you can use it.

Overview

The Auto Resolve feature in Gainsight PX is a powerful tool designed to handle dynamic URL segments, ensuring that redirects function seamlessly even when URLs change dynamically. It helps you create more flexible and reliable engagements that adapt to the dynamic nature of modern web applications, enhancing the overall user experience.

Auto Resolve automatically identifies and replaces specific dynamic portions of a URL with the appropriate content based on the user's current context. This is particularly useful in scenarios where parts of a URL, for instance user ID, session ID, or any other dynamic path segment, change frequently. Instead of manually adjusting these URLs each time they change, Auto Resolve dynamically updates them, ensuring that redirects are always accurate and relevant.

When a guide is triggered in your product, Auto Resolve reads the current URL and identifies the section marked for dynamic replacement. It then substitutes this section using information from the current domain, subdomain, or specific URL references, such as the path, hash, or query parameters. Essentially, PX Auto Resolve dynamically replaces the specified URL segment with the corresponding part of the user's current URL, ensuring that the URL points to the correct location every time.

Auto Resolve can be used in various scenarios within Gainsight PX such as:

  • URL redirects in guide engagements: To ensure that links within guide engagements and any redirects automatically update to match the user's current context, even when the URLs contain dynamic elements.
  • KC Bot: To ensure that guides within the KC Bot link correctly to the intended product areas, regardless of dynamic segments such as user ID. 

Use Cases

Here are some sample use cases where the PX Auto Resolve feature can be used to handle dynamic URLs.

Multi-Region Application

An application has different domains for different regions (for instance, us.gainsight.com, eu.gainsight.com) and users need to be redirected to a specific section of the app, regardless of their region. Here, you can use the $px-auto-resolve token to handle dynamic protocols as follows: 

 In the above scenario, users are redirected to the dashboard, regardless of their location being US or EU. 

User-Specific Pages

You want to redirect users to their profile pages, where the URL includes a user ID, which is dynamic. You can use the $px-auto-resolve token to handle dynamic paths as follows:

In the above scenario, users are redirected to the profile page, irrespective of the user ID in the URL.

Auto Resolve in PX

Auto Resolve enables the use of dynamic URLs, accommodating situations where the target URL changes or multiple URLs are involved. This feature supplies a token that can be integrated into portions of your URL.

Note: The Auto Resolve functionality is exclusively available for in-app engagements.

The $px-auto-resolve token automatically replaces the equivalent part of the current URL of the page which a user is currently viewing.

Sections of a URL

To use the Auto Resolve feature in PX, it is important to first understand the various parts of a URL that support the feature, and how Auto Resolve can be used for each section.

Section Description Auto Resolve Usage
Protocol The technology used to transfer the data. This field is generally set to either http or https, based on the level of security NA
Domain The most important part of your URL which represents the IP address of your website or web app. For example, the gainsight.com domain. Any part of the domain which is delimited by a period (.), or in the entire domain.
Path The specific section or page of your application or website. Any part of the path which is delimited by a slash (/), or the entire path.
Hash The specific subsection of the webpage. The whole part of the hash.
Query Parameter The data that is sent to the website. Any query parameter value which is to the right of the = operator.

The following URL identifies all the sections of a URL. The color of each part maps with the definitions above.

https://app.gainsight.com/accounts#abcd?q=12345

 Protocol    Domain           Path          hash     Query Parameter

Auto Resolve Best Practices

To use Auto Resolve effectively in PX, keep in mind the following considerations:

Do’s

Dont’s

  • You can use the $px-auto-resolve token to replace a single section or multiple sections of your URL.

  • You can also use the token multiple times within a single section of your URL.

  • If you want to replace multiple parts of a section, you must add the $px-auto-resolve token for each part in the section. For example, you could replace multiple parts in the domain of the URL https://app1.gainsight.com/users using the $px-auto-resolve token as https://$px-auto-resolve.$px-auto-resolve.com/users.

Handle Dynamic URLs using Auto Resolve

Auto Resolve can be used in engagements where a URL redirect is configured. For instance, consider a scenario where you are creating a dialog engagement to notify customers about a new capability to edit users, and want to nudge them to try out the new feature. For this, you add a custom button, with the Action Type set to Redirect to URL. However, the URL might vary depending on the region the user is logged in from (us.gainsight.com, eu.gainsight.com, amea.gainsight.com). 

To cater a correct redirect for the above scenario, use the Auto Resolve token in the following manner, in the URL field under Actions Controls: https://$px-auto-resolve.gainsight.com/EditUser

Auto Resolve can be used in engagements where a URL redirect is configured

Auto Resolve Usage

The following table describes the various scenarios where you can use the $px-auto-resolve feature.

Current URL

Scenario

Auto Resolve URL

Description

https://app1.gainsight.com/users

Users may have app1, app2, or app3 in the domain.

https://$px-auto-resolve.gainsight.com/users

Replaces only the app1 subdomain, keeping the rest of the URL intact. 

The whole domain (app1.gainsight) varies based on the user. 

https://$px-auto-resolve/users

Replaces the entire domain (app1.gainsight.com) allowing for full dynamic resolution of the domain.

Multiple parts of the domain (app1 and/or gainsight.com) may vary based on the user.

https://$px-auto-resolve.$px-auto-resolve.com/users

Replaces multiple parts of the domain (app1 and gainsight), with separate instances of the $px-auto-resolve token.

https://app.gainsight.com/users/123456/overview

User ID in the path varies based on the user.

https://app.gainsight.com/users/$px-auto-resolve/overview

Replaces a part of the path (123456) with a dynamic token, allowing the path to change based on the user's ID. 

The entire path after the domain varies based on the user action (for instance, editing a user).

https://app.gainsight.com/$px-auto-resolve


 

Replaces the whole path (users/123456/overview), which is useful when the entire path structure can change based on user actions.

Multiple dynamic segments in the path (users page and user ID) vary based on the user and action.

https://app.gainsight.com/$px-auto-resolve/$px-auto-resolve/overview 

Replaces multiple parts of the path (users and 123456).

https://app.gainsight.com/accounts?q=123456&p=654321 

The query parameter (account ID) varies based on the account.

https://app.gainsight.com/accounts?q=$px-auto-resolve 

Replaces a specific query parameter (123456) dynamically, which is useful when a particular parameter can change frequently.

Multiple query parameter values vary based on the account and another identifier.

https://app.gainsight.com/accounts?q=$px-auto-resolve&p=$px-auto-resolve 

Replaces multiple query parameterS (123456 and 654321) within the URL, allowing for more granular dynamic changes in the query string.

The entire query parameters section varies based on the user context.

https://app.gainsight.com/accounts?$px-auto-resolve 

Replaces the entire query parameters section (q=123456&p=654321) with the dynamic token.

https://app.gainsight.com/account#pg1124 

The hash segment (for instance, page anchors or routing) varies based on the user's navigation.

https://app.gainsight.com/account#$px-auto-resolve 

Replaces the hash part of the URL (pg1124). 

 

  • Was this article helpful?