Identify visitors and metadata through browser scripting

Last updated:

This article describes how to insert a custom code snippet into an application you control the code for, or can write JavaScript in, to configure Visitor IDs and metadata. This method is an alternative to the standard IT-controlled deployment, and identifies your visitors from a webpage through JavaScript code instead of registry keys. 


To identify visitors through browser scripting, you must:

  • Be an Admin user for the Pendo subscription. For information, see Roles and permissions.
  • Have the Pendo Launcher extension installed on your browser. Any browser that supports the extension is eligible. For information, see the IT guide to deploying the Pendo Launcher.
  • Have an application that allows you to inject a JavaScript snippet, such as an internally built application or a SaaS application that allows JavaScript injection, such as MS Dynamics or Salesforce

Process overview

After setup, visitors are initially set as anonymous. The first time they visit an application where the browser extension (herein, Pendo Launcher) runs, the Pendo Launcher opens a window for the URL of the application you have set up browser scripting with. If the URL you’ve provided can’t automatically identify the visitor, for instance, if it opens a login page, then the visitor must provide their credentials, after which the screen closes.

After the Pendo Launcher browser extension has identified the visitor, the visitor is then forwarded to the URL you provided as part of the setup process. This process only happens once.

Step 1. Configure the Pendo Launcher

First, you must enable the functionality required for identifying visitors and metadata with browser scripting:

  1. In Pendo, navigate to Settings > Subscription Settings.
  2. Under Extension settings select the Set visitor metadata through browser scripting.
  3. In Identification app URL, enter the URL of the application you’re setting up browser scripting for. You only need to configure this in one place for your entire subscription.
  4. Optionally, add a privacy message. Select Show privacy awareness banner and add the text you want to include in your message to explain why the visitor is being asked to identify themselves.
  5. Select Save configuration.

Step 2. Enable identification for browser scripting

  1. In Pendo, navigate to Settings > Subscription Settings.
  2. Open the Applications tab and open the application that matches the entry for Identification App URL in Step 1. For example, if the Identification a4pp URL is you select the application with the Websites field that includes
  3. Select Inject visitor identification function for browser scripting. This controls where the window.__pendoIdentifyVisitor function (found in the code shown Step 3) is injected.

Step 3. Insert the identification JavaScript snippet

Next, insert a JavaScript snippet into an application that you control to identify visitors to the application.

  1. In Pendo, navigate to Settings > Subscription Settings.
  2. Ensure Set visitor metadata through browser scripting under Extension settings > Advanced settings is selected. This reveals more options and information, including the script that you need to modify.
  3. Copy and paste the script into a plain text editor and edit the code to replace VISITOR-UNIQUE-ID with code that identifies the visitor in the application.
  4. Insert the edited code into your application at the URL that matches the entry for Identification App URL in Step 2.


Was this article helpful?
0 out of 0 found this helpful