Use the Location API to transform the URL collected by the Pendo Web SDK. This is useful when the default application URL doesn't reflect how your app is structured or when you want more control over the URL collected by Pendo. The Location API works only in web and Electron applications where Pendo is installed via the install script.
Important: Location API isn't supported for browser extension installations or mobile app installations.
Requirements
Before continuing with these guidelines, confirm the following:
- Your web SDK version is 2.108.0 or above for web applications.
- Your web SDK version is 2.126.0 or above for Electron applications.
- You have a developer ready to implement Location API.
- If you're using any of the following deprecated methods, they must be removed before Location API is implemented:
sanitizeUrl,annotateUrl,ignoreHashRouting,queryStringWhitelist, andxhrWhitelist. These methods aren't compatible with Location API and will prevent it from working correctly. If you’re not using any of these methods, no action is needed.
How it works
Location API transforms the URL collected by the Pendo Web SDK. This affects how Pendo tags Pages and decides when to display a guide, but doesn't change the actual URL shown to end users. You can use Location API to transform all of the URLs across your application or just the URLs for specific pages. Location API changes aren't retroactive - previously collected URLs remain unchanged.
Plan and implement your transformation
Before implementing the Location API, identify how URLs should be structured for easier tagging and reporting:
- Determine which parts of the URL to keep, edit, or remove.
- Decide how to structure URLs for consistent Page rules.
- Create a transformation plan and share it with your developer.
For example, if your app uses a single-page layout with query parameters, you might want to replace or flatten those parameters into path segments.
Ask your developer to make the necessary code changes to your application. Refer them to the Location API technical documentation. They can implement the transformation:
- During initialization with the Pendo Web SDK.
- Programmatically at any time using the Location API.
Example use cases
| Example scenario | Impact of Location API |
|
You need Pendo to distinguish between different pages in the product, but the URL doesn’t change. https://acme.com/ |
Text is added to the end of the URL so that it is more unique and can be tagged as a separate page. https://acme.com/dashboard |
|
Your users navigate through a form with 5 steps, but the URL is the same for all 5 steps. https://acme.com/form-creation |
Each step now has a unique URL and can be tagged individually. You can track form completion and target guides to each step. https://acme.com/form-creation?step=1 |
|
Hashed URL fragments cause unwanted guide redisplay or inflated page views. https://acme.com/features#featureA |
Removing fragments keeps the URL consistent and avoids guide redisplay or overcounting of page views. https://acme.com/features
|
|
The URL contains sensitive data that shouldn't be collected. https://acme.com/user/123-456-789/details |
Sensitive values are removed or replaced with placeholders. https://acme.com/user/details |
|
The URL has unnecessary query parameters. https://acme.com/dashboard?report=timecard&state=georgia |
Only the required parameters are captured to simplify reporting and guide targeting. https://app.acme.com/dashboard?report=timecard |
|
The URL uses an unsupported syntax for Pendo page tagging. https://acme.com/products;color=blue/category;type=shoes |
Transforms the URL into a supported format so it can be tagged properly. https://acme.com/products/category?color=blue&type=shoes |
Verify your implementation
After implementation, use any of the following methods to confirm that URLs are being transformed correctly.
In the Visual Design Studio
- Go to Product > Pages in Pendo.
- Launch the Visual Design Studio.
- Navigate to a Page where the Location API is active.
-
Check the Current URL field. This should show the transformed URL.
In the Pendo debugger
- Navigate to a Page where the Location API is active.
- Open the Developer Console and run
pendo.enableDebugging()to launch the Pendo Debugger. - In the Debugger, go to the Config tab.
- Under Frame Selector, compare the values for Frame href (Pendo's collected URL) and Browser URL (your browser's actual URL). The two should differ if the transformation was successful.
Tip: If your page has multiple iFrames, you can choose a specific iFrame from the Frame Selector dropdown).
With pendo.location.getHref()
- Open your browser's developer console.
- Run
pendo.location.getHref() -
The returned value should reflect the transformed URL.
With pendo.validateEnvironment()
- Open your browser's developer console.
- Run
pendo.validateEnvironment() - Scroll to the URL Validation section.
-
Look for the message: "URL has been customized..."