Google Tag Manager (GTM) is a tag management utility enabling teams to dynamically control which tracking tags are included within their application. If you have GTM installed in your application, you can Pendo to the same application through GTM. After installation, you can control your tracking code through the Google Tag Manager interface.
Step 1: Edit the Pendo install script
To install Pendo through the Google Tag Manager, you must first find, copy, and edit the Pendo install script (commonly referred to as "the snippet"):
- Navigate to app.pendo.io in your browser.
- Ensure you’re on the right subscription in the Subscriptions tab in the left-side navigation.
-
Navigate to Settings > Subscription Settings.
-
Open the Applications tab.
-
Find and open the relevant app from your Applications list.
- Open the Install Settings tab.
- Copy the code into a text editor to edit it.
- Populate the visitor (logged-in user) and account (customer) objects of the install script. This depends on your Google Tag Manager installation, but typically requires Google Tag Manager Variables. Once your Variables are set up, you can specify them in your Pendo installation as
{{variable_name}}
.
For information about the visitor and account objects of the install script, see Choose IDs and metadata.
Note: Pendo expects the Visitor and Account ID’s to be globally unique.
Google Tag Manager runs Pendo using JavaScript and supports conditional logic in the Pendo install script.
For more information about the Pendo install script, see the Developer's guide to implementing Pendo using the install script.
Step 2: Install Pendo with the Google Tag Manager
To install Pendo through the Google Tag Manager:
- Open Google Tag Manager in your browser.
- Select Tags and then New.
- Choose Custom HTML Tag and copy-paste the Pendo code block you edited as part of Step 1 into the Configure Tag field.
- Select the Choose a trigger to make this tag fire... pane. The Page View trigger type for All Pages is the default trigger. This loads Pendo every time that a page is viewed by your visitors, which is the intended behavior.