Prerequisites
You need a Google Tag Manager account. If you don't have one, there are tutorials available
You will need your Google Tag Manager code. This code is visible at the top right corner of your GTM interface. It looks like
GTM-9032993
.
Step 1: Integrate Google Tag Manager with Your Client Portal
Get your Google Tag Manager code from your GTM account.
Go to settings in your client portal.
Navigate to client portal settings/domain.
Scroll down to the Google Tag manager field.
Paste your GTM code into this field.
Save your changes.
Step 2: Setting Up Google Tag Manager for Your Client Portal
Once you have integrated GTM with your portal, you can start adding custom scripts.
Creating a Trigger for All Page Views
This trigger will activate tags (which contain your scripts) on all pages of your client portal.
Go to Triggers in your Google Tag Manager account.
Click New to create a new trigger.
Set the Trigger Type to Custom Event.
Enter the exact name:
upflow model page views
.Ensure that the trigger fires on all events.
You can name this trigger something descriptive, like "All Portal Page Views".
Save the trigger.
Targeted Implementation (Specific Pages)
If you want a script to fire only on a specific page (for example, the homepage after login), follow these steps:
Identify the URL of the specific page. For example, the homepage URL after login might be
/private poll
. You can find this by logging in to your portal and navigating to the page.Go to Triggers and click New to create a new trigger.
Set the Trigger Type to Custom Event.
Select the option for the trigger to fire on Some Custom Events.
Under "Fire this trigger when...", select Page Path (or Page URL) from the dropdown menu.
Choose contains as the matching condition.
Enter the specific part of the URL (e.g.,
private
) in the value field. This ensures the trigger will only fire on pages whose URL contains this text.Give your trigger a descriptive name, like "Homepage Trigger".
Save the trigger.
Creating a Tag for All Pages
This tag will contain the HTML snippet of the tool you want to install (e.g., Intercom, HubSpot) and will be activated by the "All Portal Page Views" trigger.
Go to Tags in your Google Tag Manager account.
Click New to create a new tag.
Choose Custom HTML as the Tag Type.
In the HTML field, add the HTML snippet provided by the tool you want to install. This is the basic script for the tool.
In the Triggers section, click Choose a trigger... and select the
upflow model page views
trigger you created earlier. This will ensure the script runs on all portal pages.Save the tag.
To make the changes live on your portal, click the Submit button in the top right corner of your GTM interface and then click Publish.
Creating a Tag for a Specific Page
Go to Tags and click New to create a new tag.
Choose Custom HTML as the Tag Type.
Add the HTML snippet for the tool you want to install.
In the Triggers section, select the new trigger you created for the specific page (e.g., "Homepage Trigger").
Save the tag.
Submit and Publish your changes in GTM. This will make the script fire only on the specified page.
Exceptions
You can also set up exceptions to prevent a script from firing on certain pages. For example, if you have a tag that fires on all pages, but you don't want it to fire on the homepage:
When configuring your tag, go to the Exceptions section and click Add Exception.
Select a trigger that is configured to fire on the page you want to exclude (e.g., the "Homepage Trigger" you created earlier).
Save your tag.
By following these steps, you can effectively use Google Tag Manager to add custom scripts and tools to your client portal. Remember to save your triggers and tags and publish your changes in Google Tag Manager for them to take effect.